]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix dabbrev expansion after recent file-name buffer addition
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 13 May 2022 12:29:48 +0000 (14:29 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 13 May 2022 12:30:09 +0000 (14:30 +0200)
* 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

index 8f8d553cdabb4783ceaf253e8f61942147429d85..215425f1367e5b3edec2d0acf484f31d56745c8c 100644 (file)
@@ -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