Rearrange Android splash screen messages

* 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.
This commit is contained in:
Po Lu 2024-03-05 11:23:27 +08:00
parent b06916cb21
commit 1a35eb86b8
3 changed files with 19 additions and 18 deletions

View 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.

View 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))))

View 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;
}