all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#51173: 28.0.60; gnus-article-describe-key doesn't work
@ 2021-10-13  1:05 Katsumi Yamaoka
  2021-10-13 11:59 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 22+ messages in thread
From: Katsumi Yamaoka @ 2021-10-13  1:05 UTC (permalink / raw)
  To: 51173

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

Hi,

The following example program returns `sh-case' on Emacs 27 and
olders, however to make it work on Emacs 28 and 29 the third
line has to be uncommented.  So does `describe-key' case.

(with-temp-buffer
  (sh-mode)
  ;;(set-window-buffer nil (current-buffer))
  (describe-key-briefly "\C-c\C-c"))

I don't know when/why those commands were changed to require the
buffer (where the keymap is) to be visited in the selected window,
but now `gnus-article-describe-key\(-briefly\)?' doesn't work
because of this.  A patch to gnus-art.el is attached, though the
one that should be fixed might be help.el.

Thanks.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2826 bytes --]

--- gnus-art.el~	2021-10-06 01:11:50.777999500 +0000
+++ gnus-art.el	2021-10-13 01:04:18.073219200 +0000
@@ -6854,19 +6854,24 @@
 		       (read-key-sequence "Describe key: ")))
 	       gnus-article-mode)
   (gnus-article-check-buffer)
-  (if (memq (key-binding key t) '(gnus-article-read-summary-keys
-				  gnus-article-read-summary-send-keys))
-      (with-current-buffer gnus-article-current-summary
-	(setq unread-command-events
-	      (nconc
-	       (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
-				       (list 'meta (- x 128))
-				     x))
-		       key)
-	       unread-command-events))
-	(let ((cursor-in-echo-area t)
-	      gnus-pick-mode)
-	  (describe-key (read-key-sequence nil t))))
+  (if (and (memq (key-binding key t) '(gnus-article-read-summary-keys
+				       gnus-article-read-summary-send-keys))
+	   (buffer-live-p gnus-article-current-summary))
+      (let ((artbuf (current-buffer)))
+	(unwind-protect
+	    (progn
+	      (set-window-buffer nil gnus-article-current-summary)
+	      (setq unread-command-events
+		    (nconc
+		     (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
+					     (list 'meta (- x 128))
+					   x))
+			     key)
+		     unread-command-events))
+	      (let ((cursor-in-echo-area t)
+		    gnus-pick-mode)
+		(describe-key (read-key-sequence nil t))))
+	  (set-window-buffer nil artbuf)))
     (describe-key key)))
 
 (defun gnus-article-describe-key-briefly (key &optional insert)
@@ -6877,19 +6882,24 @@
 		     current-prefix-arg)
 	       gnus-article-mode)
   (gnus-article-check-buffer)
-  (if (memq (key-binding key t) '(gnus-article-read-summary-keys
-				  gnus-article-read-summary-send-keys))
-      (with-current-buffer gnus-article-current-summary
-	(setq unread-command-events
-	      (nconc
-	       (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
-				       (list 'meta (- x 128))
-				     x))
-		       key)
-	       unread-command-events))
-	(let ((cursor-in-echo-area t)
-	      gnus-pick-mode)
-	  (describe-key-briefly (read-key-sequence nil t) insert)))
+  (if (and (memq (key-binding key t) '(gnus-article-read-summary-keys
+				       gnus-article-read-summary-send-keys))
+	   (buffer-live-p gnus-article-current-summary))
+      (let ((artbuf (current-buffer)))
+	(unwind-protect
+	    (progn
+	      (set-window-buffer nil gnus-article-current-summary)
+	      (setq unread-command-events
+		    (nconc
+		     (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
+					     (list 'meta (- x 128))
+					   x))
+			     key)
+		     unread-command-events))
+	      (let ((cursor-in-echo-area t)
+		    gnus-pick-mode)
+		(describe-key-briefly (read-key-sequence nil t) insert)))
+	  (set-window-buffer nil artbuf)))
     (describe-key-briefly key insert)))
 
 ;;`gnus-agent-mode' in gnus-agent.el will define it.

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

end of thread, other threads:[~2021-12-01 17:36 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-13  1:05 bug#51173: 28.0.60; gnus-article-describe-key doesn't work Katsumi Yamaoka
2021-10-13 11:59 ` Lars Ingebrigtsen
2021-10-13 16:33   ` Juri Linkov
2021-10-13 17:24     ` Juri Linkov
2021-10-13 18:49       ` Lars Ingebrigtsen
2021-10-13 19:18         ` Juri Linkov
2021-10-13 20:01       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-14 16:16         ` Juri Linkov
2021-10-14 18:41           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-15  6:49         ` Juri Linkov
2021-10-15 18:32           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-16 17:55             ` Juri Linkov
2021-10-16 19:53               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-18 16:20                 ` Juri Linkov
2021-10-20 17:55                   ` Juri Linkov
2021-10-21 16:43                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-29 18:49                       ` Juri Linkov
2021-11-29 20:57                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-30  3:26                           ` Eli Zaretskii
2021-11-30 13:06                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-30  8:54                           ` Juri Linkov
2021-12-01 17:36                             ` Juri Linkov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.