--- gnus/lisp/ChangeLog-0.34 Sun Mar 1 15:13:49 1998 +++ gnus/lisp/ChangeLog Sun Mar 1 15:34:11 1998 @@ -1,3 +1,23 @@ +1998-03-01 Kim-Minh Kaplan + + * gnus-win.el (gnus-window-to-buffer): change "*Picons*" to + `gnus-picons-buffer'. + (gnus-window-to-buffer-helper): Support dynamic picon buffer + name (i.e a symbol that names a function to be called). + (gnus-configure-frame): Use it. + (gnus-delete-windows-in-gnusey-frames): Use it. + (gnus-all-windows-visible-p): Use it. + (gnus-remove-some-windows): Use it. + + * gnus-picon.el (gnus-get-buffer-name): Use it. + (gnus-picons-kill-buffer): New function. + (gnus-picons-setup-buffer): New function. + (gnus-picons-set-buffer): Use them. + (gnus-picons-display-x-face): Put back the `buf' binding: it is + needed when `gnus-picons-display-where' is not set to article. + Also move the X-Face to the left, near the address. It seems more + logical. + Sat Feb 28 08:27:20 1998 Lars Magne Ingebrigtsen * gnus.el: Quassia Gnus v0.34 is released. --- gnus/lisp/gnus-picon.el-0.34 Sun Mar 1 13:17:31 1998 +++ gnus/lisp/gnus-picon.el Sun Mar 1 15:27:48 1998 @@ -184,17 +184,38 @@ (defun gnus-get-buffer-name (variable) "Returns the buffer name associated with the contents of a variable." - (cond ((symbolp variable) (let ((newvar (cdr (assq variable - gnus-window-to-buffer)))) - (cond ((symbolp newvar) - (symbol-value newvar)) - ((stringp newvar) newvar)))) - ((stringp variable) variable))) + (buffer-name (get-buffer (gnus-window-to-buffer-helper variable)))) + +(defun gnus-picons-buffer-name () + (cond ((or (stringp gnus-picons-display-where) + (bufferp gnus-picons-display-where)) + gnus-picons-display-where) + ((eq gnus-picons-display-where 'picons) + (if gnus-single-article-buffer + "*Picons*" + (concat "*Picons " gnus-newsgroup-name "*"))) + (t + (gnus-get-buffer-name gnus-picons-display-where)))) + +(defun gnus-picons-kill-buffer () + (let ((buf (get-buffer (gnus-picons-buffer-name)))) + (if (buffer-live-p buf) + (kill-buffer buf)))) + +(defun gnus-picons-setup-buffer () + (let ((name (gnus-picons-buffer-name))) + (save-excursion + (if (get-buffer name) + (set-buffer name) + (set-buffer (get-buffer-create name)) + (buffer-disable-undo) + (setq buffer-read-only t) + (gnus-add-current-to-buffer-list) + (add-hook 'gnus-summary-prepare-exit-hook 'gnus-picons-kill-buffer)) + (current-buffer)))) (defun gnus-picons-set-buffer () - (set-buffer - (get-buffer-create (gnus-get-buffer-name gnus-picons-display-where))) - (gnus-add-current-to-buffer-list) + (set-buffer (gnus-picons-setup-buffer)) (goto-char (point-min)) (if (and (eq gnus-picons-display-where 'article) gnus-picons-display-article-move-p) @@ -242,11 +263,16 @@ (if (featurep 'xface) ;; Use builtin support (save-excursion - (gnus-picons-set-buffer) - (gnus-picons-make-annotation - (vector 'xface - :data (concat "X-Face: " (buffer-substring beg end))) - nil 'text)) + ;; Don't remove this binding, it is really needed: when + ;; `gnus-picons-set-buffer' changes buffer (like when it is + ;; set to display picons outside of the article buffer), BEG + ;; and END still refer the buffer current now ! + (let ((buf (current-buffer))) + (gnus-picons-set-buffer) + (gnus-picons-make-annotation + (vector 'xface + :data (concat "X-Face: " (buffer-substring beg end buf))) + nil 'text nil nil nil t))) ;; convert the x-face header to a .xbm file (let* ((process-connection-type nil) (process (start-process-shell-command "gnus-x-face" nil --- gnus/lisp/gnus-win.el-0.34 Sun Mar 1 13:16:24 1998 +++ gnus/lisp/gnus-win.el Sun Mar 1 15:20:34 1998 @@ -182,7 +182,7 @@ (mail . gnus-message-buffer) (post-news . gnus-message-buffer) (faq . gnus-faq-buffer) - (picons . "*Picons*") + (picons . gnus-picons-buffer-name) (tree . gnus-tree-buffer) (score-trace . "*Score Trace*") (info . gnus-info-buffer) @@ -267,6 +267,13 @@ (defvar gnus-frame-list nil) +(defun gnus-window-to-buffer-helper (obj) + (if (symbolp obj) + (if (boundp obj) + (symbol-value obj) + (funcall obj)) + obj)) + (defun gnus-configure-frame (split &optional window) "Split WINDOW according to SPLIT." (unless window @@ -300,15 +307,11 @@ ;; This is a buffer to be selected. ((not (memq type '(frame horizontal vertical))) (let ((buffer (cond ((stringp type) type) - (t (cdr (assq type gnus-window-to-buffer))))) - buf) + (t (cdr (assq type gnus-window-to-buffer)))))) (unless buffer (error "Illegal buffer type: %s" type)) - (unless (setq buf (get-buffer (if (symbolp buffer) - (symbol-value buffer) buffer))) - (setq buf (get-buffer-create (if (symbolp buffer) - (symbol-value buffer) buffer)))) - (switch-to-buffer buf) + (switch-to-buffer (get-buffer-create + (gnus-window-to-buffer-helper buffer))) ;; We return the window if it has the `point' spec. (and (memq 'point split) window))) ;; This is a frame split. @@ -439,12 +442,7 @@ (let ((buffers (mapcar (lambda (elem) - (if (symbolp (cdr elem)) - (when (and (boundp (cdr elem)) - (symbol-value (cdr elem))) - (get-buffer (symbol-value (cdr elem)))) - (when (cdr elem) - (get-buffer (cdr elem))))) + (get-buffer (gnus-window-to-buffer-helper (cdr elem)))) gnus-window-to-buffer))) (mapcar (lambda (frame) @@ -493,12 +491,9 @@ (t (cdr (assq type gnus-window-to-buffer))))) (unless buffer (error "Illegal buffer type: %s" type)) - (when (setq buf (get-buffer (if (symbolp buffer) - (symbol-value buffer) - buffer))) - (setq win (get-buffer-window buf t))) - (if win - (when (memq 'point split) + (if (and (setq buf (get-buffer (gnus-window-to-buffer-helper buffer))) + (setq win (get-buffer-window buf t))) + (if (memq 'point split) (setq all-visible win)) (setq all-visible nil))) (t @@ -517,10 +512,7 @@ (save-excursion ;; Remove windows on all known Gnus buffers. (while buffers - (setq buf (cdar buffers)) - (when (symbolp buf) - (setq buf (and (boundp buf) (symbol-value buf)))) - (and buf + (and (setq buf (gnus-window-to-buffer-helper (cdar buffers))) (get-buffer-window buf) (progn (push buf bufs) --- gnus/texi/ChangeLog-0.34 Sun Mar 1 15:34:48 1998 +++ gnus/texi/ChangeLog Sun Mar 1 15:37:02 1998 @@ -1,3 +1,9 @@ +1998-03-01 Kim-Minh Kaplan + + * gnus.texi (Easy Picons): Removed references to + `gnus-group-display-picons'. + (Hard Picons): Ditto. + Mon Feb 23 18:05:09 1998 Lars Magne Ingebrigtsen * gnus.texi: Direntry not handled by Emacs 19.34. --- gnus/texi/gnus.texi-0.34 Sat Feb 28 14:25:29 1998 +++ gnus/texi/gnus.texi Sun Mar 1 13:53:36 1998 @@ -14554,7 +14554,6 @@ @lisp (setq gnus-use-picons t) (add-hook 'gnus-article-display-hook 'gnus-article-display-picons t) -(add-hook 'gnus-summary-prepare-hook 'gnus-group-display-picons t) (add-hook 'gnus-article-display-hook 'gnus-picons-article-display-x-face) @end lisp @@ -14633,13 +14632,6 @@ Looks up and displays the picons for the author and the author's domain in the @code{gnus-picons-display-where} buffer. Should be added to the @code{gnus-article-display-hook}. - -@item gnus-group-display-picons -@findex gnus-article-display-picons -Displays picons representing the current group. This function should -be added to the @code{gnus-summary-prepare-hook} or to the -@code{gnus-article-display-hook} if @code{gnus-picons-display-where} -is set to @code{article}. @item gnus-picons-article-display-x-face @findex gnus-article-display-picons