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 v2] Add option gnus-mode-line-logo Date: Fri, 09 Feb 2024 21:53:48 +0000 Message-ID: <87plx52t8r.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> 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="17363"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eric Abrahamsen , Eli Zaretskii , Manuel Giraud To: 68985@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 09 23:02:11 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 1rYYwk-0004H7-Bn for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Feb 2024 23:02:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYYwT-0000QP-7P; Fri, 09 Feb 2024 17:01:53 -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 1rYYwO-0000KU-9i for bug-gnu-emacs@gnu.org; Fri, 09 Feb 2024 17:01: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 1rYYwN-0006Uy-Rs for bug-gnu-emacs@gnu.org; Fri, 09 Feb 2024 17:01:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYYwb-00006q-Ol for bug-gnu-emacs@gnu.org; Fri, 09 Feb 2024 17:02:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mekeor Melire Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Feb 2024 22:02:01 +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.170751606532752 (code B ref 68985); Fri, 09 Feb 2024 22:02:01 +0000 Original-Received: (at 68985) by debbugs.gnu.org; 9 Feb 2024 22:01:05 +0000 Original-Received: from localhost ([127.0.0.1]:41413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYYvg-0008W8-58 for submit@debbugs.gnu.org; Fri, 09 Feb 2024 17:01:05 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:56439) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYYvQ-0008V2-0K for 68985@debbugs.gnu.org; Fri, 09 Feb 2024 17:01:02 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7A769240104 for <68985@debbugs.gnu.org>; Fri, 9 Feb 2024 23:00:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1707516026; bh=Dl6SQJG465eRqe1GRok4sPiaFX3RnJC1oK0JsKAVyS0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=nJmLloImDSAmFLuphRffrYPhgd6Q3n419ncM0+bpOySFZm/Q71uMeBPx+XYLQQPFd xpuxq2p21yeUVHa9y2diXKZRMNlMcX+9XLDXoS1V0QqJdyr8GADeEHdyhB+x/elkfA 7ETmYmGvS0QXIKgFTKHTGAEGa0xdx2LCbgm++wECnLZPdvJc5Z8+3OlDhwwu/VUMYb 2b+3XChK6ZS4uGUYTqJ1qQIBadsUjhwM5qaxHqNIJ41XocJvDtVuCtkLvrvoRiXTy3 XW1WLf57wJoX8hQV+sO6XL9TnGIo+qRH4y6W9EMK43e2h+YAbTw4UFow1FeUcbi621 ta5tRsSrw5UfA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TWnpc74y2z6tmv; Fri, 9 Feb 2024 23:00:24 +0100 (CET) In-reply-to: <877cjd73x0.fsf@ledu-giraud.fr> 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:279711 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-option-gnus-mode-line-logo.patch >From 1b30caf62da45a71a5c546665553710d5da4ce3c 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..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 --=-=-=--