Subject: Re: bug#18257: C-h b mentions "C-c C-f" as a valid binding in gnus-article-mode.

From: Katsumi Yamaoka <[email-masked]>
Date: Thu, 26 Jan 2017 17:10:51 +0900

On Wed, 25 Jan 2017 22:55:15 +0100, Lars Ingebrigtsen wrote:
> Just binding "C-c" in the article buffer (like other prefixed) led to
> problems in other parts of Emacs somehow, so I've reverted that patch
> and will have to implement it a different way.

Sorry, that is my fault.  How about this patch?

* lisp/gnus/gnus-art.el (gnus-article-describe-bindings):
Ignore summary commands that aren't bound to
gnus-article-read-summary-keys.

--- gnus-art.el~	2017-01-25 22:07:29.825734200 +0000
+++ gnus-art.el	2017-01-26 08:10:00.743177500 +0000
@@ -6846,16 +6846,20 @@
   (let ((keymap (copy-keymap gnus-article-mode-map))
 	(map (copy-keymap gnus-article-send-map))
 	(sumkeys (where-is-internal 'gnus-article-read-summary-keys))
+	(summap (make-sparse-keymap))
 	parent agent draft)
     (define-key keymap "S" map)
     (define-key map [t] nil)
+    (define-key summap [t] 'undefined)
     (with-current-buffer gnus-article-current-summary
+      (dolist (key sumkeys)
+	(define-key summap key (key-binding key (current-local-map))))
       (set-keymap-parent
        keymap
        (if (setq parent (keymap-parent gnus-article-mode-map))
 	   (prog1
 	       (setq parent (copy-keymap parent))
-	     (set-keymap-parent parent (current-local-map)))
+	     (set-keymap-parent parent summap))
 	 (current-local-map)))
       (set-keymap-parent map (key-binding "S"))
       (let (key def gnus-pick-mode)