unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57977: 29.0.50; [PATCH] Make Gnus respect mode-line-buffer-identification-keymap
@ 2022-09-21 12:41 Visuwesh
  2022-09-21 12:43 ` Visuwesh
  0 siblings, 1 reply; 5+ messages in thread
From: Visuwesh @ 2022-09-21 12:41 UTC (permalink / raw)
  To: 57977


The buffer name in the mode-line has a keymap set which lets you use
button-1 and button-3 to change the buffer in that window.  However,
gnus-mode-line-buffer-identification does not put the keymap.  This
breaks the flow when you're quickly going through the buffers using the
mouse buttons.  I will attach a patch once I get the bug number.

In GNU Emacs 29.0.50 (build 18, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw scroll bars) of 2022-09-20 built on astatine
Repository revision: cd2168cd131852279a7d9257c7dff45224c9d6a9
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure --with-sound=alsa --with-x-toolkit=lucid --with-json
 --without-xaw3d --without-gconf --without-libsystemd'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM
XINPUT2 XPM LUCID ZLIB
Important settings:
  value of $LC_MONETARY: ta_IN.UTF-8
  value of $LC_NUMERIC: ta_IN.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Browse Server

Minor modes in effect:
  recentf-mode: t
  shell-dirtrack-mode: t
  eros-mode: t
  pdf-occur-global-minor-mode: t
  minibuffer-depth-indicate-mode: t
  repeat-mode: t
  display-time-mode: t
  display-battery-mode: t
  winner-mode: t
  acme-tag-minor-mode: t
  delete-selection-mode: t
  xterm-mouse-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  use-hard-newlines: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  undelete-frame-mode: t
  buffer-read-only: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#57977: 29.0.50; [PATCH] Make Gnus respect mode-line-buffer-identification-keymap
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Visuwesh @ 2022-09-21 12:43 UTC (permalink / raw)
  To: 57977

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

Please find attached, thanks.


[-- 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: 2966 bytes --]

From 8f7938fb2cf08655144fedcc12e96ef2446022c7 Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
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..3b1a336c83 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -331,7 +331,7 @@ gnus-mode-line-buffer-identification
 			   "This is %s, %s."
 			   gnus-version (gnus-emacs-version)))
 	 str)
-	(list str)))))
+	(list (propertized-buffer-identification str))))))
 
 ;; We define these group faces here to avoid the display
 ;; update forced when creating new faces.
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#57977: 29.0.50; [PATCH] Make Gnus respect mode-line-buffer-identification-keymap
  2022-09-21 12:43 ` Visuwesh
@ 2022-09-21 12:50   ` Visuwesh
  2022-09-23 11:43     ` Visuwesh
  0 siblings, 1 reply; 5+ messages in thread
From: Visuwesh @ 2022-09-21 12:50 UTC (permalink / raw)
  To: 57977

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

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

> Please find attached, thanks.

Oops, that patch had a very silly thinko...

[-- 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: 2987 bytes --]

From d2f6518329298a3e8c2a5f19358e915b94173828 Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#57977: 29.0.50; [PATCH] Make Gnus respect mode-line-buffer-identification-keymap
  2022-09-21 12:50   ` Visuwesh
@ 2022-09-23 11:43     ` Visuwesh
  2022-09-23 16:22       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Visuwesh @ 2022-09-23 11:43 UTC (permalink / raw)
  To: 57977

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#57977: 29.0.50; [PATCH] Make Gnus respect mode-line-buffer-identification-keymap
  2022-09-23 11:43     ` Visuwesh
@ 2022-09-23 16:22       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-23 16:22 UTC (permalink / raw)
  To: Visuwesh; +Cc: 57977

Visuwesh <visuweshm@gmail.com> writes:

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

Thanks; pushed to Emacs 29.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-23 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-09-23 16:22       ` Lars Ingebrigtsen

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