[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/tabs 848e21b 2/3: Small fixes. Bind [tab-line mous
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] feature/tabs 848e21b 2/3: Small fixes. Bind [tab-line mouse-1] to mouse-select-window. |
Date: |
Wed, 25 Sep 2019 16:31:04 -0400 (EDT) |
branch: feature/tabs
commit 848e21b0491cb0b2f8e3a59e9f5cabd7210dca5e
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>
Small fixes. Bind [tab-line mouse-1] to mouse-select-window.
---
lisp/mouse.el | 1 +
lisp/tab-line.el | 3 ++-
src/xdisp.c | 6 +++++-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index e947e16..8373889 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -2734,6 +2734,7 @@ is copied instead of being cut."
;; versions.
(global-set-key [header-line down-mouse-1] 'mouse-drag-header-line)
(global-set-key [header-line mouse-1] 'mouse-select-window)
+(global-set-key [tab-line mouse-1] 'mouse-select-window)
;; (global-set-key [mode-line drag-mouse-1] 'mouse-select-window)
(global-set-key [mode-line down-mouse-1] 'mouse-drag-mode-line)
(global-set-key [mode-line mouse-1] 'mouse-select-window)
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 169f7b8..cbe418a 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -260,7 +260,8 @@ using the `previous-buffer' command."
(dotimes (_ (1+ (seq-position prev-buffers buffer)))
(switch-to-prev-buffer window)))
(t
- (switch-to-buffer buffer)))))
+ (with-selected-window window
+ (switch-to-buffer buffer))))))
(defun tab-line-switch-to-prev-tab (&optional e)
"Switch to the previous tab."
diff --git a/src/xdisp.c b/src/xdisp.c
index 0fc387b..0e18c5a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2957,7 +2957,11 @@ init_iterator (struct it *it, struct window *w,
else if (base_face_id == TAB_LINE_FACE_ID)
row = MATRIX_TAB_LINE_ROW (w->desired_matrix);
else if (base_face_id == HEADER_LINE_FACE_ID)
- row = MATRIX_HEADER_LINE_ROW (w->desired_matrix);
+ {
+ /* Header line row depends on whether tab line is enabled. */
+ w->desired_matrix->tab_line_p = window_wants_tab_line (w);
+ row = MATRIX_HEADER_LINE_ROW (w->desired_matrix);
+ }
}
/* Clear IT, and set it->object and other IT's Lisp objects to Qnil.