From: "kassick@gmail.com" <kassick@gmail.com>
To: 71654@debbugs.gnu.org
Subject: bug#71654: [PATCH] Fix display-buffer-override-next-command
Date: Wed, 19 Jun 2024 12:20:19 -0300 [thread overview]
Message-ID: <CAJvJD8hDy3H65jaG9rD5HCygovn_1j6MgiXDXQLOq4=103Sbhg@mail.gmail.com> (raw)
[-- 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
next reply other threads:[~2024-06-19 15:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 15:20 kassick [this message]
2024-06-19 21:17 ` bug#71654: [PATCH] Fix display-buffer-override-next-command 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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJvJD8hDy3H65jaG9rD5HCygovn_1j6MgiXDXQLOq4=103Sbhg@mail.gmail.com' \
--to=kassick@gmail.com \
--cc=71654@debbugs.gnu.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).