aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2023-12-06 10:34:41 +0800
committerPo Lu2023-12-06 10:34:41 +0800
commitd8a00879309a3bf62f6ffcae103aa3bdba776ee9 (patch)
treeaca5c7620d0700cc0fc5fdcc9e18ce388ba2c03f
parentdc744fe6f3cd185bd9d29f61b08cd4c524e3969e (diff)
downloademacs-d8a00879309a3bf62f6ffcae103aa3bdba776ee9.tar.gz
emacs-d8a00879309a3bf62f6ffcae103aa3bdba776ee9.zip
Cease preloading touch-screen.el outside X and Android
* lisp/calc/calc.el (touch-screen-display-keyboard): * lisp/minibuffer.el (clear-minibuffer-message): * lisp/term.el (touch-screen-display-keyboard): Declare touch-screen-display-keyboard before binding or setting it. * lisp/loadup.el: Don't autoload touch-screen.el outside X and Android. * lisp/touch-screen.el: Autoload functions called from commands responding to touch screen events.
-rw-r--r--lisp/calc/calc.el2
-rw-r--r--lisp/loadup.el6
-rw-r--r--lisp/minibuffer.el2
-rw-r--r--lisp/term.el2
-rw-r--r--lisp/touch-screen.el3
5 files changed, 10 insertions, 5 deletions
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 41aeb17c252..50623218701 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1285,6 +1285,8 @@ the trail buffer."
1285 (setq calc-trail-buffer nil) 1285 (setq calc-trail-buffer nil)
1286 t)))) 1286 t))))
1287 1287
1288(defvar touch-screen-display-keyboard)
1289
1288(defun calc-mode () 1290(defun calc-mode ()
1289 "Calculator major mode. 1291 "Calculator major mode.
1290 1292
diff --git a/lisp/loadup.el b/lisp/loadup.el
index d447523dc42..ef4203917d4 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -298,12 +298,9 @@
298(if (featurep 'dynamic-setting) 298(if (featurep 'dynamic-setting)
299 (load "dynamic-setting")) 299 (load "dynamic-setting"))
300 300
301;; touch-screen.el is tiny and is used liberally throughout the button
302;; code etc, so it may as well be preloaded everywhere.
303(load "touch-screen")
304
305(if (featurep 'x) 301(if (featurep 'x)
306 (progn 302 (progn
303 (load "touch-screen")
307 (load "x-dnd") 304 (load "x-dnd")
308 (load "term/common-win") 305 (load "term/common-win")
309 (load "term/x-win"))) 306 (load "term/x-win")))
@@ -316,6 +313,7 @@
316(if (featurep 'android) 313(if (featurep 'android)
317 (progn 314 (progn
318 (load "ls-lisp") 315 (load "ls-lisp")
316 (load "touch-screen")
319 (load "term/common-win") 317 (load "term/common-win")
320 (load "term/android-win"))) 318 (load "term/android-win")))
321 319
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 03b64198bcf..2ddaf0af120 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -975,7 +975,7 @@ Intended to be called via `clear-message-function'."
975 ;; progress, because a preview message might currently be displayed 975 ;; progress, because a preview message might currently be displayed
976 ;; in the echo area. FIXME: find some way to place this in 976 ;; in the echo area. FIXME: find some way to place this in
977 ;; touch-screen.el. 977 ;; touch-screen.el.
978 (if (and touch-screen-preview-select 978 (if (and (bound-and-true-p touch-screen-preview-select)
979 (eq (nth 3 touch-screen-current-tool) 'drag)) 979 (eq (nth 3 touch-screen-current-tool) 'drag))
980 'dont-clear-message 980 'dont-clear-message
981 ;; Return nil telling the caller that the message 981 ;; Return nil telling the caller that the message
diff --git a/lisp/term.el b/lisp/term.el
index b2875e4a17f..81746e0c20d 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1085,6 +1085,8 @@ underlying shell."
1085 (setq term-ansi-current-invisible nil) 1085 (setq term-ansi-current-invisible nil)
1086 (setq term-ansi-current-bg-color 0)) 1086 (setq term-ansi-current-bg-color 0))
1087 1087
1088(defvar touch-screen-display-keyboard)
1089
1088(define-derived-mode term-mode fundamental-mode "Term" 1090(define-derived-mode term-mode fundamental-mode "Term"
1089 "Major mode for interacting with an inferior interpreter. 1091 "Major mode for interacting with an inferior interpreter.
1090The interpreter name is same as buffer name, sans the asterisks. 1092The interpreter name is same as buffer name, sans the asterisks.
diff --git a/lisp/touch-screen.el b/lisp/touch-screen.el
index 56adb75cefc..be08ae1d3c8 100644
--- a/lisp/touch-screen.el
+++ b/lisp/touch-screen.el
@@ -1913,6 +1913,7 @@ if POSN is on a link or a button, or `mouse-1' otherwise."
1913 1913
1914;; Exports. These functions are intended for use externally. 1914;; Exports. These functions are intended for use externally.
1915 1915
1916;;;###autoload
1916(defun touch-screen-track-tap (event &optional update data threshold) 1917(defun touch-screen-track-tap (event &optional update data threshold)
1917 "Track a single tap starting from EVENT. 1918 "Track a single tap starting from EVENT.
1918EVENT should be a `touchscreen-begin' event. 1919EVENT should be a `touchscreen-begin' event.
@@ -1970,6 +1971,7 @@ otherwise, return t once the `touchscreen-end' event arrives."
1970 (eq (caadr event) (caadr new-event)))) 1971 (eq (caadr event) (caadr new-event))))
1971 (t (throw 'finish nil)))))))) 1972 (t (throw 'finish nil))))))))
1972 1973
1974;;;###autoload
1973(defun touch-screen-track-drag (event update &optional data) 1975(defun touch-screen-track-drag (event update &optional data)
1974 "Track a single drag starting from EVENT. 1976 "Track a single drag starting from EVENT.
1975EVENT should be a `touchscreen-begin' event. 1977EVENT should be a `touchscreen-begin' event.
@@ -2017,6 +2019,7 @@ touch point in EVENT did not move significantly, and t otherwise."
2017;;; Event handling exports. These functions are intended for use by 2019;;; Event handling exports. These functions are intended for use by
2018;;; Lisp commands bound to touch screen gesture events. 2020;;; Lisp commands bound to touch screen gesture events.
2019 2021
2022;;;###autoload
2020(defun touch-screen-inhibit-drag () 2023(defun touch-screen-inhibit-drag ()
2021 "Inhibit subsequent `touchscreen-drag' events from being sent. 2024 "Inhibit subsequent `touchscreen-drag' events from being sent.
2022Prevent `touchscreen-drag' and translated mouse events from being 2025Prevent `touchscreen-drag' and translated mouse events from being