* lisp/tab-bar.el (switch-to-buffer-other-tab): Normalize buffer.
authorJuri Linkov <juri@linkov.net>
Sat, 30 May 2020 22:30:34 +0000 (01:30 +0300)
committerJuri Linkov <juri@linkov.net>
Sat, 30 May 2020 22:30:34 +0000 (01:30 +0300)
* lisp/tab-bar.el (switch-to-buffer-other-tab): Use
'window-normalize-buffer-to-switch-to' on 'buffer-or-name',
like does 'pop-to-buffer' used by 'switch-to-buffer-other-frame',
instead of raising the error "Invalid buffer" on a non-existent buffer name.

lisp/tab-bar.el

index 69863e55ce3ba442546ffc7b075aeb5cfebedfea..5c237e7130e8c1b6b2ced1e4310c206bc5877e5b 100644 (file)
@@ -1526,9 +1526,10 @@ indirectly called by the latter."
 Like \\[switch-to-buffer-other-frame] (which see), but creates a new tab."
   (interactive
    (list (read-buffer-to-switch "Switch to buffer in other tab: ")))
-  (display-buffer buffer-or-name '((display-buffer-in-tab
-                                    display-buffer-same-window)
-                                   (inhibit-same-window . nil))
+  (display-buffer (window-normalize-buffer-to-switch-to buffer-or-name)
+                  '((display-buffer-in-tab
+                     display-buffer-same-window)
+                    (inhibit-same-window . nil))
                   norecord))
 
 (defun find-file-other-tab (filename &optional wildcards)