unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: 57977@debbugs.gnu.org
Subject: bug#57977: 29.0.50; [PATCH] Make Gnus respect mode-line-buffer-identification-keymap
Date: Fri, 23 Sep 2022 17:13:45 +0530	[thread overview]
Message-ID: <875yhee2oe.fsf@gmail.com> (raw)
In-Reply-To: <87y1ucc2nh.fsf@gmail.com> (Visuwesh's message of "Wed, 21 Sep 2022 18:20:26 +0530")

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

[புதன் செப்டம்பர் 21, 2022] Visuwesh wrote:

> [புதன் செப்டம்பர் 21, 2022] Visuwesh wrote:
>
>> Please find attached, thanks.
>
> Oops, that patch had a very silly thinko...

This patch was also wrong.  Submitting a patch when I was tired and
about to sleep was an awful mistake, sorry about the noise.  Attached
patch should be final, hopefully.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-Gnus-respect-mode-line-buffer-identification-ke.patch --]
[-- Type: text/x-diff, Size: 3260 bytes --]

From 3a4b6f752473583a51687b976a6bf410a7b7bc77 Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
Date: Fri, 23 Sep 2022 17:10:49 +0530
Subject: [PATCH] Make Gnus respect mode-line-buffer-identification-keymap

* lisp/gnus/gnus-group.el (gnus-group-set-mode-line): Use
'propertized-buffer-identification' to buttonise and fontify the
buffer name.
* lisp/gnus/gnus-sum.el (gnus-set-mode-line):
* lisp/gnus/gnus.el (gnus-mode-line-buffer-identification): Adjust
calls to above.
* lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Add missing
'gnus-modeline-buffer-identification' call. (bug#57977)
---
 lisp/gnus/gnus-group.el | 4 +---
 lisp/gnus/gnus-srvr.el  | 7 ++++---
 lisp/gnus/gnus-sum.el   | 3 +--
 lisp/gnus/gnus.el       | 7 +++++--
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index fcad601d0c..d1098be6fd 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1717,9 +1717,7 @@ gnus-group-set-mode-line
 	  (setq mode-string (substring mode-string 0 (- max-len 4))))
 	(prog1
 	    (setq mode-line-buffer-identification
-		  (gnus-mode-line-buffer-identification
-		   (list (propertize mode-string
-				     'face 'mode-line-buffer-id))))
+		  (gnus-mode-line-buffer-identification (list mode-string)))
 	  (set-buffer-modified-p modified))))))
 
 (defun gnus-group-group-name ()
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index e659a648e1..315381a6dd 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -829,9 +829,10 @@ gnus-browse-foreign-server
 	  (erase-buffer))
 	(gnus-browse-mode)
 	(setq mode-line-buffer-identification
-	      (list
-	       (format
-		"Gnus: %%b {%s:%s}" (car method) (cadr method))))
+	      (gnus-mode-line-buffer-identification
+               (list
+	        (format
+		 "Gnus: %%b {%s:%s}" (car method) (cadr method)))))
 	(let ((buffer-read-only nil)
 	      name
 	      (prefix (let ((gnus-select-method orig-select-method))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index dde60caee7..107ad8fd4a 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -6207,8 +6207,7 @@ gnus-set-mode-line
       ;; Update the mode line.
       (setq mode-line-buffer-identification
 	    (gnus-mode-line-buffer-identification
-	     (list (propertize mode-string
-			       'face 'mode-line-buffer-id))))
+	     (list mode-string)))
       (set-buffer-modified-p t))))
 
 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads)
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 0afd873a5d..3a7edf9e08 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -310,12 +310,15 @@ gnus-inhibit-startup-message
   :type 'boolean)
 
 (defun gnus-mode-line-buffer-identification (line)
-  (let ((str (car-safe line)))
+  (let* ((str (car-safe line))
+         (str (if (stringp str)
+                  (car (propertized-buffer-identification str))
+                str)))
     (if (or (not (fboundp 'find-image))
 	    (not (display-graphic-p))
 	    (not (stringp str))
 	    (not (string-match "^Gnus:" str)))
-	line
+	(list str)
       (let ((load-path (append (mm-image-load-path) load-path)))
 	;; Add the Gnus logo.
 	(add-text-properties
-- 
2.35.1


  reply	other threads:[~2022-09-23 11:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21 12:41 bug#57977: 29.0.50; [PATCH] Make Gnus respect mode-line-buffer-identification-keymap Visuwesh
2022-09-21 12:43 ` Visuwesh
2022-09-21 12:50   ` Visuwesh
2022-09-23 11:43     ` Visuwesh [this message]
2022-09-23 16:22       ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=875yhee2oe.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=57977@debbugs.gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).