emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d7270b4445: Allow C-x 4 4, C-x 5 5, C-x t t to handle commands th


From: Juri Linkov
Subject: master d7270b4445: Allow C-x 4 4, C-x 5 5, C-x t t to handle commands that use switch-to-buffer
Date: Thu, 9 Jun 2022 02:42:42 -0400 (EDT)

branch: master
commit d7270b4445778b10a4d8ff9516dfa188ceeecf31
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    Allow C-x 4 4, C-x 5 5, C-x t t to handle commands that use switch-to-buffer
    
    * lisp/window.el (display-buffer-override-next-command):
    Temporarily set switch-to-buffer-obey-display-actions to t,
    and revert back to the original value afterwards.
    This allows other-window-prefix, other-frame-prefix, other-tab-prefix,
    windmove-display-in-direction to override the default behavior of
    commands that use switch-to-buffer.
    https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00483.html
---
 lisp/window.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/window.el b/lisp/window.el
index 1b8fe2b262..eba888a89d 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8931,6 +8931,7 @@ to deactivate this overriding action."
   (let* ((old-window (or (minibuffer-selected-window) (selected-window)))
          (new-window nil)
          (minibuffer-depth (minibuffer-depth))
+         (obey-display switch-to-buffer-obey-display-actions)
          (clearfun (make-symbol "clear-display-buffer-overriding-action"))
          (postfun (make-symbol "post-display-buffer-override-next-command"))
          (action (lambda (buffer alist)
@@ -8955,6 +8956,7 @@ to deactivate this overriding action."
               (funcall post-function old-window new-window)))))
     (fset clearfun
           (lambda ()
+            (setq switch-to-buffer-obey-display-actions obey-display)
             (setcar display-buffer-overriding-action
                     (delq action (car display-buffer-overriding-action)))))
     (fset postfun
@@ -8971,6 +8973,7 @@ to deactivate this overriding action."
     (add-hook 'post-command-hook postfun)
     (when echofun
       (add-hook 'prefix-command-echo-keystrokes-functions echofun))
+    (setq switch-to-buffer-obey-display-actions t)
     (push action (car display-buffer-overriding-action))
     exitfun))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]