* lisp/tab-bar.el (switch-to-buffer-other-tab): Normalize buffer.

* 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.
This commit is contained in:
Juri Linkov 2020-05-31 01:30:34 +03:00
parent d3e0023aaa
commit f72bb4ce36

View 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)