Subject: bug#17899: closed (Re: bug#17899: 24.3.92.1; dabbrev-completion incorrectly searches all buffers)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 10 Dec 2019 20:55:02 +0000

Your bug report

#17899: 24.3.92.1; dabbrev-completion incorrectly searches all buffers

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
17899: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17899
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#17899: 24.3.92.1; dabbrev-completion incorrectly searches all buffers
From: Alan Third <[email-masked]>
To: Stefan Guath <[email-masked]>
Cc: [email-masked]
Date: Tue, 10 Dec 2019 20:54:06 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

On Thu, Dec 05, 2019 at 01:19:13PM +0000, Alan Third wrote:
> Stefan Guath <[email-masked]> 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

Subject: 24.3.92.1; dabbrev-completion incorrectly searches all buffers
From: Stefan Guath <[email-masked]>
To: [email-masked]
Date: Wed, 2 Jul 2014 15:54:43 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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.