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).
This commit is contained in:
Visuwesh 2022-09-23 18:21:55 +02:00 committed by Lars Ingebrigtsen
parent cf27fe0238
commit 41d39ffc32
4 changed files with 11 additions and 10 deletions

View file

@ -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 ()

View file

@ -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))

View file

@ -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)

View file

@ -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