From: Lars Ingebrigtsen Date: Tue, 8 Dec 2020 13:17:36 +0000 (+0100) Subject: Simplify gnus-mode-line-buffer-identification X-Git-Tag: emacs-28.0.90~4854 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fbb9dd3e82163c24c0660322ca914612462e0050;p=emacs.git Simplify gnus-mode-line-buffer-identification * lisp/gnus/gnus.el (gnus-mode-line-image-cache): Remove. (gnus-mode-line-buffer-identification): Use the find-image cache. --- diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 2edda5f1fef..abe7b1ae76a 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -309,34 +309,29 @@ be set in `.emacs' instead." :group 'gnus-start :type 'boolean) -(defvar gnus-mode-line-image-cache t) - -(eval-and-compile - (if (fboundp 'find-image) - (defun gnus-mode-line-buffer-identification (line) - (let ((str (car-safe line)) - (load-path (append (mm-image-load-path) load-path))) - (if (and (display-graphic-p) - (stringp str) - (string-match "^Gnus:" str)) - (progn (add-text-properties - 0 5 - (list 'display - (if (eq t gnus-mode-line-image-cache) - (setq gnus-mode-line-image-cache - (find-image - '((:type xpm :file "gnus-pointer.xpm" - :ascent center) - (:type xbm :file "gnus-pointer.xbm" - :ascent center)))) - gnus-mode-line-image-cache) - 'help-echo (format - "This is %s, %s." - gnus-version (gnus-emacs-version))) - str) - (list str)) - line))) - (defalias 'gnus-mode-line-buffer-identification 'identity))) +(defun gnus-mode-line-buffer-identification (line) + (let ((str (car-safe line))) + (if (or (not (fboundp 'find-image)) + (not (display-graphic-p)) + (not (stringp str)) + (not (string-match "^Gnus:" str))) + line + (let ((load-path (append (mm-image-load-path) load-path))) + ;; Add the Gnus logo. + (add-text-properties + 0 5 + (list 'display + (find-image + '((:type xpm :file "gnus-pointer.xpm" + :ascent center) + (:type xbm :file "gnus-pointer.xbm" + :ascent center)) + t) + 'help-echo (format + "This is %s, %s." + gnus-version (gnus-emacs-version))) + str) + (list str))))) ;; We define these group faces here to avoid the display ;; update forced when creating new faces.