From: Juri Linkov Date: Sat, 30 May 2020 22:30:34 +0000 (+0300) Subject: * lisp/tab-bar.el (switch-to-buffer-other-tab): Normalize buffer. X-Git-Tag: emacs-27.1-rc1~96 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f72bb4ce36686d814bbb540a7844f22570540bc8;p=emacs.git * 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. --- diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 69863e55ce3..5c237e7130e 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -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)