[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: docstring of display-completion-list
From: |
Roland Winkler |
Subject: |
Re: docstring of display-completion-list |
Date: |
19 Mar 2002 13:45:18 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
kevinr@ihs.com (Kevin Rodgers) writes:
> [Followup-To: gnu.emacs.help]
>
> Roland Winkler wrote:
> >
> > Attached below is the code of a function my-complete-symbol. Most of
> > the code I borrowed from lisp-complete-symbol. The function works
> > completely as expected. However, according to the docstring of
> > display-completion-list used at the end of this function there is
> > one thing I do not understand at all:
> >
> > If I choose a completion from the `*Completions*' buffer, why is the
> > text inserted in the buffer from where I called my-complete-symbol?
> >
> > According to the docstring of display-completion-list it runs the
> > hook completion-setup-hook which (I think by default) calls the
> > undocumented function completion-setup-function. Is the latter
> > inserting the completion in the buffer from where I called
> > my-complete-symbol?
>
> No, I think it's this bit in my-complete-symbol itself:
>
> > ((not (string= pattern completion))
> > (delete-region beg end)
> > (insert completion))
No, I don't think so. This cond clause is evaluated when pattern is
shorter than completion so that inserting something makes sense. The
last cond clause with the call to display-completion-list is
evaluated when pattern equals completion and one really has to make
a choice from the *Completion* buffer. You can check that the above
clause is not evaluated when the completion buffer is generated and
one makes a choice in it. So what's going on here??
Roland