unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Trying to get rid of completion-string in completion.el
Date: Mon, 11 Apr 2011 13:56:43 +0200	[thread overview]
Message-ID: <BANLkTi=thbd07pYPpo616e4WCDCKdQsFxw@mail.gmail.com> (raw)

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



                 reply	other threads:[~2011-04-11 11:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='BANLkTi=thbd07pYPpo616e4WCDCKdQsFxw@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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).