Subject: icomplete-mode's docstring causes documentation function to fail

From: Brady Montz <[email-masked]>
Date: Tue, 13 Sep 2022 06:17:32 -0700

Hi, I noticed that when I have icomplete-mode enabled, the describe-mode function doesn't work in any buffer. It throws this error:

describe-map-tree: Wrong number of arguments: (lambda (map) "Display binding for MAP which must be a quoted keymap variable" (interactive (list (intern (completing-read "Key map: " obarray 'keymap-test 1)))) (let ((val (symbol-value map))) (or (keymapp val) (error "%s is not a keymap !" (symbol-name map))) (let* ((old-dir default-directory) (buf (save-current-buffer (set-buffer (get-buffer-create "*Help*")) (prog1 (current-buffer) (kill-all-local-variables) (setq default-directory old-dir) (setq buffer-read-only nil) (setq buffer-file-name nil) (setq buffer-undo-list t) (let ((inhibit-read-only t) (inhibit-modification-hooks t)) (erase-buffer) (run-hooks 'temp-buffer-setup-hook))))) (standard-output buf)) (prog1 (progn (princ (format "Binding for keymap %s is:
" (symbol-name map))) (princ (substitute-command-keys "\\{val}")) (print-help-return-message)) (internal-temp-output-buffer-show buf))))), 7

I did some debugging and traced it down to the icomplete-mode docstring. 

Repro:

in scratch buffer, run: (documentation 'icomplete-mode) and I get the same error. 

If I remove the last line of icomplete-mode's docstring ("\\{icomplete-minibuffer-map}"), then the documentation function successfully returns the doc string.

Finally, icomplete-minibuffer-map has the value (keymap (67108908 . icomplete-backward-completions) (67108910 . icomplete-forward-completions) (10 . icomplete-force-complete-and-exit) (remap keymap (minibuffer-complete-and-exit . icomplete-ret)) (27 keymap (9 . icomplete-force-complete))) after I’ve loaded it up. 

Unfortunately, describe-mode still doesn't work, so something else has a similar problem that I haven’t found yet, but likely this helps. 

Using emacs version "GNU Emacs 28.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95))
 of 2022-05-11" built by homebrew, with the icomplete-mode that's included in that version. 

—
  Brady Montz
  [email-masked]