From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66437 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-registry flags API Date: Tue, 04 Mar 2008 16:43:46 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <86bq5u9kkd.fsf@lifelogs.com> References: <861w9jeaw4.fsf@lifelogs.com> <86ve6avlnf.fsf@lifelogs.com> <86ir1u3g8b.fsf@lifelogs.com> <864pddzbdu.fsf@lifelogs.com> <86d4raats5.fsf@lifelogs.com> <86skzdnmh2.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204789225 1152 80.91.229.12 (6 Mar 2008 07:40:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Mar 2008 07:40:25 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M14928@lists.math.uh.edu Thu Mar 06 08:40:52 2008 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 1JXAih-0001Cc-FC for ding-account@gmane.org; Thu, 06 Mar 2008 08:40:51 +0100 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 1JXAhX-0006xn-Vt; Thu, 06 Mar 2008 01:39:40 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1JWfpu-0005nY-8u for ding@lists.math.uh.edu; Tue, 04 Mar 2008 16:42:14 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1JWfpo-00080J-3i for ding@lists.math.uh.edu; Tue, 04 Mar 2008 16:42:14 -0600 Original-Received: from mail.blockstar.com ([170.224.69.95]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1JWfpu-00015j-00 for ; Tue, 04 Mar 2008 23:42:14 +0100 Original-Received: from tzlatanov-ubuntu-desktop.jumptrading.com (unknown [38.98.147.130]) by mail.blockstar.com (Postfix) with ESMTP id BCA5B3E8085 for ; Tue, 4 Mar 2008 14:43:38 -0800 (PST) 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" X-Hashcash: 1:20:080304:ding@gnus.org::dZ7WR0yKSXYEYKfb:00001jmw In-Reply-To: (Reiner Steib's message of "Thu, 28 Feb 2008 21:04:04 +0100") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:66437 Archived-At: On Thu, 28 Feb 2008 21:04:04 +0100 Reiner Steib wrote: RS> On Thu, Feb 28 2008, Ted Zlatanov wrote: >> On Sat, 16 Feb 2008 21:26:36 +0100 Reiner Steib 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