From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66448 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-registry flags API Date: Thu, 06 Mar 2008 15:50:23 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <86ejan1q00.fsf@jumptrading.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> <86bq5u9kkd.fsf@lifelogs.com> <863ar5807t.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1204840205 32574 80.91.229.12 (6 Mar 2008 21:50:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Mar 2008 21:50:05 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M14939@lists.math.uh.edu Thu Mar 06 22:50:30 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 1JXNyp-0004ny-8T for ding-account@gmane.org; Thu, 06 Mar 2008 22:50:23 +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 1JXNxM-0005D9-KB; Thu, 06 Mar 2008 15:48:52 -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 1JXNxK-0005Cu-Or for ding@lists.math.uh.edu; Thu, 06 Mar 2008 15:48:50 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1JXNxE-0001TE-Jf for ding@lists.math.uh.edu; Thu, 06 Mar 2008 15:48:50 -0600 Original-Received: from mail.blockstar.com ([170.224.69.95]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1JXNxK-0002hF-00 for ; Thu, 06 Mar 2008 22:48:50 +0100 Original-Received: from tzlatanov-ubuntu-desktop.jumptrading.com (unknown [38.98.147.130]) by mail.blockstar.com (Postfix) with ESMTP id 6C3563F8E96 for ; Thu, 6 Mar 2008 13:50:32 -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:080306:ding@gnus.org::w/UuJTgWPLVpVp/m:00004MfS 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:66448 Archived-At: On Wed, 05 Mar 2008 13:00:54 -0600 Ted Zlatanov wrote:=20 TZ> On Tue, 04 Mar 2008 16:43:46 -0600 Ted Zlatanov wrot= e:=20 TZ> I couldn't figure out the text properties, or how to update the summary TZ> line as soon as a flag is set. For now I've comitted a function TZ> gnus-registry-user-format-function-M that shows the flags (unsorted, in TZ> the order they were set). But the user has to exit the group and TZ> re-enter it to see the new flags. I'll take a look again but if someone TZ> knows how to do it, please let me know to save me all the work. TZ> I still haven't done text properties, but the rest is working now. See TZ> gnus-registry-user-format-function-M and gnus-registry-install-shortcuts TZ> for the details. I played with the text properties, but they just don't look very nice. The image needs to be aligned exactly with the character size or the line is skewed, and I didn't want to spend the time getting that perfect alignment. Here's an example user formatting function which inserts an image (as Reiner showed me) at the insertion point, in case someone wants to play with it further. (defun gnus-registry-user-format-function-propertized-M (headers) (let* ((id (mail-header-message-id headers)) (marks (when id (gnus-registry-fetch-extra-marks id)))) (with-temp-buffer (dolist (mark marks) (let* ((info (cdr-safe (assoc mark gnus-registry-marks))) (c (plist-get info :char)) (i (plist-get info :image))) (when c (insert c) (when i (add-text-properties (1- (point)) (point) (list 'display gnus-mode-line-image-cache 'help-echo "To do") (current-buffer)))))) (buffer-string)))) Users can just use a Unicode character until someone provides a better user formatting function. Here's my Greek letter setup (omega for "work" is a stretch, but I didn't want to overthink this :) (setq gnus-registry-marks=20=20 '((Important :char ?=CE=B9) (Work :char ?=CF=89) (Personal :char ?=CF=80) (To-Do :char ?=CF=84) (Later :char ?=CE=BB))) Note :image is not specified as it is in the default specification of the variable. It's not used, and none of the current functionality needs it, so it can be safely omitted. Ted