From d0975d7db03c231a3db5a1cd0edaf41094d43f0d Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 13 May 2022 14:29:48 +0200 Subject: [PATCH] Fix dabbrev expansion after recent file-name buffer addition * lisp/dabbrev.el (dabbrev--find-expansion): Remove the now-dead file name buffer from dabbrev--friend-buffer-list, so that we don't trip over the killed buffer later (bug introduced in 2d0085f756). --- lisp/dabbrev.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index 8f8d553cdab..215425f1367 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -802,7 +802,10 @@ of the start of the occurrence." (progress-reporter-done dabbrev--progress-reporter) expansion)) (when (buffer-live-p file-name-buffer) - (kill-buffer file-name-buffer)))))))) + (kill-buffer file-name-buffer)) + (setq dabbrev--friend-buffer-list + (seq-filter #'buffer-live-p + dabbrev--friend-buffer-list)))))))) ;; Compute the list of buffers to scan. ;; If dabbrev-search-these-buffers-only, then the current buffer -- 2.39.2