*** The tab bar now supports more mouse commands.
Clicking 'mouse-2' closes the tab, 'mouse-3' displays the context menu
with items that operate on the clicked tab. Dragging the tab with
-'mouse-1' moves it to another position on the tab bar.
+'mouse-1' moves it to another position on the tab bar. Mouse wheel
+scrolling switches to the previous/next tab, and holding the Shift key
+during scrolling moves the tab to the left/right.
*** The key prefix 'C-x t t' displays next command buffer in a new tab.
It's bound to the command 'other-tab-prefix' that requests the buffer
(define-key map [mouse-2] 'ignore)
(define-key map [down-mouse-3] 'tab-bar-mouse-context-menu)
+ (define-key map [mouse-4] 'tab-previous)
+ (define-key map [mouse-5] 'tab-next)
+ (define-key map [wheel-up] 'tab-previous)
+ (define-key map [wheel-down] 'tab-next)
+ (define-key map [wheel-left] 'tab-previous)
+ (define-key map [wheel-right] 'tab-next)
+
+ (define-key map [S-mouse-4] 'tab-bar-move-tab-backward)
+ (define-key map [S-mouse-5] 'tab-bar-move-tab)
+ (define-key map [S-wheel-up] 'tab-bar-move-tab-backward)
+ (define-key map [S-wheel-down] 'tab-bar-move-tab)
+ (define-key map [S-wheel-left] 'tab-bar-move-tab-backward)
+ (define-key map [S-wheel-right] 'tab-bar-move-tab)
+
map)
"Keymap for the commands used on the tab bar.")
(to-index (mod (+ from-index arg) (length tabs))))
(tab-bar-move-tab-to (1+ to-index) (1+ from-index))))
+(defun tab-bar-move-tab-backward (&optional arg)
+ "Move the current tab ARG positions to the left.
+Like `tab-bar-move-tab', but moves in the opposite direction."
+ (interactive "p")
+ (tab-bar-move-tab (- (or arg 1))))
+
(defun tab-bar-move-tab-to-frame (arg &optional from-frame from-index to-frame to-index)
"Move tab from FROM-INDEX position to new position at TO-INDEX.
FROM-INDEX defaults to the current tab index.
(defvar tab-bar-move-repeat-map
(let ((map (make-sparse-keymap)))
- (define-key map "m" 'tab-move)
- (define-key map "M" (lambda ()
- (interactive)
- (setq repeat-map 'tab-bar-move-repeat-map)
- (tab-move -1)))
+ (define-key map "m" 'tab-bar-move-tab)
+ (define-key map "M" 'tab-bar-move-tab-backward)
map)
"Keymap to repeat tab move key sequences `C-x t m m M'.
Used in `repeat-mode'.")
window = window_from_coordinates (f, x, y, 0, true, true);
tab_bar_p = EQ (window, f->tab_bar_window);
- if (tab_bar_p && event->xbutton.button < 4)
+ if (tab_bar_p)
tab_bar_key = handle_tab_bar_click
(f, x, y, event->xbutton.type == ButtonPress,
x_x_to_emacs_modifiers (dpyinfo, event->xbutton.state));