]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix display-buffer-override-next-command to call action only once (bug#39722)
authorJuri Linkov <juri@linkov.net>
Sun, 21 Jun 2020 23:36:16 +0000 (02:36 +0300)
committerJuri Linkov <juri@linkov.net>
Sun, 21 Jun 2020 23:36:16 +0000 (02:36 +0300)
* lisp/vc/vc-dir.el (vc-dir-bookmark-jump): Don't use save-window-excursion.

* lisp/window.el (display-buffer-override-next-command): Reset
display-buffer-overriding-action after the first buffer display action.

* lisp/tab-bar.el (switch-to-buffer-other-tab): Don't reuse frame tabs.
(other-tab-prefix): Don't reuse frame tabs.

lisp/tab-bar.el
lisp/vc/vc-dir.el
lisp/window.el

index b54258a4e4a5780021996a3be8c0a338a3fd5f4c..0a336e41658a3a072d4b7fde0b571afae3100596 100644 (file)
@@ -1543,8 +1543,7 @@ Like \\[switch-to-buffer-other-frame] (which see), but creates a new tab."
    (list (read-buffer-to-switch "Switch to buffer in other tab: ")))
   (display-buffer (window-normalize-buffer-to-switch-to buffer-or-name)
                   '((display-buffer-in-tab)
-                    (inhibit-same-window . nil)
-                    (reusable-frames . t))
+                    (inhibit-same-window . nil))
                   norecord))
 
 (defun find-file-other-tab (filename &optional wildcards)
@@ -1575,8 +1574,7 @@ When `switch-to-buffer-obey-display-actions' is non-nil,
    (lambda (buffer alist)
      (cons (progn
              (display-buffer-in-tab
-              buffer (append alist '((inhibit-same-window . nil)
-                                     (reusable-frames . t))))
+              buffer (append alist '((inhibit-same-window . nil))))
              (selected-window))
            'tab)))
   (message "Display next command buffer in a new tab..."))
index a86c37c24ae8cb64090c1c4e588db3d6b498c381..cdf8ab984e8697e7bc6d6374c59cdc3aa887f3bb 100644 (file)
@@ -1496,8 +1496,9 @@ This implements the `bookmark-make-record-function' type for
 This implements the `handler' function interface for the record
 type returned by `vc-dir-bookmark-make-record'."
   (let* ((file (bookmark-prop-get bmk 'filename))
-         (buf (save-window-excursion
-                 (vc-dir file) (current-buffer))))
+         (buf (progn ;; Don't use save-window-excursion (bug#39722)
+                (vc-dir file)
+                (current-buffer))))
     (bookmark-default-handler
      `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bmk)))))
 
index f6f30ad6f493e0620c7c579f244242486ba20de0..a84ca05daacb84c27bddb9a9e8f737365e55cbfd 100644 (file)
@@ -8627,15 +8627,20 @@ window; the function takes two arguments: an old and new window."
   (let* ((old-window (or (minibuffer-selected-window) (selected-window)))
          (new-window nil)
          (minibuffer-depth (minibuffer-depth))
+         (clearfun (make-symbol "clear-display-buffer-overriding-action"))
          (action (lambda (buffer alist)
                    (unless (> (minibuffer-depth) minibuffer-depth)
                      (let* ((ret (funcall pre-function buffer alist))
                             (window (car ret))
                             (type (cdr ret)))
                        (setq new-window (window--display-buffer buffer window
-                                                                type alist))))))
+                                                                type alist))
+                       ;; Reset display-buffer-overriding-action
+                       ;; after the first buffer display action
+                       (funcall clearfun)
+                       (setq post-function nil)
+                       new-window))))
          (command this-command)
-         (clearfun (make-symbol "clear-display-buffer-overriding-action"))
          (exitfun
           (lambda ()
             (setq display-buffer-overriding-action
@@ -8653,6 +8658,8 @@ window; the function takes two arguments: an old and new window."
                     ;; adding the hook by the same command below.
                     (eq this-command command))
               (funcall exitfun))))
+    ;; Reset display-buffer-overriding-action
+    ;; after the next command finishes
     (add-hook 'post-command-hook clearfun)
     (push action display-buffer-overriding-action)))