]> git.eshelyaron.com Git - emacs.git/commitdiff
Add option gnus-mode-line-logo
authorMekeor Melire <mekeor@posteo.de>
Wed, 7 Feb 2024 22:00:08 +0000 (23:00 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 10 Feb 2024 08:42:45 +0000 (09:42 +0100)
* lisp/gnus/gnus.el (gnus-mode-line-logo): New option specifying
whether and which logo will be displayed in the mode-line.
* etc/NEWS: Announce the change.

(cherry picked from commit 6568a9a0099e7745bfd142a0fd16b4d7215c0250)

etc/NEWS
lisp/gnus/gnus.el

index 4741b69b5641416fb6b70b8d71ff03d67400046f..27752faecaa28912406b37374a4b467988f2007e 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1205,6 +1205,11 @@ The gmane.org website is, sadly, down since a number of years with no
 prospect of it coming back.  Therefore, it is no longer valid to set
 the user option 'nnweb-type' to 'gmane'.
 
+*** New user option 'gnus-mode-line-logo'.
+This allows the user to either disable the display of any logo or
+specify which logo will be displayed as part of the
+buffer-identification in the mode-line of Gnus-buffers.
+
 ** Rmail
 
 ---
index 99833e4eecaab01d25e4f53d85712b9dd139dbdb..cf4c3f7841c08b4307d1101662fc34ce356f0c98 100644 (file)
@@ -309,12 +309,30 @@ be set in `.emacs' instead."
   :group 'gnus-start
   :type 'boolean)
 
+(defcustom gnus-mode-line-logo
+  '((:type svg :file "gnus-pointer.svg" :ascent center)
+     (:type xpm :file "gnus-pointer.xpm" :ascent center)
+     (:type xbm :file "gnus-pointer.xbm" :ascent center))
+  "Gnus logo displayed in mode-line.
+
+If non-nil, it should be a list of image specifications that will be
+given as first argument to `find-image', which see.  Then, in case of a
+graphical display, the specified Gnus logo will be displayed as part of
+the buffer-identification in the mode-line of Gnus-buffers.
+
+If nil, no logo will be displayed."
+  :group 'gnus-visual
+  :type '(choice
+           (repeat :tag "List of image specifications" (plist))
+           (const :tag "No logo" nil)))
+
 (defun gnus-mode-line-buffer-identification (line)
   (let* ((str (car-safe line))
          (str (if (stringp str)
                   (car (propertized-buffer-identification str))
                 str)))
-    (if (or (not (fboundp 'find-image))
+    (if (or (not gnus-mode-line-logo)
+            (not (fboundp 'find-image))
            (not (display-graphic-p))
            (not (stringp str))
            (not (string-match "^Gnus:" str)))
@@ -325,14 +343,7 @@ be set in `.emacs' instead."
        (add-text-properties
         0 5
         (list 'display
-              (find-image
-               '((:type svg :file "gnus-pointer.svg"
-                         :ascent center)
-                  (:type xpm :file "gnus-pointer.xpm"
-                        :ascent center)
-                 (:type xbm :file "gnus-pointer.xbm"
-                        :ascent center))
-               t)
+              (find-image gnus-mode-line-logo t)
               'help-echo (if gnus-emacs-version
                               (format
                               "This is %s, %s."