Gnus development mailing list
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Subject: Re: gnus-registry flags API
Date: Thu, 03 Jan 2008 11:55:48 -0600	[thread overview]
Message-ID: <86ve6avlnf.fsf@lifelogs.com> (raw)
In-Reply-To: <v9y7b63kdg.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Thu, 03 Jan 2008 18:10:51 +0100")

On Thu, 03 Jan 2008 18:10:51 +0100 Reiner Steib <reinersteib+gmane@imap.cc> wrote: 

RS> On Wed, Dec 19 2007, Ted Zlatanov wrote:
>> On Tue, 25 Sep 2007 11:26:08 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote: 
>> 
TZ> The frontend functionality I would like:
>> 
TZ> - set a flag for an article (this should be a simple function a user can
TZ> call from a group or message buffer, which grabs the message ID and uses
TZ> the gnus-registry API afterwards)
>> 
TZ> - indicate the article flags somehow (fringe or status line maybe?)
>> 
TZ> - add summary line formatting support for arbitrary flags
>> 
TZ> Any suggestions or contributions (especially the three items above) are
TZ> welcome.  Please review and criticize the code if you can, I haven't
TZ> done Emacs Lisp in a bit :)
>> 
>> I added the essential functions (first on the list) in CVS, now we need
>> a status line / summary line integration for these.  

RS> We need documentation in the manual for this as well as for
RS> `gnus-registry.el' in general.  The only hits for "registry" in the
RS> manual are in the context of spam*.el.

Yes.  I've been avoiding that work, pretending I was waiting for the
registry to mature :)

I've been using it for a while now, and the only real problem was with
multilingual characters corrupting the registry, and I think I've found
all the places where that could happen.  So it's probably mature enough
to popularize properly.  I'll do the docs once the items below have been
finished.

RS> BTW: I'd like to switch from `nnmail-split-fancy-with-parent' to
RS> `gnus-registry-split-fancy-with-parent'.  

Great, I think a lot of people will like it better.  Once this and
tramp-imap.el work, I'll try to get to cross-server mail splitting,
which has always seemed to me a really nice TODO item and I've needed it
many times.  I mention cross-server splitting because it relates to
gnus-registry splitting, since the registry will notice articles across
servers.

RS> Is there a conversion function from `nnmail-message-id-cache-file'
RS> to `gnus-registry-cache-file'?

Not currently, but the Gnus registry is built every time you visit a
group and see articles, so I doubt this is a big deal.  We could write a
simple conversion function, does anyone need it?

>> Note that the MARK here is really any Lisp symbol, so
>> 'hello-there-flag and 'goodbye-here-but-I-like-verbosity-flag are
>> OK.  Go wild.
>> 
>> gnus-registry-mark-article ARTICLE &optional MARK REMOVE
>> 
>> - if ARTICLE is nil, use current article

RS> When used interactively, the current article should be the default
RS> too.  Now it insists on "Please enter a number.".  Maybe `article'
RS> should be optional?

Yes, I think that's my error, and it should not be doing that
interactive query.  I'll add the necessary code for this plus the
process convention plus flag completion (see below).

RS> I did `M-: (gnus-registry-mark-article nil) RET' without initializing
RS> the registry.  AFAICS, this is a no-op -- at least no
RS> ~/.gnus.registry.eld was created.  It should probably signal an error.

On load, we do:

(defvar gnus-registry-hashtb (make-hash-table 			    
			      :size 256
			      :test 'equal)
  "*The article registry by Message ID.")

So afterwards, all the operations will work on that hash table
automatically.  You need to save the registry (which is automatically
done on load with (add-hook 'gnus-save-newsrc-hook 'gnus-registry-save))
to get the file.  You also need to read that file on startup; the
default setup is:

(when gnus-registry-install
  (gnus-registry-install-hooks)
  (gnus-registry-read))

>> - if MARK is nil, use gnus-registry-flag-default (you don't want that,
>> it's boring)

RS> When called interactively, it should prompt for flags with completion.
RS> At least the Mozilla labels ("Important" "Work" "Personal" "To do"
RS> "Later" <http://www.mozilla.org/mailnews/specs/labels/>) should be
RS> offered by default.  The user may add additional flags to this list
RS> and also set arbitrary flags.

How do you propose I do this, with a customizable list in the registry
namespace or a Gnus-wide customization setting?

Either way it shouldn't be too hard, though I haven't done it myself.

Isn't the Important flag confusing?  It may be seen as conflicting with
the Gnus tick mark.  I'm OK with this list otherwise.

>> - if REMOVE is t, remove MARK from the flags
>> 
>> gnus-registry-article-marks ARTICLE: get list of marks for the article
>> 
>> - if ARTICLE is nil, use current article

RS> Same remark as for `rs-gnus-summary-line-label-alist'.

Not sure what you mean?

>> Let me know if you find bugs or inconsistencies.  I am especially
>> curious how these should integrate with the other Gnus summary
>> functions, and if they should take prefix arguments, etc.

RS> It should accept Gnus' standard process/prefix convention.

Is there one prototype function I can copy for this?

Thanks
Ted



  reply	other threads:[~2008-01-03 17:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-25 16:26 Ted Zlatanov
2007-09-25 19:58 ` Bastien
2007-09-25 23:40 ` Leo
2007-12-19  1:22 ` Ted Zlatanov
2008-01-03 17:10   ` Reiner Steib
2008-01-03 17:55     ` Ted Zlatanov [this message]
2008-01-04 17:43       ` Reiner Steib
2008-01-15 21:56         ` Ted Zlatanov
2008-01-16 21:52           ` Ted Zlatanov
2008-02-06 17:17             ` Ted Zlatanov
2008-02-16 20:26               ` Reiner Steib
2008-02-28 15:12                 ` Ted Zlatanov
2008-02-28 20:04                   ` Reiner Steib
2008-02-29 23:19                     ` Ted Zlatanov
2008-03-04 22:43                     ` Ted Zlatanov
2008-03-05 19:00                       ` Ted Zlatanov
2008-03-06 21:50                         ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ve6avlnf.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).