From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/56825 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?q?Jochen_K=FCpper?= Newsgroups: gmane.emacs.gnus.general Subject: Re: display picons _and_ textual address Date: Sat, 27 Mar 2004 13:14:44 +0100 Organization: Fritz-Haber-Institut der MPG Sender: ding-owner-qhrM8SXbD5ICJmmTlSVZx4dd74u8MsAO@public.gmane.org Message-ID: <86r7vepjuz.fsf@doze.rz-berlin.mpg.de> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1080389668 25652 80.91.224.253 (27 Mar 2004 12:14:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 27 Mar 2004 12:14:28 +0000 (UTC) Original-X-From: ding-owner+M5364-qhrM8SXbD5ICJmmTlSVZx4dd74u8MsAO@public.gmane.org Sat Mar 27 13:14:19 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B7Chf-0002cx-00 for ; Sat, 27 Mar 2004 13:14:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1B7Ch9-0008Fk-00; Sat, 27 Mar 2004 06:13:47 -0600 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1B7Cgy-0008Fc-00 for ding@lists.math.uh.edu; Sat, 27 Mar 2004 06:13:36 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1B7Cgx-0005jy-S5 for ding@lists.math.uh.edu; Sat, 27 Mar 2004 06:13:35 -0600 Original-Received: from mail-in-06.arcor-online.net (mail-in-06.arcor-online.net [151.189.21.46]) by justine.libertine.org (Postfix) with ESMTP id B42CE3A006A for ; Sat, 27 Mar 2004 06:13:33 -0600 (CST) Original-Received: from doze.rz-berlin.mpg.de.fhi-berlin.mpg.de (dsl-213-023-142-239.arcor-ip.net [213.23.142.239]) by mail-in-06.arcor-online.net (Postfix) with ESMTP id 331F6650E5 for ; Sat, 27 Mar 2004 13:13:32 +0100 (CET) Original-To: ding-smP1P7uqpqc@public.gmane.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEUcGRSqioSCPi7Cwbxu Vk5MQjycXkxMKiQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFG2qEAAAB5klEQVR42nXUwY7aMBAA UK8E4tqpI/fMKIWzFdBewcwm10WA9tpksz6zFci/37GdxF7a+mLwi2fGQ4yo/jPE9AkaIcRM/gU7 EcfTA/zgtWsuEfRmWPVjlsOryMYpAYgvYz9B8RXmhxHEw/gcQD+sz/cDbMLXhbu7a6j6Nob6FuDW U21+uje8nuUA/rnXxR4ArCWi5jhWJSJUmoWop7HckPt+Bz6PsrYmexgg5HY3CDvKuq/lAM9hB4VQ HfZEMt8xj2BLSrD1cDlThNJMoXSEWnroDJr3HM5nDtUbRIPuluDqLlx8YdYuh0o87S6+DWANUrn+ Pf0eO7vh1Awf98XKXi/jAatnCwU/Bebl5pZqjRNs2xa4IcoqdEuN5QSbFn3pYLkqqbtyLLfSEbQi XEn4jsvpZRiAO7UCUCYBhE7zhAgSclAyToiSO5xgA+8RONYqD6X3YYdWnakJU1WVPsaI0LXU5VBF kMr6aJTBPk4KfP5SJoAYEXpE5/4FVnVrpHQ/tny/pAduZl/bBDsGLbkqD7ZN0PgbCfwucPL49gzd pZmPw22SoPoc+iZkAL+J6nRrdQEHf+4Qqm4TFJJ8idxYrumY/QEAFHQI65xhcZqgOEHhTAhk6WUu jgPohnc4wgD21+zN+c79AZmNym6Cgz4IAAAAAElFTkSuQmCC User-Agent: No Gnus v0.2 X-Archive: encrypt X-Attribution: Jochen X-Request-PGP: http://jochen-kuepper.de/computer/keys.asc X-URL: http://jochen-kuepper.de In-Reply-To: (Reiner Steib's message of "Thu, 25 Mar 2004 14:21:55 +0100") Original-Lines: 31 X-Spam-Score: -4.8 (----) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:56825 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:56825 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, 25 Mar 2004 14:21:55 +0100 Reiner Steib wrote: Reiner> On Thu, Mar 25 2004, Jesper Harder wrote: >> Reiner Steib <4.uce.03.r.s-Xv0xCBoRcaZkYx7DZD8BGw@public.gmane.org> writes: >>=20 >>> does anyone have code to display picons similar to the way Loom [1] >>> does? Loom displays the textual address _and_ picons whereas the >>> picons *replace* the textual parts in Gnus. >>=20 >> Here's a patch. I think it looks a lot better than the current >> style. Me too. Thanks! Reiner> - (cons 'space (list :align-to (- (window-width) 1 len)))))) Reiner> + (cons 'space (list :align-to (- (window-width) len)))))) Agreed; looks even nicer;) I added the analogous patch to gnus-picon-transform-newsgroups, complete diff against cvs HEAD attached. Greetings, Jochen --=20 Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de Libert=E9, =C9galit=E9, Fraternit=E9 GnuPG key: CC1B0B4D (Part 3 you find in my messages before fall 2003.) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=picons.diff ? autom4te.cache Index: lisp/gnus-picon.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-picon.el,v retrieving revision 7.2 diff -u -u -r7.2 gnus-picon.el --- lisp/gnus-picon.el 5 Feb 2004 02:42:26 -0000 7.2 +++ lisp/gnus-picon.el 27 Mar 2004 12:09:20 -0000 @@ -151,6 +151,8 @@ ;;; Functions that does picon transformations: +(defvar gnus-picon-style 'right) + (defun gnus-picon-transform-address (header category) (gnus-with-article-headers (let ((addresses @@ -162,7 +164,7 @@ (mail-encode-encoded-word-string (or (mail-fetch-field header) ""))) (mail-fetch-field header)))) - spec file point cache) + spec file point cache len) (dolist (address addresses) (setq address (car address)) (when (and (stringp address) @@ -193,16 +195,36 @@ (gnus-article-goto-header header) (mail-header-narrow-to-field) - (when (search-forward address nil t) - (delete-region (match-beginning 0) (match-end 0)) - (setq point (point)) - (while spec - (goto-char point) - (if (> (length spec) 2) - (insert ".") - (if (= (length spec) 2) - (insert "@"))) - (gnus-picon-insert-glyph (pop spec) category)))))))) + (case gnus-picon-style + (right + (when (= (length addresses) 1) + (setq len (apply '+ (mapcar (lambda (x) + (condition-case nil + (car (image-size (car x))) + (error 0))) spec))) + (when (> len 0) + (goto-char (point-at-eol)) + (insert (propertize + " " 'display + (cons 'space (list :align-to (- (window-width) 1 len)))))) + (goto-char (point-at-eol)) + (setq point (point-at-eol)) + (dolist (image spec) + (unless (stringp image) + (goto-char point) + (gnus-picon-insert-glyph image category))))) + (inline + (when (search-forward address nil t) + (delete-region (match-beginning 0) (match-end 0)) + (setq point (point)) + (while spec + (goto-char point) + (if (> (length spec) 2) + (insert ".") + (if (= (length spec) 2) + (insert "@"))) + (gnus-picon-insert-glyph (pop spec) category))))) + ))))) (defun gnus-picon-transform-newsgroups (header) (interactive) @@ -224,16 +246,36 @@ (cons (gnus-picon-create-glyph file) (nth i spec))))) (push (cons group spec) gnus-picon-cache)) - (when (search-forward group nil t) - (delete-region (match-beginning 0) (match-end 0)) - (save-restriction - (narrow-to-region (point) (point)) - (while spec - (goto-char (point-min)) - (if (> (length spec) 1) - (insert ".")) - (gnus-picon-insert-glyph (pop spec) 'newsgroups-picon)) - (goto-char (point-max)))))))) + (case gnus-picon-style + (right + (when (search-forward group nil t) + (setq len (apply '+ (mapcar (lambda (x) + (condition-case nil + (car (image-size (car x))) + (error 0))) spec))) + (when (> len 0) + (goto-char (point-at-eol)) + (insert (propertize + " " 'display + (cons 'space (list :align-to (- (window-width) 1 len)))))) + (goto-char (point-at-eol)) + (setq point (point-at-eol)) + (dolist (image spec) + (unless (stringp image) + (goto-char point) + (gnus-picon-insert-glyph image 'newsgroups-picon))))) + (inline + (when (search-forward group nil t) + (delete-region (match-beginning 0) (match-end 0)) + (save-restriction + (narrow-to-region (point) (point)) + (while spec + (goto-char (point-min)) + (if (> (length spec) 1) + (insert ".")) + (gnus-picon-insert-glyph (pop spec) 'newsgroups-picon)) + (goto-char (point-max)))) + )))))) ;;; Commands: --=-=-=--