unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: James N. V. Cash <james.nvc@gmail.com>
To: Drew Adams <drew.adams@oracle.com>, 45879@debbugs.gnu.org
Subject: bug#45879: 28.0.50; [PATCH] missing defvar for keymap-name-history
Date: Fri, 15 Jan 2021 10:08:56 -0500	[thread overview]
Message-ID: <87lfcu6xvb.fsf@gmail.com> (raw)
In-Reply-To: <82d9d68b-dac2-4cd8-84fe-2b7c81036e20@default>

Drew Adams <drew.adams@oracle.com> writes:

> 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.

Ah, okay -- reading the help for `completing-read', it says that HIST
"can be a symbol, which is the history list variable to use", which I
took to mean that it should refer to a variable.

> 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.)

Indeed, I noticed this as well, but I wasn't sure if that was intended,
or just a coincidence of implementation that it happened to work.

> 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.

Hah, funnily enough, Helm also says that this an Emacs bug:
https://github.com/emacs-helm/helm/issues/2327#issuecomment-647912917

😆 Not entirely sure how to resolve this then, other than just defining
the variable myself in my own config.

> 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.)

If this is indeed intended behaviour, I can submit a patch to clarify
the docstring for completing-read.





  reply	other threads:[~2021-01-15 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15  0:32 bug#45879: 28.0.50; [PATCH] missing defvar for keymap-name-history James N. V. Cash
2021-01-15  2:31 ` Drew Adams
2021-01-15 15:08   ` James N. V. Cash [this message]
2021-01-19  6:09 ` Lars Ingebrigtsen
2021-01-19 15:11   ` James N. V. Cash
2021-01-19 15:23     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfcu6xvb.fsf@gmail.com \
    --to=james.nvc@gmail.com \
    --cc=45879@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).