Correct ommissions in rmc.el
authorPo Lu <luangruo@yahoo.com>
Fri, 28 Jun 2024 06:43:58 +0000 (14:43 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 28 Jun 2024 06:44:28 +0000 (14:44 +0800)
* lisp/emacs-lisp/rmc.el (touch-screen-scroll)
(touch-screen-pinch): Declare functions.
(read-multiple-choice--short-answers): Call the same functions
directly and prevent the on-screen keyboard from being
deactivated immedately before it is reopened.

lisp/emacs-lisp/rmc.el

index 883f8bf187ff64cae0ce77cf72e50cf22cccf8cc..dab119e8a997dfe6aa8a2b956b836807b364c210 100644 (file)
@@ -179,6 +179,9 @@ Usage example:
     (read-multiple-choice--short-answers
      prompt choices help-string show-help)))
 
+(declare-function touch-screen-scroll "touch-screen.el")
+(declare-function touch-screen-pinch "touch-screen.el")
+
 (defun read-multiple-choice--short-answers (prompt choices help-string show-help)
   (let* ((dialog-p (use-dialog-box-p))
          (prompt-choices
@@ -225,7 +228,11 @@ Usage example:
                 (when (setq command
                             (let ((current-key-remap-sequence
                                    (vector tchar)))
-                              (touch-screen-translate-touch nil)))
+                              ;; Provide an empty prompt to `t-s-t-t' so
+                              ;; that it may not repeatedly display
+                              ;; and/or disable the on-screen keyboard,
+                              ;; or move point.
+                              (touch-screen-translate-touch "")))
                   (setq command (if (> (length command) 0)
                                     (aref command 0)
                                   nil))
@@ -240,9 +247,9 @@ Usage example:
                    ;; Respond to scroll and pinch events as if RMC were
                    ;; not in progress.
                    ((eq (car-safe command) 'touchscreen-scroll)
-                    (funcall #'touch-screen-scroll command))
+                    (touch-screen-scroll command))
                    ((eq (car-safe command) 'touchscreen-pinch)
-                    (funcall #'touch-screen-pinch command))
+                    (touch-screen-pinch command))
                    ;; Prevent other touchscreen-generated events from
                    ;; reaching the default conditional.
                    ((memq (or (and (symbolp command) command)