Subject: Re: bug#32212: 26; `subword-mode' doc string shows empty key-binding list

From: Stephen Berman <[email-masked]>
Date: Fri, 20 Jul 2018 10:38:17 +0200

On Fri, 20 Jul 2018 10:01:04 +0300 Eli Zaretskii <[email-masked]> wrote:

>> From: Noam Postavsky <[email-masked]>
>> Date: Thu, 19 Jul 2018 20:58:52 -0400
>> Cc: [email-masked]
>> 
>> > emacs -Q
>> >
>> > C-h f subword-mode
>> >
>> > You see this at the end of buffer *Help*:
>> >
>> > key             binding
>> > ---             -------
>> >
>> >
>> > It's not just about this appearing before the library is loaded.
>> > Loading the library does not populate the list of keys and their
>> > bindings.  You always get such a heading, with no keys shown.
>> 
>> 
>> Seems to be a regression in 25.1, in 24.5 I see
>> 
>> key             binding
>> ---             -------
>> 
>> <remap>        Prefix Command
>> 
>> <remap> <backward-kill-word>    subword-backward-kill
>
> ISTR that the implementation changed radically, so perhaps this is the
> (unintended) consequence.

Maybe due to this change:

commit 6ddc44225e743e2b2a0d5c192f50aefd7a4a915b
Author: Daniel Colascione <[email-masked]>
Date:   Sun Mar 23 00:36:26 2014 -0700

    Merge capitalized-words-mode and subword-mode

diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -104,12 +82,6 @@
 (defvar subword-mode-map
-  (let ((map (make-sparse-keymap)))
-    (dolist (cmd '(forward-word backward-word mark-word kill-word
-				backward-kill-word transpose-words
-                                capitalize-word upcase-word downcase-word
-                                left-word right-word))
-      (let ((othercmd (let ((name (symbol-name cmd)))
-                        (string-match "\\([[:alpha:]-]+\\)-word[s]?" name)
-                        (intern (concat "subword-" (match-string 1 name))))))
-        (define-key map (vector 'remap cmd) othercmd)))
-    map)
+  ;; We originally remapped motion keys here, but now use Emacs core
+  ;; hooks.  Leave this keymap around so that user additions to it
+  ;; keep working.
+  (make-sparse-keymap)
   "Keymap used in `subword-mode' minor mode.")

Steve Berman