From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65253 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: gnus-registry flags API Date: Tue, 25 Sep 2007 11:26:08 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1190737652 3769 80.91.229.12 (25 Sep 2007 16:27:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Sep 2007 16:27:32 +0000 (UTC) To: Ding Mailing List Original-X-From: ding-owner+M13765@lists.math.uh.edu Tue Sep 25 18:27:27 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1IaDFt-000456-H1 for ding-account@gmane.org; Tue, 25 Sep 2007 18:27:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1IaDFY-0004Zv-6P; Tue, 25 Sep 2007 11:27:04 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IaDFW-0004Zf-E5 for ding@lists.math.uh.edu; Tue, 25 Sep 2007 11:27:02 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IaDFQ-0002E0-Gn for ding@lists.math.uh.edu; Tue, 25 Sep 2007 11:27:02 -0500 Original-Received: from blockstar.com ([170.224.69.95] helo=mail.blockstar.com) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IaDFH-0005tU-00 for ; Tue, 25 Sep 2007 18:26:47 +0200 Original-Received: from tzz (c-24-14-57-89.hsd1.il.comcast.net [24.14.57.89]) by mail.blockstar.com (Postfix) with ESMTP id 9D1833F80D4 for ; Tue, 25 Sep 2007 09:41:35 -0700 (PDT) X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Followup-To: Ding Mailing List User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (darwin) X-Spam-Score: -2.4 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65253 Archived-At: I added an API to the gnus-registry for reading and writing flags. It's very simple (id is always the message ID): ;; get the list of flags (note it's a list) (gnus-registry-fetch-extra-flags id) ;; set 'important and 'todo flags (note the parameters are not a list) (gnus-registry-store-extra-flags id 'important 'todo) ;; remove just the 'important flag (gnus-registry-delete-extra-flags id 'important) ;; is 'important set? (gnus-registry-has-extra-flag id 'important) ;; remove all the flags (gnus-registry-store-extra-flags id nil) ;; convenience function for the above (gnus-registry-delete-all-extra-flags id) Because of the design of the gnus-registry, these flags will persist as a message gets moved between groups. The flag data is *not* stored in the newsrc file, which I think is an advantage over server-side flags for certain situations. Code could be written to synchronize server-side flags with gnus-registry flags, though I think it's more valuable as a parallel facility that backends don't use, only intended for frontend functionality. Caching the flags (for quick lookup of all the 'important messages, for example) will need some extra work, as the current caching assumes that the extras value associated with a particular message and extras key is not a list. The frontend functionality I would like: - set a flag for an article (this should be a simple function a user can call from a group or message buffer, which grabs the message ID and uses the gnus-registry API afterwards) - indicate the article flags somehow (fringe or status line maybe?) - add summary line formatting support for arbitrary flags Any suggestions or contributions (especially the three items above) are welcome. Please review and criticize the code if you can, I haven't done Emacs Lisp in a bit :) Ted