GNU bug report logs - #17899
24.3.92.1; dabbrev-completion incorrectly searches all buffers

Previous Next

Package: emacs;

Reported by: Stefan Guath <stefan <at> automata.se>

Date: Wed, 2 Jul 2014 13:56:02 UTC

Severity: normal

Found in versions 23.1, 24.3.92.1

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Alan Third <alan <at> idiocy.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#17899: closed (24.3.92.1; dabbrev-completion incorrectly
 searches all buffers)
Date: Tue, 10 Dec 2019 20:55:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 10 Dec 2019 20:54:06 +0000
with message-id <20191210205406.GA61566 <at> breton.holly.idiocy.org>
and subject line Re: bug#17899: 24.3.92.1; dabbrev-completion incorrectly searches all buffers
has caused the debbugs.gnu.org bug report #17899,
regarding 24.3.92.1; dabbrev-completion incorrectly searches all buffers
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
17899: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17899
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Guath <stefan <at> automata.se>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.92.1; dabbrev-completion incorrectly searches all buffers
Date: Wed, 2 Jul 2014 15:54:43 +0200
VERSION:
GNU Emacs 24.3.92.1 (x86_64-apple-darwin13.2.0, NS apple-appkit-1265.20)

TO REPRODUCE BUG:
* emacs -Q
* Create two buffers (C-x b) with the following contents:
foo.el: "idris0 idris1"
bar.el: "ideal0 ideal1"
* Go to end of foo.el, write "id" and execute dabbrev-completion (C-M-/)

EXPECTED RESULT
"id" should complete to "idris". The doc of dabbrev-completion is very clear on this:

"Like M-/ but finds all expansions in the current buffer
and presents suggestions for completion.

With a prefix argument ARG, 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."

No prefix was given here, so it should just look in the current buffer.

ACTUAL RESULT
A new buffer opens with the text:

"In this buffer, type RET to select the completion near point.

Possible completions are:
ideal0                                 ideal1
idris0                                 idris1"

Apparently, the buffer bar.el was incorrectly taken into account. After killing buffer bar.el, dabbrev-completion completes as expected in foo.el.

[Message part 3 (message/rfc822, inline)]
From: Alan Third <alan <at> idiocy.org>
To: Stefan Guath <stefan <at> automata.se>
Cc: 17899-done <at> debbugs.gnu.org
Subject: Re: bug#17899: 24.3.92.1; dabbrev-completion incorrectly searches
 all buffers
Date: Tue, 10 Dec 2019 20:54:06 +0000
On Thu, Dec 05, 2019 at 01:19:13PM +0000, Alan Third wrote:
> Stefan Guath <stefan <at> automata.se> writes:
> 
> > TO REPRODUCE BUG:
> > * emacs -Q
> > * Create two buffers (C-x b) with the following contents:
> > foo.el: "idris0 idris1"
> > bar.el: "ideal0 ideal1"
> > * Go to end of foo.el, write "id" and execute dabbrev-completion (C-M-/)
> >
> > EXPECTED RESULT
> > "id" should complete to "idris".
> 
> Hi, sorry it took so long for someone to look at this.
> 
> I believe the attached patch fixes it. The problem seems to have been
> switching dabbrev.el over to using lexical scoping. It was previously
> using let* to temporarily override a couple of global variables, which
> works with dynamic scoping, but not lexical.

I’ve pushed to master and am therefore closing this bug report.
-- 
Alan Third


This bug report was last modified 5 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.