[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45879: 28.0.50; [PATCH] missing defvar for keymap-name-history
From: |
Drew Adams |
Subject: |
bug#45879: 28.0.50; [PATCH] missing defvar for keymap-name-history |
Date: |
Thu, 14 Jan 2021 18:31:49 -0800 (PST) |
> It seems that the new describe-keymaps function in help-fns.el is
> missing a defvar for keymap-name-history. This results in an error
> when using, e.g. Helm as the completing-read function.
>
> The attached patch adds the defvar to help-fns.el.
FWIW, I don't think it's required for the HIST arg
of `completing-read' (or `read-from-minibuffer') to
be predefined. It can be any symbol, which is taken
as a variable - no need for a defvar.
Now maybe it can be considered good style to provide
a defvar, especially to provide a doc string.
That's another story.
But it sounds (just a guess) like it's Helm that has
a bug here. Again though, it's good to provide a
defvar anyway.
E.g. in `emacs -Q':
(completing-read "aaa: " obarray nil nil nil 'toto)
No error occurs, and `toto' gets populated correctly
as a variable, starting with an initial value of nil,
and regardless of input.
(And the byte-compiler issues no warning either.)
I thought this "feature" was documented, but I don't
find it now in the Elisp manual or doc strings.
Perhaps it's there somewhere. (Not very important
anyway.)