From: Rodrigo Kassick Date: Wed, 19 Jun 2024 21:04:08 +0000 (+0200) Subject: Fix display-buffer-override-next-command (bug#71654) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4aced351e411409d23ecab590a352f35149e82fb;p=emacs.git Fix display-buffer-override-next-command (bug#71654) * lisp/window.el (display-buffer-override-next-command): display-buffer-overriding-action's car can be either a function or a list of functions. When a function, (push action (car display-buffer-overriding-action)) will create a cons-cell (action . function) instead of a list. In the clear-fun callback, trying to (delq action (car display-buffer-overriding-action)) causes an wrong-type-argument error. Copyright-paperwork-exempt: yes (cherry picked from commit 374f4235d5e78def23d92b05f3d0257c1f609725) --- diff --git a/lisp/window.el b/lisp/window.el index 8b8bb8648bc..e25704f4386 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9320,6 +9320,9 @@ to deactivate this overriding action." (when echofun (add-hook 'prefix-command-echo-keystrokes-functions echofun)) (setq switch-to-buffer-obey-display-actions t) + (unless (listp (car display-buffer-overriding-action)) + (setcar display-buffer-overriding-action + (list (car display-buffer-overriding-action)))) (push action (car display-buffer-overriding-action)) exitfun))