]> git.eshelyaron.com Git - emacs.git/commitdiff
Rearrange Android splash screen messages
authorPo Lu <luangruo@yahoo.com>
Tue, 5 Mar 2024 03:23:27 +0000 (11:23 +0800)
committerEshel Yaron <me@eshelyaron.com>
Tue, 5 Mar 2024 15:34:42 +0000 (16:34 +0100)
* lisp/startup.el (fancy-startup-tail, fancy-startup-screen)
(normal-splash-screen): Adjust for function renaming; move the
storage permissions notice to the top of the splash screen.

* lisp/term/android-win.el (android-after-splash-screen): Rename
from android-before-splash-screen and adjust layout lightly.

* src/android.c (android_wc_lookup_string): Terminate character
composition after a character is returned, whether it contain a
Unicode character or not.

(cherry picked from commit 1a35eb86b8cb75ce390525dd3394a52376b622a6)

lisp/startup.el
lisp/term/android-win.el
src/android.c

index 33e1124b9982eca32988c3d3db31287ab4562d1d..357a4154e4c870ab5cae4b99dd19ba6b09ffa71d 100644 (file)
@@ -2040,10 +2040,6 @@ a face or button specification."
                                           (call-interactively
                                            'recover-session)))
                                " to recover the files you were editing."))))
-  ;; Insert the permissions notice if the user has yet to grant Emacs
-  ;; storage permissions.
-  (when (fboundp 'android-after-splash-screen)
-    (funcall 'android-after-splash-screen t))
   (when concise
     (fancy-splash-insert
      :face 'variable-pitch "\n"
@@ -2096,6 +2092,10 @@ splash screen in another window."
        (make-local-variable 'startup-screen-inhibit-startup-screen)
        (if pure-space-overflow
            (insert pure-space-overflow-message))
+        ;; Insert the permissions notice if the user has yet to grant Emacs
+        ;; storage permissions.
+        (when (fboundp 'android-before-splash-screen)
+          (funcall 'android-before-splash-screen t))
        (unless concise
          (fancy-splash-head))
        (dolist (text fancy-startup-text)
@@ -2202,7 +2202,10 @@ splash screen in another window."
 
       (if pure-space-overflow
          (insert pure-space-overflow-message))
-
+      ;; Insert the permissions notice if the user has yet to grant
+      ;; Emacs storage permissions.
+      (when (fboundp 'android-before-splash-screen)
+        (funcall 'android-before-splash-screen nil))
       ;; The convention for this piece of code is that
       ;; each piece of output starts with one or two newlines
       ;; and does not end with any newlines.
@@ -2244,12 +2247,6 @@ splash screen in another window."
           (insert "\n\nIf an Emacs session crashed recently, "
                   "type M-x recover-session RET\nto recover"
                   " the files you were editing.\n"))
-
-      ;; Insert the permissions notice if the user has yet to grant
-      ;; Emacs storage permissions.
-      (when (fboundp 'android-after-splash-screen)
-        (funcall 'android-after-splash-screen nil))
-
       (use-local-map splash-screen-keymap)
 
       ;; Display the input that we set up in the buffer.
index b7b0920626e33f3fa785420e5c56484153b79de9..1d10402b15dca2477aae40b5f706fb2e8fa7c81f 100644 (file)
@@ -398,7 +398,7 @@ directory /content/storage.
                 (inhibit-read-only t))
             (fill-region (point-min) (point-max))))))))
 
-(defun android-after-splash-screen (fancy-p)
+(defun android-before-splash-screen (fancy-p)
   "Insert a brief notice on the absence of storage permissions.
 If storage permissions are as yet denied to Emacs, insert a short
 notice to that effect, followed by a button that enables the user
@@ -412,14 +412,14 @@ screen display; see `fancy-splash-insert'."
         (fancy-splash-insert
          :face '(variable-pitch
                  font-lock-function-call-face)
-         "\nPermissions necessary to access external storage directories have
-been denied.  Click "
+         "Permissions necessary to access external storage directories have"
+         "\nbeen denied.  Click "
          :link '("here" android-display-storage-permission-popup)
-         " to grant them.")
+         " to grant them.\n")
       (insert
-       "\nPermissions necessary to access external storage directories have been
-denied.  ")
-      (insert-button "Click here to grant them."
+       "Permissions necessary to access external storage directories"
+       "\nhave been denied.  ")
+      (insert-button "Click here to grant them.\n"
                      'action #'android-display-storage-permission-popup
                      'follow-link t)
       (newline))))
index eb6981093be6d191f0d86772f51a85850080946e..5b3fbb25373f63164c85bf746a2297625b3d432c 100644 (file)
@@ -5533,6 +5533,10 @@ android_wc_lookup_string (android_key_pressed_event *event,
          rc = 0;
        }
 
+      /* Terminate any ongoing character composition after a key is
+        registered.  */
+      if (compose_status)
+       compose_status->chars_matched = 0;
       *status_return = status;
       return rc;
     }