From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Subject: Re: gnus-registry flags API
Date: Tue, 04 Mar 2008 16:43:46 -0600 [thread overview]
Message-ID: <86bq5u9kkd.fsf@lifelogs.com> (raw)
In-Reply-To: <v93arcj1aj.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Thu, 28 Feb 2008 21:04:04 +0100")
On Thu, 28 Feb 2008 21:04:04 +0100 Reiner Steib <reinersteib+gmane@imap.cc> wrote:
RS> On Thu, Feb 28 2008, Ted Zlatanov wrote:
>> On Sat, 16 Feb 2008 21:26:36 +0100 Reiner Steib <reinersteib+gmane@imap.cc> wrote:
RS> Can we have multiple registry marks for a single article? If not, we
RS> may either display all strings/images or add a plus sign.
>>
>> Yes, multiples are allowed. That's what makes it tricky to display
>> them, so I haven't done it yet :)
>>
>> Maybe reserve 4 characters,
RS> Or just use the number from the format specifier, if feasible.
>> and if more than 4 labels are set, show the first 3 and then '+'.
>> In the modeline or in the article buffer with a post-processing
>> function we can show them all. I don't know much about this area of
>> Gnus, especially image display, sorry.
RS> Me neither. But I'd guess we can do it like in
RS> `gnus-mode-line-buffer-identification' (`add-text-properties') or
RS> `gnus-picon-transform-address' (`propertize').
RS> E.g. try this in *scratch* (while running Gnus):
RS> (add-text-properties 4 5
RS> (list 'display gnus-mode-line-image-cache
RS> 'help-echo "To do")
RS> (current-buffer))
I couldn't figure out the text properties, or how to update the summary
line as soon as a flag is set. For now I've comitted a function
gnus-registry-user-format-function-M that shows the flags (unsorted, in
the order they were set). But the user has to exit the group and
re-enter it to see the new flags. I'll take a look again but if someone
knows how to do it, please let me know to save me all the work.
Also the string-building construct in that function
(defun gnus-registry-user-format-function-M (headers)
(let* ((id (mail-header-message-id headers))
(marks (when id (gnus-registry-fetch-extra-marks id)))
(out ""))
(dolist (mark marks)
(let ((c (plist-get
(cdr-safe
(assoc mark gnus-registry-marks)) :char)))
(setq out (format "%s%s"
out
(if c
(char-to-string c)
"")))))
out))
is ugly. How would I do the same with mapcar? I couldn't find a nice
way to eliminate nil entries (when the flag has no :char property) from
the resulting list I would pass to concat; concat would get a list like
(?l ?i nil) and fail.
Ted
next prev parent reply other threads:[~2008-03-04 22:43 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
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 [this message]
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=86bq5u9kkd.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).