[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 9cf1fc49e8c: * lisp/tab-line.el: Move Touch screen support sectio
From: |
Juri Linkov |
Subject: |
master 9cf1fc49e8c: * lisp/tab-line.el: Move Touch screen support section to the better place. |
Date: |
Thu, 28 Sep 2023 13:14:05 -0400 (EDT) |
branch: master
commit 9cf1fc49e8c5974815796f5e1f4633c845aef3fe
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
* lisp/tab-line.el: Move Touch screen support section to the better place.
---
lisp/tab-line.el | 81 +++++++++++++++++++++++++++-----------------------------
1 file changed, 39 insertions(+), 42 deletions(-)
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index d3b9720d729..4637dafcd90 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -362,48 +362,6 @@ or by `tab-line-tabs-buffer-groups'."
"Function to return a global list of buffers.
Used only for `tab-line-tabs-mode-buffers' and `tab-line-tabs-buffer-groups'.")
-
-
-;;; Touch screen support.
-
-(defun tab-line-track-tap (event &optional function)
- "Track a tap starting from EVENT.
-If EVENT is not a `touchscreen-begin' event, return t.
-Otherwise, return t if the tap completes successfully, and nil if
-the tap should be ignored.
-
-If FUNCTION is specified and the tap does not complete within
-`touch-screen-delay' seconds, display the appropriate context
-menu by calling FUNCTION with EVENT, and return nil."
- (if (not (eq (car-safe event) 'touchscreen-begin))
- t
- (let ((result (catch 'context-menu
- (let (timer)
- (unwind-protect
- (progn
- (when function
- (setq timer
- (run-at-time touch-screen-delay t
- #'throw 'context-menu
- 'context-menu)))
- (touch-screen-track-tap event))
- (when timer
- (cancel-timer timer)))))))
- (cond ((eq result 'context-menu)
- (prog1 nil
- (funcall function event)))
- (result t)))))
-
-(defun tab-line-event-start (event)
- "Like `event-start'.
-However, return the correct mouse position list if EVENT is a
-`touchscreen-begin' event."
- (or (and (eq (car-safe event) 'touchscreen-begin)
- (cdadr event))
- (event-start event)))
-
-
-
(defun tab-line-tabs-buffer-list ()
(seq-filter (lambda (b) (and (buffer-live-p b)
(/= (aref (buffer-name b) 0) ?\s)))
@@ -998,6 +956,45 @@ sight of the tab line."
(popup-menu menu event)))
+;;; Touch screen support.
+
+(defun tab-line-track-tap (event &optional function)
+ "Track a tap starting from EVENT.
+If EVENT is not a `touchscreen-begin' event, return t.
+Otherwise, return t if the tap completes successfully, and nil if
+the tap should be ignored.
+
+If FUNCTION is specified and the tap does not complete within
+`touch-screen-delay' seconds, display the appropriate context
+menu by calling FUNCTION with EVENT, and return nil."
+ (if (not (eq (car-safe event) 'touchscreen-begin))
+ t
+ (let ((result (catch 'context-menu
+ (let (timer)
+ (unwind-protect
+ (progn
+ (when function
+ (setq timer
+ (run-at-time touch-screen-delay t
+ #'throw 'context-menu
+ 'context-menu)))
+ (touch-screen-track-tap event))
+ (when timer
+ (cancel-timer timer)))))))
+ (cond ((eq result 'context-menu)
+ (prog1 nil
+ (funcall function event)))
+ (result t)))))
+
+(defun tab-line-event-start (event)
+ "Like `event-start'.
+However, return the correct mouse position list if EVENT is a
+`touchscreen-begin' event."
+ (or (and (eq (car-safe event) 'touchscreen-begin)
+ (cdadr event))
+ (event-start event)))
+
+
;;;###autoload
(define-minor-mode tab-line-mode
"Toggle display of tab line in the windows displaying the current buffer."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 9cf1fc49e8c: * lisp/tab-line.el: Move Touch screen support section to the better place.,
Juri Linkov <=