all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#71654: [PATCH] Fix display-buffer-override-next-command
@ 2024-06-19 15:20 kassick
  2024-06-19 21:17 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-06-19 21:32 ` Andrea Corallo
  0 siblings, 2 replies; 9+ messages in thread
From: kassick @ 2024-06-19 15:20 UTC (permalink / raw)
  To: 71654


[-- Attachment #1.1: Type: text/plain, Size: 1421 bytes --]

When display-buffer-overriding-action's car is set to a function instead of
a list, display-buffer-override-next-command must ensure that the car is a
list before pushing a new element to it, otherwise the car will become a
itself a cons-cell and the clear-fun will trigger a wrong-type-argumen
error when trying to delq the action.

The error can be triggered by using some minor mode that
updates display-buffer-override-next-command (such as purpose-mode) and
then calling other-window-prefix.

The patch was created using the `emacs-29` branch.

----

In GNU Emacs 29.3.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version
 3.24.41, cairo version 1.18.0) of 2024-05-27 built on thnkpd
System Description: Fedora Linux 39 (Workstation Edition)

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr/local
 --sharedstatedir=/var/lib --localstatedir=/var/lib --enable-libsystemd
 --with-pop=yes --build x86_64-linux-gnu
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-cairo
 --with-x=yes --with-x-toolkit=gtk3 --with-pgtk
 --with-toolkit-scroll-bars --without-xwidgets --with-imagemagick
 --with-native-compilation --with-tree-sitter --with-xinput2'

-- 
Rodrigo Virote Kassick
------------------------------------------------------------

[-- Attachment #1.2: Type: text/html, Size: 1765 bytes --]

[-- Attachment #2: 0001-Fix-display-buffer-override-next-command.patch --]
[-- Type: text/x-patch, Size: 1246 bytes --]

From 8fa11a451949be743d4bdedd5117571d912e2209 Mon Sep 17 00:00:00 2001
From: Rodrigo Kassick <kassick@gmail.com>
Date: Wed, 19 Jun 2024 11:46:35 -0300
Subject: [PATCH] Fix display-buffer-override-next-command

* 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.
---
 lisp/window.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/window.el b/lisp/window.el
index 13fe1feba10..8db0584c910 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -9109,6 +9109,8 @@ display-buffer-override-next-command
     (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))
 
-- 
2.45.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-06-20  7:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19 15:20 bug#71654: [PATCH] Fix display-buffer-override-next-command kassick
2024-06-19 21:17 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-19 21:53   ` kassick
2024-06-19 21:32 ` Andrea Corallo
2024-06-19 21:54   ` kassick
2024-06-19 22:11     ` Andrea Corallo
2024-06-19 22:16       ` kassick
2024-06-20  7:55         ` Andrea Corallo
2024-06-20  5:15       ` Eli Zaretskii

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.