Subject: Re: 29.0.50; [PATCH] Make Gnus respect mode-line-buffer-identification-keymap

From: Visuwesh <[email-masked]>
Date: Wed, 21 Sep 2022 18:20:26 +0530

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

> Please find attached, thanks.

Oops, that patch had a very silly thinko...
>From d2f6518329298a3e8c2a5f19358e915b94173828 Mon Sep 17 00:00:00 2001
From: Visuwesh <[email-masked]>
Date: Wed, 21 Sep 2022 18:11:55 +0530
Subject: [PATCH] Make Gnus respect mode-line-buffer-identification-keymap

* lisp/gnus/gnus.el (gnus-mode-line-buffer-identification): Use
`propertized-buffer-identification' to set the keymap and to fontify
the buffer name.
* lisp/gnus/gnus-group.el (gnus-group-set-mode-line):
* lisp/gnus/gnus-sum.el (gnus-set-mode-line): Adjust calls to above.
* lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Fix missing
`gnus-mode-line-buffer-identification' call.
---
 lisp/gnus/gnus-group.el | 4 +---
 lisp/gnus/gnus-srvr.el  | 7 ++++---
 lisp/gnus/gnus-sum.el   | 3 +--
 lisp/gnus/gnus.el       | 2 +-
 4 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index fcad601d0c..7765bf296b 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 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..cda5bf2994 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -310,7 +310,7 @@ gnus-inhibit-startup-message
   :type 'boolean)
 
 (defun gnus-mode-line-buffer-identification (line)
-  (let ((str (car-safe line)))
+  (let ((str (car (propertized-buffer-identification (car-safe line)))))
     (if (or (not (fboundp 'find-image))
 	    (not (display-graphic-p))
 	    (not (stringp str))
-- 
2.35.1