unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Trying to get rid of completion-string in completion.el
@ 2011-04-11 11:56 Juanma Barranquero
  0 siblings, 0 replies; only message in thread
From: Juanma Barranquero @ 2011-04-11 11:56 UTC (permalink / raw)
  To: Emacs developers

This question is for people with experience in completion.el.


While trying to compile completion.el under lexical-binding, I came
across the dynamic variable completion-string, which is shadowed by
the COMPLETION-STRING parameter of a couple of functions
(`add-completion-to-head' and `delete-completion', to be precise).

AFAICS all references to the completion-string variable through
completion.el are really references to the parameters, not to the
dynamic variable, except this clause of `cond' in
`locate-completion-entry':

            (cmpl-db-debug-p
             ;; not found, error if debug mode
             (error "Completion entry exists but not on prefix list - %s"
                    completion-string))

which is the only place where the dynamic binding comes into effect.

Now, as locate-completion-entry is only called from places where
completion-string comes from a parameter COMPLETION-STRING (namely,
the two functions mentioned above, and as a recursive call from
locate-completion-entry-retry), that means that it would be possible
to rename the dynamic variable and just let-bind it from inside the
two relevant functions. Problem solved.

The question is: perhaps it would be better to change that error call
and get rid of the variable, if possible. The message talks about the
completion entry and the prefix list, but it displays the completion
string. I cannot really say that I understand what it is trying to
tell the user. Isn't completion-entry or prefix-list what would be
expected there?

Comments?

   Juanma



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-11 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-11 11:56 Trying to get rid of completion-string in completion.el Juanma Barranquero

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