'S-M-right C-h i' displays the "*Info*" buffer in the right window,
creating the window if necessary. A special key can be customized to
display the buffer in the same window, for example, 'S-M-0 C-h e'
-displays the "*Messages*" buffer in the same window.
+displays the "*Messages*" buffer in the same window. 'S-M-t C-h C-n'
+displays NEWS in a new tab.
*** Windmove also supports directional window deletion.
The new command 'windmove-delete-default-keybindings' binds default
(minibuffer-depth (minibuffer-depth))
(action (lambda (buffer alist)
(unless (> (minibuffer-depth) minibuffer-depth)
- (let ((window (if (eq dir 'same-window)
- (selected-window)
- (window-in-direction
- dir nil nil
- (and arg (prefix-numeric-value arg))
- windmove-wrap-around)))
+ (let ((window (cond
+ ((eq dir 'new-tab)
+ (let ((tab-bar-new-tab-choice t))
+ (tab-bar-new-tab))
+ (selected-window))
+ ((eq dir 'same-window)
+ (selected-window))
+ (t (window-in-direction
+ dir nil nil
+ (and arg (prefix-numeric-value arg))
+ windmove-wrap-around))))
(type 'reuse))
(unless window
(setq window (split-window nil nil dir) type 'window))
(interactive "P")
(windmove-display-in-direction 'same-window arg))
+;;;###autoload
+(defun windmove-display-new-tab (&optional arg)
+ "Display the next buffer in a new tab."
+ (interactive "P")
+ (windmove-display-in-direction 'new-tab arg))
+
;;;###autoload
(defun windmove-display-default-keybindings (&optional modifiers)
"Set up keybindings for directional buffer display.
(global-set-key (vector (append modifiers '(right))) 'windmove-display-right)
(global-set-key (vector (append modifiers '(up))) 'windmove-display-up)
(global-set-key (vector (append modifiers '(down))) 'windmove-display-down)
- (global-set-key (vector (append modifiers '(?0))) 'windmove-display-same-window))
+ (global-set-key (vector (append modifiers '(?0))) 'windmove-display-same-window)
+ (global-set-key (vector (append modifiers '(?t))) 'windmove-display-new-tab))
\f
;;; Directional window deletion