]> git.eshelyaron.com Git - emacs.git/commitdiff
Make the buffer displayed by tab-bar-select-restore-windows internal
authorJuri Linkov <juri@linkov.net>
Thu, 2 May 2024 17:44:04 +0000 (20:44 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:35:34 +0000 (18:35 +0200)
* lisp/tab-bar.el (tab-bar-select-restore-windows): Make the buffer
" *Old buffer %s*" internal with the leading space in its name.

(cherry picked from commit a914667a0071e3a19846fff9ea5ff8e8f1457e17)

etc/NEWS
lisp/tab-bar.el

index 73e88f33b7a9c80fb099bd904531743875f30c33..e068497d7bab8d922ddc18f2c06a6ab7ed18c957 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -337,9 +337,9 @@ points after switching back to that tab.
 ---
 *** New user option 'tab-bar-select-restore-windows'.
 It defines what to do with windows whose buffer was killed since the tab
-was last selected.  By default it displays a placeholder buffer that
-provides information about the name of the killed buffer that was
-displayed in that window.
+was last selected.  By default it displays a placeholder buffer
+with the name " *Old buffer <name>*" that provides information about
+the name of the killed buffer that was displayed in that window.
 
 ---
 *** New user option 'tab-bar-tab-name-format-functions'.
index cd076664faf5b3334280d6040fe1269240ba9911..2a4f8fd69160ae3b7f3254a210556028ca2b5b37 100644 (file)
@@ -1440,11 +1440,10 @@ if it was visiting a file."
                      (buffer-file-name old-buffer)))
              (name (or file
                        (and (bufferp old-buffer)
-                            (fboundp 'buffer-last-name)
                             (buffer-last-name old-buffer))
                        old-buffer))
              (new-buffer (generate-new-buffer
-                          (format "*Old buffer %s*" name))))
+                          (format " *Old buffer %s*" name))))
         (with-current-buffer new-buffer
           (set-auto-mode)
           (insert (format-message "This window displayed the %s `%s'.\n"
@@ -1511,7 +1510,7 @@ Negative TAB-NUMBER counts tabs from the end of the tab bar."
     (when (and read-minibuffer-restore-windows minibuffer-was-active
                (not tab-bar-minibuffer-restore-tab))
       (setq-local tab-bar-minibuffer-restore-tab (1+ from-index))
-      (add-hook 'minibuffer-exit-hook 'tab-bar-minibuffer-restore-tab nil t))
+      (add-hook 'minibuffer-exit-hook #'tab-bar-minibuffer-restore-tab nil t))
 
     (unless (eq from-index to-index)
       (let* ((from-tab (tab-bar--tab))