aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2019-09-08 23:18:45 +0300
committerJuri Linkov2019-09-08 23:18:45 +0300
commit89ef791c07637953f514c0ead2f5935ac41ebc33 (patch)
treed59dc2ba8a727abf19fe597fbc2c6d06416df58e
parenta7289c0488fd55260d29685b6c1b79b8a3cd8f92 (diff)
downloademacs-89ef791c07637953f514c0ead2f5935ac41ebc33.tar.gz
emacs-89ef791c07637953f514c0ead2f5935ac41ebc33.zip
Small fixes for tty and w32.
* lisp/menu-bar.el (showhide-tab-bar): Visible on tty too. * lisp/tab-bar.el (tab-bar-mode): Add binding [(control shift tab)] for w32. * lisp/tab-line.el (tab-line-add-tab): Use tmm-prompt for buffer-menu on tty. * src/w32term.c (w32_read_socket): Fix tool-bar clicks.
-rw-r--r--lisp/menu-bar.el1
-rw-r--r--lisp/tab-bar.el7
-rw-r--r--lisp/tab-line.el6
-rw-r--r--src/w32term.c4
4 files changed, 10 insertions, 8 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 112b567a0b2..4b5f4457df8 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1245,7 +1245,6 @@ mail status in mode line"))
1245 (bindings--define-key menu [showhide-tab-bar] 1245 (bindings--define-key menu [showhide-tab-bar]
1246 '(menu-item "Tab Bar" toggle-tab-bar-mode-from-frame 1246 '(menu-item "Tab Bar" toggle-tab-bar-mode-from-frame
1247 :help "Turn tab bar on/off" 1247 :help "Turn tab bar on/off"
1248 :visible (display-graphic-p)
1249 :button 1248 :button
1250 (:toggle . (menu-bar-positive-p 1249 (:toggle . (menu-bar-positive-p
1251 (frame-parameter (menu-bar-frame-for-menubar) 1250 (frame-parameter (menu-bar-frame-for-menubar)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index de4faa2a4d7..57be4e09a8f 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -96,6 +96,7 @@
96 default-frame-alist))))) 96 default-frame-alist)))))
97 (when tab-bar-mode 97 (when tab-bar-mode
98 (global-set-key [(control shift iso-lefttab)] 'tab-bar-switch-to-prev-tab) 98 (global-set-key [(control shift iso-lefttab)] 'tab-bar-switch-to-prev-tab)
99 (global-set-key [(control shift tab)] 'tab-bar-switch-to-prev-tab)
99 (global-set-key [(control tab)] 'tab-bar-switch-to-next-tab))) 100 (global-set-key [(control tab)] 'tab-bar-switch-to-next-tab)))
100 101
101(defun tab-bar-mouse (event) 102(defun tab-bar-mouse (event)
@@ -334,7 +335,7 @@ If `rightmost', create as the last tab."
334 (setcdr prev-tab (cons new-tab (cdr prev-tab)))))))) 335 (setcdr prev-tab (cons new-tab (cdr prev-tab))))))))
335 (set-frame-parameter nil 'tabs tabs) 336 (set-frame-parameter nil 'tabs tabs)
336 (tab-bar-select-tab new-tab) 337 (tab-bar-select-tab new-tab)
337 (unless (and (display-graphic-p) tab-bar-mode) 338 (unless tab-bar-mode
338 (message "Added new tab with the current window configuration")))) 339 (message "Added new tab with the current window configuration"))))
339 340
340 341
@@ -395,14 +396,14 @@ specified by `tab-bar-close-tab-select'."
395 "Create a new named window configuration without having to click a tab." 396 "Create a new named window configuration without having to click a tab."
396 (interactive) 397 (interactive)
397 (tab-bar-add-tab) 398 (tab-bar-add-tab)
398 (unless (and (display-graphic-p) tab-bar-mode) 399 (unless tab-bar-mode
399 (message "Added new tab with the current window configuration"))) 400 (message "Added new tab with the current window configuration")))
400 401
401(defun delete-tab () 402(defun delete-tab ()
402 "Delete the current window configuration without clicking a close button." 403 "Delete the current window configuration without clicking a close button."
403 (interactive) 404 (interactive)
404 (tab-bar-close-current-tab) 405 (tab-bar-close-current-tab)
405 (unless (and (display-graphic-p) tab-bar-mode) 406 (unless tab-bar-mode
406 (message "Deleted the current tab"))) 407 (message "Deleted the current tab")))
407 408
408(defalias 'list-tabs 'tab-bar-list) 409(defalias 'list-tabs 'tab-bar-list)
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 2122a14be67..8ade53611f3 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -203,8 +203,10 @@ Reduce tab width proportionally to space taken by other tabs."
203 203
204(defun tab-line-add-tab (&optional e) 204(defun tab-line-add-tab (&optional e)
205 (interactive "e") 205 (interactive "e")
206 ;; Maybe (buffer-menu-open) 206 (if window-system
207 (mouse-buffer-menu e)) 207 (mouse-buffer-menu e) ; like (buffer-menu-open)
208 ;; tty menu doesn't support mouse clicks, so use tmm
209 (tmm-prompt (mouse-buffer-menu-keymap))))
208 210
209(defun tab-line-select-tab (&optional e) 211(defun tab-line-select-tab (&optional e)
210 "Switch to the selected tab. 212 "Switch to the selected tab.
diff --git a/src/w32term.c b/src/w32term.c
index dc516390d16..4d230a2293c 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5097,7 +5097,7 @@ w32_read_socket (struct terminal *terminal,
5097 int x = XFIXNAT (inev.x); 5097 int x = XFIXNAT (inev.x);
5098 int y = XFIXNAT (inev.y); 5098 int y = XFIXNAT (inev.y);
5099 5099
5100 window = window_from_coordinates (f, x, y, 0, 1, 0); 5100 window = window_from_coordinates (f, x, y, 0, 1, 1);
5101 5101
5102 if (EQ (window, f->tab_bar_window)) 5102 if (EQ (window, f->tab_bar_window))
5103 { 5103 {
@@ -5122,7 +5122,7 @@ w32_read_socket (struct terminal *terminal,
5122 int x = XFIXNAT (inev.x); 5122 int x = XFIXNAT (inev.x);
5123 int y = XFIXNAT (inev.y); 5123 int y = XFIXNAT (inev.y);
5124 5124
5125 window = window_from_coordinates (f, x, y, 0, 1, 0); 5125 window = window_from_coordinates (f, x, y, 0, 1, 1);
5126 5126
5127 if (EQ (window, f->tool_bar_window)) 5127 if (EQ (window, f->tool_bar_window))
5128 { 5128 {