all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mekeor Melire <mekeor@posteo.de>
To: 68985@debbugs.gnu.org
Cc: Eric Abrahamsen <eric@ericabrahamsen.net>,
	Eli Zaretskii <eliz@gnu.org>,
	Manuel Giraud <manuel@ledu-giraud.fr>
Subject: bug#68985: [PATCH v2] Add option gnus-mode-line-logo
Date: Fri, 09 Feb 2024 21:53:48 +0000	[thread overview]
Message-ID: <87plx52t8r.fsf@posteo.de> (raw)
In-Reply-To: <877cjd73x0.fsf@ledu-giraud.fr>

[-- Attachment #1: Type: text/plain, Size: 351 bytes --]

2024-02-09 21:56 manuel@ledu-giraud.fr:

> Mekeor would you like to give a try at this?

Thank y'all for the constructive conversation and the nice resulting
idea. Find attached a patch that aims to implement it. Personally, I'm
not sure about the "sexp" custom-type that I used. Also, I wonder if
"gnus-visual" is the right custom-group to be used.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-option-gnus-mode-line-logo.patch --]
[-- Type: text/x-patch, Size: 2921 bytes --]

From 1b30caf62da45a71a5c546665553710d5da4ce3c Mon Sep 17 00:00:00 2001
From: Mekeor Melire <mekeor@posteo.de>
Date: Wed, 7 Feb 2024 23:00:08 +0100
Subject: [PATCH] Add option gnus-mode-line-logo

* 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.
---
 etc/NEWS          |  5 +++++
 lisp/gnus/gnus.el | 29 ++++++++++++++++++++---------
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index ee7462cb2aa..36844bfa1a2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1098,6 +1098,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
 
 ---
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 99833e4eeca..03e21b21b39 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -309,12 +309,30 @@ gnus-inhibit-startup-message
   :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
+           (sexp :tag "List of image specifications")
+           (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 @@ gnus-mode-line-buffer-identification
 	(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."
-- 
2.41.0


  reply	other threads:[~2024-02-09 21:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 22:02 bug#68985: 30.0.50; Gnus: Add option to disable display of logo image in mode-line Mekeor Melire
2024-02-08  1:39 ` Visuwesh
2024-02-08 10:53   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-08  6:11 ` Eli Zaretskii
2024-02-08 19:49   ` Mekeor Melire
2024-02-08 22:29     ` Eric Abrahamsen
2024-02-09 10:30       ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-09 18:07         ` Eric Abrahamsen
2024-02-09 20:56           ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-09 21:53             ` Mekeor Melire [this message]
2024-02-09 23:18               ` bug#68985: [PATCH v2] Add option gnus-mode-line-logo Eric Abrahamsen
2024-02-10  2:03                 ` bug#68985: [PATCH v3] " Mekeor Melire
2024-02-10  4:20                   ` Eric Abrahamsen
2024-02-10  9:07                     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10  7:31               ` bug#68985: [PATCH v2] " Eli Zaretskii
2024-02-10 16:43                 ` Eric Abrahamsen
2024-02-10 22:01                   ` Mekeor Melire
2024-02-11  3:26       ` bug#68985: 30.0.50; Gnus: Add option to disable display of logo image in mode-line Richard Stallman
2024-02-11 15:14         ` Eric Abrahamsen
2024-02-13 21:36           ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87plx52t8r.fsf@posteo.de \
    --to=mekeor@posteo.de \
    --cc=68985@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=eric@ericabrahamsen.net \
    --cc=manuel@ledu-giraud.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.