[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: dabbrev-completion doc string
From: |
Drew Adams |
Subject: |
RE: dabbrev-completion doc string |
Date: |
Fri, 25 Nov 2005 16:27:53 -0800 |
IIUC, a nil ARG means to search only the current buffer.
I apparently did not read the docstring carefully enough. The first
paragraph says exactly that.
I don't see that. I'm looking at a June CVS snapshot. Here is the whole doc
string:
"Completion on current word.
Like \\[dabbrev-expand] but finds all expansions in the current buffer
and presents suggestions for completion.
With a prefix argument, it searches all buffers accepted by the
function pointed out by `dabbrev-friend-buffer-function' to find the
completions.
If the prefix argument is 16 (which comes from C-u C-u),
then it searches *all* buffers.
With no prefix argument, it reuses an old completion list
if there is a suitable one already."
It's true that the second line mentions the current buffer, but the contrast
with the non-nil ARG case is not made explicitly. The main point of the
second sentence is to contrast the behavior with that of `dabbrev-expand' -
namely, `dabbrev-completion' uses the *Completions* buffer (it also does not
let you cycle candidates - which is not mentioned, BTW).
I originally thought that no-prefix arg part was clear enough, but now I
think it might help to explicitly say that nil searches only the current
buffer, even if that is suggested by the second sentence.
I also think it might be good to point out that `dabbrev-expand' lets you
cycle among completion candidates (by repeating `M-/', whereas you cannot do
that with `dabbrev-completion'. The advantage of `dabbrev-completion' is to
show you the candidate list and let you choose a candidate directly (random
access, with the mouse).
Perhaps this all hinges on the meaning of "if there is a suitable one
already" - just what does that mean? I suspect that explaining what
"suitable" means here, in user terms, would mean explaining
that only the current buffer is to be searched. But I could be wrong.
On reading through the source code, I am the one who is confused now.
Whether the old list is suitable or not is determined by an `and'
expression. But that `and' expression includes
`dabbrev--last-abbreviation' and this happens after
`dabbrev--reset-global-variables' got called which always sets
`dabbrev--last-abbreviation' to nil.
The way I understand it, the `and' expression _always_ returns nil and
the old completion list is _never_ suitable.
I think you're right.
I must be misunderstanding something. I Cc-ed the listed maintainer.
Thanks,
Drew
- RE: dabbrev-completion doc string,
Drew Adams <=