From 41d39ffc3269db33f35541c94ebf109ffb50681e Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Fri, 23 Sep 2022 18:21:55 +0200 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 fcad601d0c3..d1098be6fd3 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1717,9 +1717,7 @@ already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated." (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 e659a648e10..315381a6dd8 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -829,9 +829,10 @@ claim them." (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 dde60caee7e..107ad8fd4a8 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -6207,8 +6207,7 @@ If WHERE is `summary', the summary mode line format will be used." ;; 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 0afd873a5df..3a7edf9e080 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -310,12 +310,15 @@ be set in `.emacs' instead." :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.39.2