all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 8163@debbugs.gnu.org, Ed Avis <eda@waniasset.com>
Subject: bug#8163: 23.2; Feature request: dabbrev look at filenames or buffer names
Date: Thu, 12 May 2022 19:42:09 +0300	[thread overview]
Message-ID: <86tu9v3pia.fsf@mail.linkov.net> (raw)
In-Reply-To: <8735him6c3.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 10 May 2022 05:09:32 +0200")

>> Start emacs and start editing a file called abcdef:
>>
>> C-x C-f abcdef RET
>>
>> In that buffer type abcde and then press M-/ to run dabbrev-expand.
>>
>> Desired result: dabbrev looks at the buffer name (or the name of the
>> file it is visiting) and uses that to complete the string to 'abcdef'.
>> It could use the names of all open buffers as part of its pool.
>
> Makes sense to me.  I've now added this to Emacs 29.

Now dabbrev fails with:

Debugger entered--Lisp error: (error "Selecting deleted buffer")
  dabbrev--find-expansion("dabbr" -1 t)
  dabbrev-expand(nil)
  funcall-interactively(dabbrev-expand nil)
  command-execute(dabbrev-expand)

because dabbrev--last-buffer is a killed buffer in dabbrev--find-expansion:

	           (setq dabbrev--last-buffer
                         (pop dabbrev--friend-buffer-list))
	           (set-buffer dabbrev--last-buffer)

I don't see how can it not fail when the temporary buffer
"*abbrev-file*" gets added to dabbrev--friend-buffer-list:

                 (setq dabbrev--friend-buffer-list
                       (append dabbrev--friend-buffer-list
                               (list file-name-buffer))))

and then gets deleted afterwards:

           (when (buffer-live-p file-name-buffer)
             (kill-buffer file-name-buffer))))))))

So dabbrev--friend-buffer-list always contains '(... #<killed buffer>)
at the end, and at the next call to dabbrev--last-buffer causes the error.





  reply	other threads:[~2022-05-12 16:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 14:19 bug#8163: 23.2; Feature request: dabbrev look at filenames or buffer names Ed Avis
2022-05-10  3:09 ` Lars Ingebrigtsen
2022-05-12 16:42   ` Juri Linkov [this message]
2022-05-13 12:30     ` Lars Ingebrigtsen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86tu9v3pia.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=8163@debbugs.gnu.org \
    --cc=eda@waniasset.com \
    --cc=larsi@gnus.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.