emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] feature/tabs 89ef791: Small fixes for tty and w32.


From: Juri Linkov
Subject: [Emacs-diffs] feature/tabs 89ef791: Small fixes for tty and w32.
Date: Sun, 8 Sep 2019 16:19:17 -0400 (EDT)

branch: feature/tabs
commit 89ef791c07637953f514c0ead2f5935ac41ebc33
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    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.
---
 lisp/menu-bar.el | 1 -
 lisp/tab-bar.el  | 7 ++++---
 lisp/tab-line.el | 6 ++++--
 src/w32term.c    | 4 ++--
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 112b567..4b5f445 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1245,7 +1245,6 @@ mail status in mode line"))
     (bindings--define-key menu [showhide-tab-bar]
       '(menu-item "Tab Bar" toggle-tab-bar-mode-from-frame
                   :help "Turn tab bar on/off"
-                  :visible (display-graphic-p)
                   :button
                   (:toggle . (menu-bar-positive-p
                               (frame-parameter (menu-bar-frame-for-menubar)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index de4faa2..57be4e0 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -96,6 +96,7 @@
                                      default-frame-alist)))))
   (when tab-bar-mode
     (global-set-key [(control shift iso-lefttab)] 'tab-bar-switch-to-prev-tab)
+    (global-set-key [(control shift tab)]         'tab-bar-switch-to-prev-tab)
     (global-set-key [(control tab)]               
'tab-bar-switch-to-next-tab)))
 
 (defun tab-bar-mouse (event)
@@ -334,7 +335,7 @@ If `rightmost', create as the last tab."
           (setcdr prev-tab (cons new-tab (cdr prev-tab))))))))
     (set-frame-parameter nil 'tabs tabs)
     (tab-bar-select-tab new-tab)
-    (unless (and (display-graphic-p) tab-bar-mode)
+    (unless tab-bar-mode
       (message "Added new tab with the current window configuration"))))
 
 
@@ -395,14 +396,14 @@ specified by `tab-bar-close-tab-select'."
   "Create a new named window configuration without having to click a tab."
   (interactive)
   (tab-bar-add-tab)
-  (unless (and (display-graphic-p) tab-bar-mode)
+  (unless tab-bar-mode
     (message "Added new tab with the current window configuration")))
 
 (defun delete-tab ()
   "Delete the current window configuration without clicking a close button."
   (interactive)
   (tab-bar-close-current-tab)
-  (unless (and (display-graphic-p) tab-bar-mode)
+  (unless tab-bar-mode
     (message "Deleted the current tab")))
 
 (defalias 'list-tabs 'tab-bar-list)
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 2122a14..8ade536 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."
 
 (defun tab-line-add-tab (&optional e)
   (interactive "e")
-  ;; Maybe (buffer-menu-open)
-  (mouse-buffer-menu e))
+  (if window-system
+      (mouse-buffer-menu e) ; like (buffer-menu-open)
+    ;; tty menu doesn't support mouse clicks, so use tmm
+    (tmm-prompt (mouse-buffer-menu-keymap))))
 
 (defun tab-line-select-tab (&optional e)
   "Switch to the selected tab.
diff --git a/src/w32term.c b/src/w32term.c
index dc51639..4d230a2 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5097,7 +5097,7 @@ w32_read_socket (struct terminal *terminal,
                    int x = XFIXNAT (inev.x);
                    int y = XFIXNAT (inev.y);
 
-                    window = window_from_coordinates (f, x, y, 0, 1, 0);
+                    window = window_from_coordinates (f, x, y, 0, 1, 1);
 
                     if (EQ (window, f->tab_bar_window))
                       {
@@ -5122,7 +5122,7 @@ w32_read_socket (struct terminal *terminal,
                    int x = XFIXNAT (inev.x);
                    int y = XFIXNAT (inev.y);
 
-                    window = window_from_coordinates (f, x, y, 0, 1, 0);
+                    window = window_from_coordinates (f, x, y, 0, 1, 1);
 
                     if (EQ (window, f->tool_bar_window))
                       {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]