1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Update Android port

* lisp/touch-screen.el (touch-screen-handle-point-up) <held>:
Treat `held' as `drag' as well.

* src/android.c (android_is_special_directory): Return bool
rather than a pointer to the remainder of the file name, given
that said pointer is never used.

* src/android.h (android_is_special_directory): Modify
correspondingly.
This commit is contained in:
Po Lu 2023-09-02 09:28:50 +08:00
parent 0346bf419a
commit dc1ed3dbfa
3 changed files with 22 additions and 30 deletions

View file

@ -1034,9 +1034,9 @@ If the fourth element of `touch-screen-current-tool' is
original position of the tool to display its bound keymap as a original position of the tool to display its bound keymap as a
menu. menu.
If the fourth element of `touch-screen-current-tool' is `drag', If the fourth element of `touch-screen-current-tool' is `drag' or
the region is active, and the tool's initial window's selected `held', the region is active, and the tool's initial window's
buffer isn't read-only, display the on screen keyboard. selected buffer isn't read-only, display the on screen keyboard.
If the command being executed is listed in If the command being executed is listed in
`touch-screen-set-point-commands' also display the on-screen `touch-screen-set-point-commands' also display the on-screen
@ -1159,7 +1159,10 @@ is not read-only."
(throw 'input-event (throw 'input-event
(list 'down-mouse-1 (list 'down-mouse-1
(nth 4 touch-screen-current-tool)))) (nth 4 touch-screen-current-tool))))
((eq what 'drag) ((or (eq what 'drag)
;; Merely initiating a drag is sufficient to select a
;; word if word selection is enabled.
(eq what 'held))
;; Display the on screen keyboard if the region is now ;; Display the on screen keyboard if the region is now
;; active. Check this within the window where the tool was ;; active. Check this within the window where the tool was
;; first place. ;; first place.

View file

@ -833,22 +833,18 @@ android_user_full_name (struct passwd *pw)
return (char *) "Android user"; return (char *) "Android user";
return pw->pw_gecos; return pw->pw_gecos;
#else #else /* !HAVE_STRUCT_PASSWD_PW_GECOS */
return "Android user"; return "Android user";
#endif #endif /* HAVE_STRUCT_PASSWD_PW_GECOS */
} }
/* Determine whether or not the specified file NAME describes a file /* Return whether or not the specified file NAME designates a file in
in the directory DIR, which should be an absolute file name. NAME the directory DIR, which should be an absolute file name. NAME
must be in canonical form. must be in canonical form. */
Value is NULL if not. Otherwise, it is a pointer to the first bool
character in NAME after the part containing DIR and its trailing
directory separator. */
const char *
android_is_special_directory (const char *name, const char *dir) android_is_special_directory (const char *name, const char *dir)
{ {
size_t len; size_t len;
@ -857,7 +853,7 @@ android_is_special_directory (const char *name, const char *dir)
len = strlen (dir); len = strlen (dir);
if (strncmp (name, dir, len)) if (strncmp (name, dir, len))
return NULL; return false;
/* Now see if the character of NAME after len is either a directory /* Now see if the character of NAME after len is either a directory
separator or a terminating NULL. */ separator or a terminating NULL. */
@ -865,20 +861,13 @@ android_is_special_directory (const char *name, const char *dir)
name += len; name += len;
switch (*name) switch (*name)
{ {
case '\0': case '\0': /* NAME is an exact match for DIR. */
/* Return the empty string if this is the end of the file case '/': /* NAME is a constituent of DIR. */
name. */ return true;
return name;
case '/':
/* Return NAME (with the separator removed) if it describes a
file. */
return name + 1;
default:
/* The file name doesn't match. */
return NULL;
} }
/* The file name doesn't match. */
return false;
} }
#if 0 #if 0

View file

@ -54,7 +54,7 @@ extern char *android_user_full_name (struct passwd *);
/* File I/O operations. Many of these are defined in /* File I/O operations. Many of these are defined in
androidvfs.c. */ androidvfs.c. */
extern const char *android_is_special_directory (const char *, const char *); extern bool android_is_special_directory (const char *, const char *);
extern const char *android_get_home_directory (void); extern const char *android_get_home_directory (void);
extern void android_vfs_init (JNIEnv *, jobject); extern void android_vfs_init (JNIEnv *, jobject);
@ -238,7 +238,7 @@ extern int android_rewrite_spawn_argv (const char ***);
/* Define a substitute for use during Emacs compilation. */ /* Define a substitute for use during Emacs compilation. */
#define android_is_special_directory(name, dir) ((const char *) NULL) #define android_is_special_directory(name, dir) (false)
#endif /* !ANDROID_STUBIFY */ #endif /* !ANDROID_STUBIFY */