Replace display-buffer with pop-to-buffer that sets the current buffer
explicitly.
(declare (advertised-calling-convention (buffer-or-name) "28.1"))
(interactive
(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))))
+ (pop-to-buffer (window-normalize-buffer-to-switch-to buffer-or-name)
+ '((display-buffer-in-tab)
+ (inhibit-same-window . nil))))
(defun find-file-other-tab (filename &optional wildcards)
"Edit file FILENAME, in another tab.