From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mekeor Melire Newsgroups: gmane.emacs.bugs Subject: bug#68985: [PATCH v3] Add option gnus-mode-line-logo Date: Sat, 10 Feb 2024 02:03:06 +0000 Message-ID: <87h6ih2hnt.fsf@posteo.de> References: <877cjg3p5k.fsf@posteo.de> <86eddnxz7e.fsf@gnu.org> <87y1bu3f1j.fsf@posteo.de> <87r0hmmvy5.fsf@ericabrahamsen.net> <87fry253r3.fsf@ledu-giraud.fr> <87il2xmrzt.fsf@ericabrahamsen.net> <877cjd73x0.fsf@ledu-giraud.fr> <87plx52t8r.fsf@posteo.de> <87r0hlkz0x.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34617"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 68985@debbugs.gnu.org, Manuel Giraud To: Eric Abrahamsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 10 03:12:02 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rYcqX-0008mM-Fp for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Feb 2024 03:12:01 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYcqL-0001U6-Oz; Fri, 09 Feb 2024 21:11:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYcqK-0001Ty-AN for bug-gnu-emacs@gnu.org; Fri, 09 Feb 2024 21:11:48 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYcqJ-0006bI-Kq for bug-gnu-emacs@gnu.org; Fri, 09 Feb 2024 21:11:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYcqY-0003mE-DE for bug-gnu-emacs@gnu.org; Fri, 09 Feb 2024 21:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mekeor Melire Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Feb 2024 02:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68985 X-GNU-PR-Package: emacs Original-Received: via spool by 68985-submit@debbugs.gnu.org id=B68985.170753106314336 (code B ref 68985); Sat, 10 Feb 2024 02:12:02 +0000 Original-Received: (at 68985) by debbugs.gnu.org; 10 Feb 2024 02:11:03 +0000 Original-Received: from localhost ([127.0.0.1]:59287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYcpX-0003in-Uk for submit@debbugs.gnu.org; Fri, 09 Feb 2024 21:11:03 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:33447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYcpV-0003iJ-MN for 68985@debbugs.gnu.org; Fri, 09 Feb 2024 21:10:58 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 64B17240028 for <68985@debbugs.gnu.org>; Sat, 10 Feb 2024 03:10:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1707531036; bh=cVX2yBiGXLHgKumkxFfFMGCDB+bSACSvG6dJDoNE/Xg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=k4120hKcEwfQwW1b4r+ORdzgXAXWky/iBO4BgXGd/k+xk+eywsAezHP/1JmSq45Vq pgjJSuORw97RWxTXovbCjardJtt20Bw7nztHex0wNC6njCXS+4LJFiKs7IYYReoQSL RBcXlLDP2tLqkojDtShkUy+fuqXfvms53+UM+lHK96LfTvRWK5twiurtTuIr5O1U0y Wco29VvcYQS+E+nIsSgHq7WWX92MBpG9CrepFvZ6QV5LHTWaqoq6Z4AfYIXiyjiYPQ P3j6ey8ijrVGFMUc996VZz9eLYrpYSdGTBdBO+hU+WYaR6r+nx8hvQlrcIAfxUNake PsqtEdnjmAjsw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TWvMH0T4Mz9rxG; Sat, 10 Feb 2024 03:10:35 +0100 (CET) In-reply-to: <87r0hlkz0x.fsf@ericabrahamsen.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279718 Archived-At: --=-=-= Content-Type: text/plain 2024-02-09 15:18 eric@ericabrahamsen.net: > Looks good! You've tested this, I assume? Yes. - Tested the customize interface. - Setting to nil works as documented. - Setting to another image spec works as documented. - As documented, in non-graphical displays (emacs -nw), no logo is displayed, just like before. - There are no byte-compilation warnings. - There are no new checkdoc warnings. > I think 'gnus-visual is the right group. Great! > Custom types are always a little frustrating, but this might work > better: > > '(choice > (repeat :tag "Image specs" (plist)) > (const :tag "No logo" nil)) This is great, too. Find attached another version of the patch which uses this custom-type, repeat-(plist). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-option-gnus-mode-line-logo.patch >From c1d850f6ca4936a086399c2ed5d2eacb94c7d581 Mon Sep 17 00:00:00 2001 From: Mekeor Melire 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..cf4c3f7841c 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 + (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 @@ 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 --=-=-=--