? 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: