1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 23:10:47 -08:00

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.
This commit is contained in:
Po Lu 2023-12-06 10:34:41 +08:00
parent dc744fe6f3
commit d8a0087930
5 changed files with 10 additions and 5 deletions

View file

@ -1285,6 +1285,8 @@ the trail buffer."
(setq calc-trail-buffer nil) (setq calc-trail-buffer nil)
t)))) t))))
(defvar touch-screen-display-keyboard)
(defun calc-mode () (defun calc-mode ()
"Calculator major mode. "Calculator major mode.

View file

@ -298,12 +298,9 @@
(if (featurep 'dynamic-setting) (if (featurep 'dynamic-setting)
(load "dynamic-setting")) (load "dynamic-setting"))
;; touch-screen.el is tiny and is used liberally throughout the button
;; code etc, so it may as well be preloaded everywhere.
(load "touch-screen")
(if (featurep 'x) (if (featurep 'x)
(progn (progn
(load "touch-screen")
(load "x-dnd") (load "x-dnd")
(load "term/common-win") (load "term/common-win")
(load "term/x-win"))) (load "term/x-win")))
@ -316,6 +313,7 @@
(if (featurep 'android) (if (featurep 'android)
(progn (progn
(load "ls-lisp") (load "ls-lisp")
(load "touch-screen")
(load "term/common-win") (load "term/common-win")
(load "term/android-win"))) (load "term/android-win")))

View file

@ -975,7 +975,7 @@ Intended to be called via `clear-message-function'."
;; progress, because a preview message might currently be displayed ;; progress, because a preview message might currently be displayed
;; in the echo area. FIXME: find some way to place this in ;; in the echo area. FIXME: find some way to place this in
;; touch-screen.el. ;; touch-screen.el.
(if (and touch-screen-preview-select (if (and (bound-and-true-p touch-screen-preview-select)
(eq (nth 3 touch-screen-current-tool) 'drag)) (eq (nth 3 touch-screen-current-tool) 'drag))
'dont-clear-message 'dont-clear-message
;; Return nil telling the caller that the message ;; Return nil telling the caller that the message

View file

@ -1085,6 +1085,8 @@ underlying shell."
(setq term-ansi-current-invisible nil) (setq term-ansi-current-invisible nil)
(setq term-ansi-current-bg-color 0)) (setq term-ansi-current-bg-color 0))
(defvar touch-screen-display-keyboard)
(define-derived-mode term-mode fundamental-mode "Term" (define-derived-mode term-mode fundamental-mode "Term"
"Major mode for interacting with an inferior interpreter. "Major mode for interacting with an inferior interpreter.
The interpreter name is same as buffer name, sans the asterisks. The interpreter name is same as buffer name, sans the asterisks.

View file

@ -1913,6 +1913,7 @@ if POSN is on a link or a button, or `mouse-1' otherwise."
;; Exports. These functions are intended for use externally. ;; Exports. These functions are intended for use externally.
;;;###autoload
(defun touch-screen-track-tap (event &optional update data threshold) (defun touch-screen-track-tap (event &optional update data threshold)
"Track a single tap starting from EVENT. "Track a single tap starting from EVENT.
EVENT should be a `touchscreen-begin' event. EVENT should be a `touchscreen-begin' event.
@ -1970,6 +1971,7 @@ otherwise, return t once the `touchscreen-end' event arrives."
(eq (caadr event) (caadr new-event)))) (eq (caadr event) (caadr new-event))))
(t (throw 'finish nil)))))))) (t (throw 'finish nil))))))))
;;;###autoload
(defun touch-screen-track-drag (event update &optional data) (defun touch-screen-track-drag (event update &optional data)
"Track a single drag starting from EVENT. "Track a single drag starting from EVENT.
EVENT should be a `touchscreen-begin' event. EVENT should be a `touchscreen-begin' event.
@ -2017,6 +2019,7 @@ touch point in EVENT did not move significantly, and t otherwise."
;;; Event handling exports. These functions are intended for use by ;;; Event handling exports. These functions are intended for use by
;;; Lisp commands bound to touch screen gesture events. ;;; Lisp commands bound to touch screen gesture events.
;;;###autoload
(defun touch-screen-inhibit-drag () (defun touch-screen-inhibit-drag ()
"Inhibit subsequent `touchscreen-drag' events from being sent. "Inhibit subsequent `touchscreen-drag' events from being sent.
Prevent `touchscreen-drag' and translated mouse events from being Prevent `touchscreen-drag' and translated mouse events from being