commit 9fb00904f959a7e94cf992acb3a96e78a05e719c (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Mon Aug 14 13:15:08 2023 +0800 Improve efficiency of checking for access to authority documents * java/org/gnu/emacs/EmacsService.java (checkContentUri): Take a string instead of a byte array. Then, use checkCallingUriPermission, in lieu of opening the file. * src/android.c (android_check_content_access): Delete unused function. (android_init_emacs_service): Adjust for changes to checkContentUri's signature. * src/androidvfs.c (android_get_content_name): Return the file name in a new buffer. (android_check_content_access): Adjust correspondingly. (android_authority_name): Verify NAME is a valid JNI string. diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index cee823abc83..19ce67c59b7 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java @@ -960,44 +960,30 @@ invocation of app_process (through android-emacs) can } } + /* Return whether Emacs is directly permitted to access the + content:// URI NAME. This is not a suitable test for files which + Emacs can access by virtue of their containing document + trees. */ + public boolean - checkContentUri (byte[] string, boolean readable, boolean writable) + checkContentUri (String name, boolean readable, boolean writable) { - String mode, name; + String mode; ParcelFileDescriptor fd; + Uri uri; + int rc, flags; - /* Decode this into a URI. */ - - try - { - /* The usual file name encoding question rears its ugly head - again. */ - name = new String (string, "UTF-8"); - } - catch (UnsupportedEncodingException exception) - { - name = null; - throw new RuntimeException (exception); - } + uri = Uri.parse (name); + flags = 0; - mode = "r"; + if (readable) + flags |= Intent.FLAG_GRANT_READ_URI_PERMISSION; if (writable) - mode += "w"; - - try - { - fd = resolver.openFileDescriptor (Uri.parse (name), mode); - fd.close (); + flags |= Intent.FLAG_GRANT_WRITE_URI_PERMISSION; - return true; - } - catch (Exception exception) - { - /* Fall through. */ - } - - return false; + rc = checkCallingUriPermission (uri, flags); + return rc == PackageManager.PERMISSION_GRANTED; } /* Build a content file name for URI. diff --git a/src/android.c b/src/android.c index 70779f8ccae..ed304baf0e6 100644 --- a/src/android.c +++ b/src/android.c @@ -1107,41 +1107,6 @@ android_get_content_name (const char *filename) return NULL; } -/* Return whether or not the specified FILENAME is an accessible - content URI. MODE specifies what to check. */ - -static bool -android_check_content_access (const char *filename, int mode) -{ - const char *name; - jobject string; - size_t length; - jboolean rc; - - name = android_get_content_name (filename); - length = strlen (name); - - string = (*android_java_env)->NewByteArray (android_java_env, - length); - android_exception_check (); - - (*android_java_env)->SetByteArrayRegion (android_java_env, - string, 0, length, - (jbyte *) name); - rc = (*android_java_env)->CallBooleanMethod (android_java_env, - emacs_service, - service_class.check_content_uri, - string, - (jboolean) ((mode & R_OK) - != 0), - (jboolean) ((mode & W_OK) - != 0)); - android_exception_check_1 (string); - ANDROID_DELETE_LOCAL_REF (string); - - return rc; -} - #endif /* 0 */ /* Return the current user's ``home'' directory, which is actually the @@ -1549,7 +1514,7 @@ #define FIND_METHOD(c_name, name, signature) \ FIND_METHOD (open_content_uri, "openContentUri", "([BZZZ)I"); FIND_METHOD (check_content_uri, "checkContentUri", - "([BZZ)Z"); + "(Ljava/lang/String;ZZ)Z"); FIND_METHOD (query_battery, "queryBattery", "()[J"); FIND_METHOD (update_extracted_text, "updateExtractedText", "(Lorg/gnu/emacs/EmacsWindow;" diff --git a/src/androidvfs.c b/src/androidvfs.c index 0385e7348c6..1b82753be3d 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -2765,14 +2765,13 @@ android_content_initial (char *name, size_t length) /* Return the content URI corresponding to a `/content/by-authority' file name, or NULL if it is invalid for some reason. FILENAME should be relative to /content/by-authority, with no leading - directory separator character. + directory separator character. */ - This function is not reentrant. */ - -static const char * +static char * android_get_content_name (const char *filename) { - static char buffer[PATH_MAX + 1], *fill; + char *fill, *buffer; + size_t length; /* Make sure FILENAME isn't obviously invalid: it must contain an authority name and a file name component. */ @@ -2784,48 +2783,53 @@ android_get_content_name (const char *filename) return NULL; } - /* FILENAME must also not be a directory. */ + /* FILENAME must also not be a directory. Accessing content + provider directories is not supported by this interface. */ - if (filename[strlen (filename)] == '/') + length = strlen (filename); + if (filename[length] == '/') { errno = ENOTDIR; return NULL; } - snprintf (buffer, PATH_MAX + 1, "content://%s", filename); + /* Prefix FILENAME with content:// and return the buffer containing + that URI. */ + + buffer = xmalloc (sizeof "content://" + length); + sprintf (buffer, "content://%s", filename); return buffer; } /* Return whether or not the specified URI is an accessible content - URI. MODE specifies what to check. */ + URI. MODE specifies what to check. + + URI must be a string in the JVM's extended UTF-8 format. */ static bool android_check_content_access (const char *uri, int mode) { jobject string; size_t length; - jboolean rc; + jboolean rc, read, write; length = strlen (uri); - string = (*android_java_env)->NewByteArray (android_java_env, - length); + string = (*android_java_env)->NewStringUTF (android_java_env, uri); android_exception_check (); - (*android_java_env)->SetByteArrayRegion (android_java_env, - string, 0, length, - (jbyte *) uri); + /* Establish what is being checked. Checking for read access is + identical to checking if the file exists. */ + + read = (bool) (mode & R_OK || (mode == F_OK)); + write = (bool) (mode & W_OK); + rc = (*android_java_env)->CallBooleanMethod (android_java_env, emacs_service, service_class.check_content_uri, - string, - (jboolean) ((mode & R_OK) - != 0), - (jboolean) ((mode & W_OK) - != 0)); + string, read, write); android_exception_check_1 (string); ANDROID_DELETE_LOCAL_REF (string); - return rc; } @@ -2889,7 +2893,7 @@ android_authority_name (struct android_vnode *vnode, char *name, size_t length) { struct android_authority_vnode *vp; - const char *uri_name; + char *uri_name; if (!android_init_gui) { @@ -2922,6 +2926,12 @@ android_authority_name (struct android_vnode *vnode, char *name, if (*name == '/') name++, length -= 1; + /* NAME must be a valid JNI string, so that it can be encoded + properly. */ + + if (android_verify_jni_string (name)) + goto no_entry; + uri_name = android_get_content_name (name); if (!uri_name) goto error; @@ -2931,11 +2941,12 @@ android_authority_name (struct android_vnode *vnode, char *name, vp->vnode.ops = &authority_vfs_ops; vp->vnode.type = ANDROID_VNODE_CONTENT_AUTHORITY; vp->vnode.flags = 0; - vp->uri = xstrdup (uri_name); + vp->uri = uri_name; return &vp->vnode; } /* Content files can't have children. */ + no_entry: errno = ENOENT; error: return NULL; commit 3895f882337ade7744cf7964d9bab5d79d4aa059 Author: Po Lu Date: Mon Aug 14 09:16:24 2023 +0800 Remove workarounds for lib/boot-time.o failures * configure.ac (UTMP_H_DEFINES_BOOT_TIME): * src/conf_post.h [__ANDROID__]: Delete workarounds, now that Gnulib has been corrected. diff --git a/configure.ac b/configure.ac index 46836073aa0..46347a12050 100644 --- a/configure.ac +++ b/configure.ac @@ -2710,27 +2710,8 @@ AC_DEFUN # Check for some functions not always present in the NDK. AC_CHECK_DECLS([android_get_device_api_level]) - AC_CHECK_DECLS([endutent, sysinfo], [], [], - [[ -#include -#include -]]) - - # Establish if BOOT_TIME is defined in utmp.h. - AC_CACHE_CHECK([if utmp.h defines BOOT_TIME], - [emacs_cv_utmp_h_defines_boot_time], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#ifndef BOOT_TIME -BOOT_TIME not defined -#endif /* BOOT_TIME */ -]], [[]])], [emacs_cv_utmp_h_defines_boot_time=yes], - [emacs_cv_utmp_h_defines_boot_time=no])]) - AS_IF([test x"$emacs_cv_utmp_h_defines_boot_time" = xyes], - [AC_DEFINE([UTMP_H_DEFINES_BOOT_TIME], [1], - [Define to 1 if building for Android and utmp.h declares BOOT_TIME])]) - - # Say this build is really for Android. + + # Mention this build is really for Android. REALLY_ANDROID=yes])]) AC_SUBST([ANDROID]) diff --git a/src/conf_post.h b/src/conf_post.h index 5f18e5ae4bb..f31e012dc6e 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -471,37 +471,3 @@ #define VFORK() vfork () #undef MB_CUR_MAX #define MB_CUR_MAX REPLACEMENT_MB_CUR_MAX #endif /* REPLACEMENT_MB_CUR_MAX */ - -#ifdef __ANDROID__ - -/* The Android NDK r10b omits the function `endutent' that is actually - defined in the C library and used by Gnulib. Define a prototype - for it here. */ - -#if !HAVE_DECL_ENDUTENT -extern void endutent (void); -#endif /* !HAVE_DECL_ENDUTENT */ - -/* Now define substitutes for BOOT_TIME if necessary. */ - -#ifndef UTMP_H_DEFINES_BOOT_TIME -#include - -#define BOOT_TIME 2 -#endif /* !UTMP_H_DEFINES_BOOT_TIME */ - -/* sysinfo is also absent from some versions of the NDK, yet is - present on API level 9 and above. */ - -#if !HAVE_DECL_SYSINFO -#include - -#if __ANDROID_API__ >= 9 -extern int sysinfo (struct sysinfo *info); -#else /* __ANDROID_API__ < 8 */ -/* Gnulib uses this function unconditionally. */ -#define sysinfo(ignored) ((void) ignored, (errno = ENOSYS), -1) -#endif /* __ANDROID_API >= 9 */ -#endif /* !HAVE_DECL_SYSINFO */ - -#endif /* __ANDROID__ */ commit 0e390f54fa61a5a8c9481a862803d0de78815d6a Author: Po Lu Date: Mon Aug 14 09:15:51 2023 +0800 ; Update from Gnulib * lib/boot-time-aux.h (get_linux_uptime): * lib/boot-time.c (UT_USER): * lib/nproc.c (num_processors_ignoring_omp): * lib/readutmp.h (WTMP_FILE): * m4/readutmp.m4 (gl_READUTMP): * m4/stdint.m4: Update from Gnulib. diff --git a/lib/boot-time-aux.h b/lib/boot-time-aux.h index 348611fc85c..e59a0fd03c7 100644 --- a/lib/boot-time-aux.h +++ b/lib/boot-time-aux.h @@ -65,6 +65,7 @@ get_linux_uptime (struct timespec *p_uptime) } # endif +# if HAVE_DECL_SYSINFO /* not available in Android API < 9 */ /* The sysinfo call returns the uptime with a resolution of 1 sec only. */ struct sysinfo info; if (sysinfo (&info) >= 0) @@ -73,6 +74,7 @@ get_linux_uptime (struct timespec *p_uptime) p_uptime->tv_nsec = 0; return 0; } +# endif return -1; } diff --git a/lib/boot-time.c b/lib/boot-time.c index d813bfa5825..fe5b5b88c8e 100644 --- a/lib/boot-time.c +++ b/lib/boot-time.c @@ -32,7 +32,7 @@ # include #endif -#if HAVE_SYS_SYSCTL_H && !defined __minix +#if HAVE_SYS_SYSCTL_H && !(defined __GLIBC__ && defined __linux__) && !defined __minix # if HAVE_SYS_PARAM_H # include # endif @@ -65,8 +65,10 @@ # define UT_USER(UT) ((UT)->ut_user) #endif -#if !HAVE_UTMPX_H && HAVE_UTMP_H && defined UTMP_NAME_FUNCTION && !HAVE_DECL_GETUTENT -struct utmp *getutent (void); +#if !HAVE_UTMPX_H && HAVE_UTMP_H && defined UTMP_NAME_FUNCTION +# if !HAVE_DECL_ENDUTENT /* Android */ +void endutent (void); +# endif #endif #if defined __linux__ || HAVE_UTMPX_H || HAVE_UTMP_H || defined __CYGWIN__ || defined _WIN32 diff --git a/lib/nproc.c b/lib/nproc.c index 2740c458c11..e3de1873a96 100644 --- a/lib/nproc.c +++ b/lib/nproc.c @@ -46,7 +46,7 @@ # include #endif -#if HAVE_SYS_SYSCTL_H && ! defined __GLIBC__ +#if HAVE_SYS_SYSCTL_H && !(defined __GLIBC__ && defined __linux__) # include #endif @@ -306,7 +306,7 @@ num_processors_ignoring_omp (enum nproc_query query) /* Finally, as fallback, use the APIs that don't distinguish between NPROC_CURRENT and NPROC_ALL. */ -#if HAVE_SYSCTL && ! defined __GLIBC__ && defined HW_NCPU +#if HAVE_SYSCTL && !(defined __GLIBC__ && defined __linux__) && defined HW_NCPU { /* This works on macOS, FreeBSD, NetBSD, OpenBSD. macOS 10.14 does not allow mib to be const. */ int nprocs; diff --git a/lib/readutmp.h b/lib/readutmp.h index 1cf588d265b..f7cad36d445 100644 --- a/lib/readutmp.h +++ b/lib/readutmp.h @@ -249,6 +249,13 @@ #define HAVE_STRUCT_XTMP_UT_HOST \ # define WTMP_FILE "/etc/wtmp" #endif +/* In early versions of Android, did not define BOOT_TIME, only + USER_PROCESS. We need to use the value that is defined in newer versions + of Android. */ +#if defined __ANDROID__ && !defined BOOT_TIME +# define BOOT_TIME 2 +#endif + /* Some platforms, such as OpenBSD, don't have an ut_type field and don't have the BOOT_TIME and USER_PROCESS macros. But we want to support them in 'struct gl_utmp'. */ diff --git a/m4/readutmp.m4 b/m4/readutmp.m4 index fff8d4eb7bf..0a47f4bb77d 100644 --- a/m4/readutmp.m4 +++ b/m4/readutmp.m4 @@ -1,4 +1,4 @@ -# readutmp.m4 serial 28 +# readutmp.m4 serial 30 dnl Copyright (C) 2002-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -55,7 +55,7 @@ AC_DEFUN_ONCE if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then dnl Prerequisites of lib/readutmp.h and lib/readutmp.c. AC_CHECK_FUNCS_ONCE([utmpname utmpxname]) - AC_CHECK_DECLS([getutent],,,[[ + AC_CHECK_DECLS([endutent],,,[[ /* is a prerequisite of on FreeBSD 8.0, OpenBSD 4.6. */ #include #ifdef HAVE_UTMP_H @@ -103,6 +103,10 @@ AC_DEFUN_ONCE AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes]) fi + AC_CHECK_DECLS([sysinfo],,,[[ + #include + ]]) + AC_CHECK_HEADERS_ONCE([sys/param.h]) dnl requires on OpenBSD 4.0. AC_CHECK_HEADERS([sys/sysctl.h],,, diff --git a/m4/stdint.m4 b/m4/stdint.m4 index d6961b0993e..b9f764d4c1c 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 61 +# stdint.m4 serial 62 dnl Copyright (C) 2001-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -150,7 +150,10 @@ AC_DEFUN_ONCE uintmax_t j = UINTMAX_MAX; /* Check that SIZE_MAX has the correct type, if possible. */ -#if 201112 <= __STDC_VERSION__ +/* ISO C 11 mandates _Generic, but GCC versions < 4.9 lack it. */ +#if 201112 <= __STDC_VERSION__ \ + && (!defined __GNUC__ || 4 < __GNUC__ + (9 <= __GNUC_MINOR__) \ + || defined __clang__) int k = _Generic (SIZE_MAX, size_t: 0); #elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ || (0x5110 <= __SUNPRO_C && !__STDC__)) commit 6412ba2f1ad93bf641b86ba7633beb4f6dda89ea Author: Stefan Kangas Date: Mon Aug 14 01:59:10 2023 +0200 ; Delete commented out variable in png_load_body * src/image.c (png_load_body): Delete commented out variable. diff --git a/src/image.c b/src/image.c index 7849675b6cc..f2079fab6a3 100644 --- a/src/image.c +++ b/src/image.c @@ -8212,7 +8212,6 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) simple transparency, we prefer a clipping mask. */ if (!transparent_p) { - /* png_color_16 *image_bg; */ Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL); Emacs_Color color; commit 4ff5bb34158b7ddc8a3a1a4403157df3debb7d8b Author: Stefan Monnier Date: Sun Aug 13 15:23:26 2023 -0400 * etc/NEWS (cl-print-ellipsis): Mention `backtrace-ellipsis` diff --git a/etc/NEWS b/etc/NEWS index 0388cca97aa..57f04609679 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -134,8 +134,12 @@ transform function 'project-uniquify-dirname-transform'. The code that allowed "..." to be expanded in the "*Backtrace*" buffer should now work anywhere the data is generated by 'cl-print'. +*** The 'backtrace-ellipsis' button is replaced by 'cl-print-ellipsis'. + *** hash-tables' contents can be expanded via the ellipsis. +*** Modes can control the expansion via 'cl-print-expand-ellipsis-function'. + ** Modeline elements can now be right-aligned. Anything following the symbol 'mode-line-format-right-align' in 'mode-line-format' will be right-aligned. Exactly where it is commit bb9133f09dafb069cafe2bea72452bd34b3d6dd2 Author: Stefan Monnier Date: Sun Aug 13 15:21:34 2023 -0400 * lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit): Inhibit interaction diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index be9f013ebcf..cd4b9c5a2b3 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1540,7 +1540,9 @@ ert-run-tests-batch-and-exit (or noninteractive (user-error "This function is only for use in batch mode")) (let ((eln-dir (and (featurep 'native-compile) - (make-temp-file "test-nativecomp-cache-" t)))) + (make-temp-file "test-nativecomp-cache-" t))) + ;; Don't ever wait for user input. + (inhibit-interaction t)) (when eln-dir (startup-redirect-eln-cache eln-dir)) ;; Better crash loudly than attempting to recover from undefined commit 14cd2a058e56d63bab08190826559521083a7d05 Author: LdBeth Date: Sun Aug 13 18:31:47 2023 +0200 Fix auth-source-macos-keychain (bug#64977) * lisp/auth-source.el (auth-source-macos-keychain-search) (auth-source-macos-keychain-search-items): Fix handling of user and port. * test/lisp/auth-source-tests.el (test-macos-keychain-search): New test. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index e51fc02724a..66de763f671 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -1958,20 +1958,23 @@ auth-source-macos-keychain-search (hosts (if (and hosts (listp hosts)) hosts `(,hosts))) (ports (plist-get spec :port)) (ports (if (and ports (listp ports)) ports `(,ports))) + (users (plist-get spec :user)) + (users (if (and users (listp users)) users `(,users))) ;; Loop through all combinations of host/port and pass each of these to ;; auth-source-macos-keychain-search-items (items (catch 'match (dolist (host hosts) (dolist (port ports) - (let* ((port (if port (format "%S" port))) - (items (apply #'auth-source-macos-keychain-search-items - coll - type - max - host port - search-spec))) - (when items - (throw 'match items))))))) + (dolist (user users) + (let ((items (apply + #'auth-source-macos-keychain-search-items + coll + type + max + host port user + search-spec))) + (when items + (throw 'match items)))))))) ;; ensure each item has each key in `returned-keys' (items (mapcar (lambda (plist) @@ -2003,8 +2006,9 @@ auth-source--decode-octal-string collect var)) 'utf-8))) -(cl-defun auth-source-macos-keychain-search-items (coll _type _max host port - &key label type user +(cl-defun auth-source-macos-keychain-search-items (coll _type _max + host port user + &key label type &allow-other-keys) (let* ((keychain-generic (eq type 'macos-keychain-generic)) (args `(,(if keychain-generic @@ -2022,47 +2026,49 @@ auth-source-macos-keychain-search-items (when port (if keychain-generic (setq args (append args (list "-s" port))) - (setq args (append args (list - (if (string-match "[0-9]+" port) "-P" "-r") - port))))) + (setq args (append args (if (string-match "[0-9]+" port) + (list "-P" port) + (list "-r" (substring + (format "%-4s" port) + 0 4))))))) - (unless (equal coll "default") - (setq args (append args (list coll)))) + (unless (equal coll "default") + (setq args (append args (list coll)))) - (with-temp-buffer - (apply #'call-process "/usr/bin/security" nil t nil args) - (goto-char (point-min)) - (while (not (eobp)) - (cond - ((looking-at "^password: \\(?:0x[0-9A-F]+\\)? *\"\\(.+\\)\"") - (setq ret (auth-source-macos-keychain-result-append - ret - keychain-generic - "secret" - (let ((v (auth-source--decode-octal-string - (match-string 1)))) - (lambda () v))))) - ;; TODO: check if this is really the label - ;; match 0x00000007 ="AppleID" - ((looking-at - "^[ ]+0x00000007 =\\(?:0x[0-9A-F]+\\)? *\"\\(.+\\)\"") - (setq ret (auth-source-macos-keychain-result-append - ret - keychain-generic - "label" - (auth-source--decode-octal-string (match-string 1))))) - ;; match "crtr"="aapl" - ;; match "svce"="AppleID" - ((looking-at - "^[ ]+\"\\([a-z]+\\)\"[^=]+=\\(?:0x[0-9A-F]+\\)? *\"\\(.+\\)\"") - (setq ret (auth-source-macos-keychain-result-append - ret - keychain-generic - (auth-source--decode-octal-string (match-string 1)) - (auth-source--decode-octal-string (match-string 2)))))) - (forward-line))) - ;; return `ret' iff it has the :secret key - (and (plist-get ret :secret) (list ret)))) + (with-temp-buffer + (apply #'call-process "/usr/bin/security" nil t nil args) + (goto-char (point-min)) + (while (not (eobp)) + (cond + ((looking-at "^password: \\(?:0x[0-9A-F]+\\)? *\"\\(.+\\)\"") + (setq ret (auth-source-macos-keychain-result-append + ret + keychain-generic + "secret" + (let ((v (auth-source--decode-octal-string + (match-string 1)))) + (lambda () v))))) + ;; TODO: check if this is really the label + ;; match 0x00000007 ="AppleID" + ((looking-at + "^[ ]+0x00000007 =\\(?:0x[0-9A-F]+\\)? *\"\\(.+\\)\"") + (setq ret (auth-source-macos-keychain-result-append + ret + keychain-generic + "label" + (auth-source--decode-octal-string (match-string 1))))) + ;; match "crtr"="aapl" + ;; match "svce"="AppleID" + ((looking-at + "^[ ]+\"\\([a-z]+\\)\"[^=]+=\\(?:0x[0-9A-F]+\\)? *\"\\(.+\\)\"") + (setq ret (auth-source-macos-keychain-result-append + ret + keychain-generic + (auth-source--decode-octal-string (match-string 1)) + (auth-source--decode-octal-string (match-string 2)))))) + (forward-line))) + ;; return `ret' iff it has the :secret key + (and (plist-get ret :secret) (list ret)))) (defun auth-source-macos-keychain-result-append (result generic k v) (push v result) diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el index ef915e5fc5b..ab1a437b303 100644 --- a/test/lisp/auth-source-tests.el +++ b/test/lisp/auth-source-tests.el @@ -435,5 +435,25 @@ test-netrc-credentials-2 '((("machine" . "XM") ("login" . "XL") ("password" . "XP")) (("machine" . "YM") ("login" . "YL") ("password" . "YP"))))))) +(ert-deftest test-macos-keychain-search () + "Test if the constructed command line arglist is correct." + (let ((auth-sources '(macos-keychain-internet macos-keychain-generic))) + ;; Redefine `call-process' to check command line arguments. + (cl-letf (((symbol-function 'call-process) + (lambda (_program _infile _destination _display + &rest args) + ;; Arguments must be all strings + (should (cl-every #'stringp args)) + ;; Argument number should be even + (should (cl-evenp (length args))) + (should (cond ((string= (car args) "find-internet-password") + (let ((protocol (cl-member "-r" args :test #'string=))) + (if protocol + (= 4 (length (cadr protocol))) + t))) + ((string= (car args) "find-generic-password") + t)))))) + (auth-source-search :user '("a" "b") :host '("example.org") :port '("irc" "ftp" "https"))))) + (provide 'auth-source-tests) ;;; auth-source-tests.el ends here commit ba914bd9c953c3157390a5b535e042ae42cd0179 Merge: 6504b026621 c42970d7758 Author: Michael Albinus Date: Sun Aug 13 17:00:53 2023 +0200 Merge from origin/emacs-29 c42970d7758 Handle last-coding-system-used in Tramp for all backends ffafe38d030 Add 2 Welsh characters to iso-transl.el commit c42970d7758c43a74ebd09ff506525d879d03708 Author: Michael Albinus Date: Sun Aug 13 16:48:00 2023 +0200 Handle last-coding-system-used in Tramp for all backends * lisp/net/tramp.el (tramp-skeleton-write-region): Handle `last-coding-system-used'. (tramp-handle-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): * lisp/net/tramp-sshfs.el (tramp-sshfs-handle-write-region): Set `coding-system-used'. (Bug#65022) * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): Move `last-coding-system-used' handling to `tramp-skeleton-write-region'. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 58c93245335..f16c97a235c 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -552,6 +552,8 @@ tramp-adb-handle-write-region (set-file-modes tmpfile (logior (or (file-modes tmpfile) 0) #o0600))) (let (create-lockfiles) (write-region start end tmpfile append 'no-message)) + ;; Now, `last-coding-system-used' has the right value. Remember it. + (setq coding-system-used last-coding-system-used) (with-tramp-progress-reporter v 3 (format-message "Moving tmp file `%s' to `%s'" tmpfile filename) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 9895af92502..ffd910b41c4 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3446,15 +3446,6 @@ tramp-sh-handle-write-region (let* ((modes (tramp-default-file-modes filename (and (eq mustbenew 'excl) 'nofollow))) - ;; We use this to save the value of - ;; `last-coding-system-used' after writing the tmp - ;; file. At the end of the function, we set - ;; `last-coding-system-used' to this saved value. This - ;; way, any intermediary coding systems used while - ;; talking to the remote shell or suchlike won't hose - ;; this variable. This approach was snarfed from - ;; ange-ftp.el. - coding-system-used ;; Write region into a tmp file. This isn't really ;; needed if we use an encoding function, but currently ;; we use it always because this makes the logic @@ -3484,11 +3475,11 @@ tramp-sh-handle-write-region ((error quit) (setq tramp-temp-buffer-file-name nil) (delete-file tmpfile) - (signal (car err) (cdr err)))) + (signal (car err) (cdr err))))) - ;; Now, `last-coding-system-used' has the right value. - ;; Remember it. - (setq coding-system-used last-coding-system-used)) + ;; Now, `last-coding-system-used' has the right value. + ;; Remember it. + (setq coding-system-used last-coding-system-used) ;; The permissions of the temporary file should be set. If ;; FILENAME does not exist (eq modes nil) it has been @@ -3618,11 +3609,7 @@ tramp-sh-handle-write-region v 'file-error (concat "Method `%s' should specify both encoding and " "decoding command or an scp program") - method)))) - - ;; Make `last-coding-system-used' have the right value. - (when coding-system-used - (setq last-coding-system-used coding-system-used))))))) + method))))))))) (defvar tramp-vc-registered-file-names nil "List used to collect file names, which are checked during `vc-registered'.") diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index c50bd5b387f..7249fa266ac 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1628,6 +1628,8 @@ tramp-smb-handle-write-region ;; `set-visited-file-modtime' ourselves later on. (let (create-lockfiles) (write-region start end tmpfile append 'no-message)) + ;; Now, `last-coding-system-used' has the right value. Remember it. + (setq coding-system-used last-coding-system-used) (with-tramp-progress-reporter v 3 (format "Moving tmp file %s to %s" tmpfile filename) diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el index 0ec2a1e74b8..c638d32ec35 100644 --- a/lisp/net/tramp-sshfs.el +++ b/lisp/net/tramp-sshfs.el @@ -379,7 +379,9 @@ tramp-sshfs-handle-write-region (tramp-skeleton-write-region start end filename append visit lockname mustbenew (let (create-lockfiles) (write-region - start end (tramp-fuse-local-file-name filename) append 'nomessage)))) + start end (tramp-fuse-local-file-name filename) append 'nomessage)) + ;; Now, `last-coding-system-used' has the right value. Remember it. + (setq coding-system-used last-coding-system-used))) ;; File name conversions. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9fa698293ce..caa6baabc31 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3719,14 +3719,22 @@ tramp-skeleton-write-region ;; VISIT, for example `jka-compr-handler'. We must respect this. ;; See Bug#55166. `(let* ((filename (expand-file-name ,filename)) - (lockname (file-truename (or ,lockname filename))) - (handler (and (stringp ,visit) - (let ((inhibit-file-name-handlers - `(tramp-file-name-handler - tramp-crypt-file-name-handler - . inhibit-file-name-handlers)) - (inhibit-file-name-operation 'write-region)) - (find-file-name-handler ,visit 'write-region))))) + (lockname (file-truename (or ,lockname filename))) + (handler (and (stringp ,visit) + (let ((inhibit-file-name-handlers + `(tramp-file-name-handler + tramp-crypt-file-name-handler + . inhibit-file-name-handlers)) + (inhibit-file-name-operation 'write-region)) + (find-file-name-handler ,visit 'write-region)))) + ;; We use this to save the value of + ;; `last-coding-system-used' after writing the tmp file. At + ;; the end of the function, we set `last-coding-system-used' + ;; to this saved value. This way, any intermediary coding + ;; systems used while talking to the remote shell or + ;; suchlike won't hose this variable. This approach was + ;; snarfed from ange-ftp.el. + coding-system-used) (with-parsed-tramp-file-name filename nil (if handler (progn @@ -3773,9 +3781,7 @@ tramp-skeleton-write-region ;; likely that it is needed shortly after `write-region'. (tramp-set-file-property v localname "file-exists-p" t) - ;; We must protect `last-coding-system-used', now we have - ;; set it to its correct value. - (let (last-coding-system-used (need-chown t)) + (let ((need-chown t)) ;; Set file modification time. (when (or (eq ,visit t) (stringp ,visit)) (when-let ((file-attr (file-attributes filename 'integer))) @@ -3794,7 +3800,7 @@ tramp-skeleton-write-region (tramp-set-file-uid-gid filename uid gid)) ;; Set extended attributes. We ignore possible errors, - ;; because ACL strings could be incompatible. + ;; because ACL strings or SELinux contexts could be incompatible. (when attributes (ignore-errors (set-file-extended-attributes filename attributes))) @@ -3813,7 +3819,11 @@ tramp-skeleton-write-region (when (and (null noninteractive) (or (eq ,visit t) (string-or-null-p ,visit))) (tramp-message v 0 "Wrote %s" filename)) - (run-hooks 'tramp-handle-write-region-hook))))))) + (run-hooks 'tramp-handle-write-region-hook)))) + + ;; Make `last-coding-system-used' have the right value. + (when coding-system-used + (setq last-coding-system-used coding-system-used))))) ;;; Common file name handler functions for different backends: @@ -5420,6 +5430,8 @@ tramp-handle-write-region ;; `set-visited-file-modtime' ourselves later on. (let (create-lockfiles) (write-region start end tmpfile append 'no-message)) + ;; Now, `last-coding-system-used' has the right value. Remember it. + (setq coding-system-used last-coding-system-used) (condition-case nil (rename-file tmpfile filename 'ok-if-already-exists) (error commit 6504b026621c67998c7b0cc8a16a15f56aba0b13 Author: Stefan Kangas Date: Sun Aug 13 15:08:16 2023 +0200 Remove dead code in `eshell/diff` * lisp/eshell/em-unix.el (eshell/diff): Adjust for diff-mode; do not set 'compilation-finish-functions', as it is never used. (Bug#65245) (eshell-diff-quit): Make into an obsolete function alias for 'ignore'; the command has been a no-op for close to two decades. (eshell-diff-window-config): Make obsolete. diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index b7ef0f0c40c..a8c86b925bc 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -998,14 +998,6 @@ eshell/whoami "Make \"whoami\" Tramp aware." (eshell-user-login-name)) -(defvar eshell-diff-window-config nil) - -(defun eshell-diff-quit () - "Restore the window configuration previous to diff'ing." - (interactive) - (if eshell-diff-window-config - (set-window-configuration eshell-diff-window-config))) - (defun eshell-nil-blank-string (string) "Return STRING, or nil if STRING contains only blank characters." (cond @@ -1028,8 +1020,7 @@ eshell/diff (throw 'eshell-replace-command (eshell-parse-command "*diff" orig-args))) (let ((old (car (last args 2))) - (new (car (last args))) - (config (current-window-configuration))) + (new (car (last args)))) (if (= (length args) 2) (setq args nil) (setcdr (last args 3) nil)) @@ -1041,18 +1032,6 @@ eshell/diff (error (throw 'eshell-replace-command (eshell-parse-command "*diff" orig-args)))) - (when (fboundp 'diff-mode) - (add-hook - 'compilation-finish-functions - (lambda (buff _msg) - (with-current-buffer buff - (diff-mode) - (setq-local eshell-diff-window-config config) - (local-set-key [?q] #'eshell-diff-quit) - (if (fboundp 'turn-on-font-lock-if-enabled) - (turn-on-font-lock-if-enabled)) - (goto-char (point-min)))) - nil t)) (pop-to-buffer (current-buffer)))))) nil) @@ -1088,6 +1067,9 @@ eshell/occur (put 'eshell/occur 'eshell-no-numeric-conversions t) (define-obsolete-function-alias 'nil-blank-string #'eshell-nil-blank-string "29.1") +(defvar eshell-diff-window-config nil) +(make-obsolete-variable 'eshell-diff-window-config "no longer used." "30.1") +(define-obsolete-function-alias 'eshell-diff-quit #'ignore "30.1") (provide 'em-unix) commit 305847f8772f62ec488aac783ac845f50865e87c Author: Po Lu Date: Sun Aug 13 20:30:40 2023 +0800 Describe how to read Logcat output in etc/DEBUG * etc/DEBUG (Debugging Emacs on Android): Describe the three kinds of crash messages Android prints to logcat, and how they are read. (bug#65268) diff --git a/etc/DEBUG b/etc/DEBUG index 1cc575598bf..005117dcb82 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -1063,7 +1063,7 @@ recovering the contents of Emacs buffers from a core dump file. You might also find those commands useful for displaying the list of buffers in human-readable format from within the debugger. -*** Debugging Emacs with LLDB +** Debugging Emacs with LLDB On systems where GDB is not available, like macOS with M1 chip, you can also use LLDB for Emacs debugging. @@ -1132,6 +1132,125 @@ In addition, when Emacs runs as a 64-bit process on a system supporting both 64 and 32-bit binaries, you must specify the path to a 64-bit gdbserver binary. +On top of the debugging procedure described above, Android also +maintains a "logcat" buffer, where it prints backtraces after each +crash. Its contents are of interest when performing post-mortem +debugging after a crash, and can also be retrieved through the `adb' +tool, like so: + + $ adb logcat + +There are three forms of crash messages printed by Android. The first +form is printed when a crash arises within Java code, and should +resemble the following when printed in the logcat buffer: + +E AndroidRuntime: FATAL EXCEPTION: main +E AndroidRuntime: Process: org.gnu.emacs, PID: 18057 +E AndroidRuntime: java.lang.RuntimeException: sample crash +E AndroidRuntime: at org.gnu.emacs.EmacsService.onCreate(EmacsService.java:308) +E AndroidRuntime: at android.app.ActivityThread.handleCreateService(ActivityThread.java:4485) +E AndroidRuntime: ... 9 more + +The second form is printed when a fatal signal (such as an abort, or +segmentation fault) is raised within C code. Here is an example of +such a crash: + +F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3 in tid 32644 + (Emacs main thre), pid 32619 (org.gnu.emacs) +F DEBUG : Cmdline: org.gnu.emacs +F DEBUG : pid: 32619, tid: 32644, name: Emacs main thre >>> org.gnu.emacs <<< +F DEBUG : #00 pc 002b27b0 /.../lib/arm64/libemacs.so (sfnt_read_cmap_table+32) +F DEBUG : #01 pc 002c4ee8 /.../lib/arm64/libemacs.so (sfntfont_read_cmap+84) +F DEBUG : #02 pc 002c4dc4 /.../lib/arm64/libemacs.so (sfntfont_lookup_char+396) +F DEBUG : #03 pc 002c23d8 /.../lib/arm64/libemacs.so (sfntfont_list+1688) +F DEBUG : #04 pc 0021112c /.../lib/arm64/libemacs.so (font_list_entities+864) +F DEBUG : #05 pc 002138d8 /.../lib/arm64/libemacs.so (font_find_for_lface+1532) +F DEBUG : #06 pc 00280c50 /.../lib/arm64/libemacs.so (fontset_find_font+2760) +F DEBUG : #07 pc 0027cadc /.../lib/arm64/libemacs.so (fontset_font+792) +F DEBUG : #08 pc 0027c710 /.../lib/arm64/libemacs.so (face_for_char+412) +F DEBUG : #09 pc 00217314 /.../lib/arm64/libemacs.so (Finternal_char_font+324) +F DEBUG : #10 pc 00240d78 /.../lib/arm64/libemacs.so (exec_byte_code+3112) +F DEBUG : #11 pc 001f5ff8 /.../lib/arm64/libemacs.so (Ffuncall+392) +F DEBUG : #12 pc 001f3cf0 /.../lib/arm64/libemacs.so (eval_sub+2260) +F DEBUG : #13 pc 001f853c /.../lib/arm64/libemacs.so (Feval+80) +F DEBUG : #14 pc 00240d78 /.../lib/arm64/libemacs.so (exec_byte_code+3112) +F DEBUG : #15 pc 00240130 /.../lib/arm64/libemacs.so (Fbyte_code+120) +F DEBUG : #16 pc 001f3d84 /.../lib/arm64/libemacs.so (eval_sub+2408) +F DEBUG : #17 pc 00221d7c /.../lib/arm64/libemacs.so (readevalloop+1748) +F DEBUG : #18 pc 002201a0 /.../lib/arm64/libemacs.so (Fload+2544) +F DEBUG : #19 pc 00221f3c /.../lib/arm64/libemacs.so (save_match_data_load+88) +F DEBUG : #20 pc 001f8414 /.../lib/arm64/libemacs.so (load_with_autoload_queue+252) +F DEBUG : #21 pc 001f6550 /.../lib/arm64/libemacs.so (Fautoload_do_load+608) +F DEBUG : #22 pc 00240d78 /.../lib/arm64/libemacs.so (exec_byte_code+3112) +F DEBUG : #23 pc 001f5ff8 /.../lib/arm64/libemacs.so (Ffuncall+392) +F DEBUG : #24 pc 001f1120 /.../lib/arm64/libemacs.so (Ffuncall_interactively+64) +F DEBUG : #25 pc 001f5ff8 /.../lib/arm64/libemacs.so (Ffuncall+392) +F DEBUG : #26 pc 001f8b8c /.../lib/arm64/libemacs.so (Fapply+916) +F DEBUG : #27 pc 001f137c /.../lib/arm64/libemacs.so (Fcall_interactively+576) +F DEBUG : #28 pc 00240d78 /.../lib/arm64/libemacs.so (exec_byte_code+3112) +F DEBUG : #29 pc 001f5ff8 /.../lib/arm64/libemacs.so (Ffuncall+392) +F DEBUG : #30 pc 0016d054 /.../lib/arm64/libemacs.so (command_loop_1+1344) +F DEBUG : #31 pc 001f6d90 /.../lib/arm64/libemacs.so (internal_condition_case+92) +F DEBUG : #32 pc 0016cafc /.../lib/arm64/libemacs.so (command_loop_2+48) +F DEBUG : #33 pc 001f6660 /.../lib/arm64/libemacs.so (internal_catch+84) +F DEBUG : #34 pc 0016c288 /.../lib/arm64/libemacs.so (command_loop+264) +F DEBUG : #35 pc 0016c0d8 /.../lib/arm64/libemacs.so (recursive_edit_1+144) +F DEBUG : #36 pc 0016c4fc /.../lib/arm64/libemacs.so (Frecursive_edit+348) +F DEBUG : #37 pc 0016af9c /.../lib/arm64/libemacs.so (android_emacs_init+7132) +F DEBUG : #38 pc 002ab8d4 /.../lib/arm64/libemacs.so (Java_org_gnu_emacs_...+3816) + +Where the first line (the one containing "libc") mentions the number +of the fatal signal, the address of any VM fault, and the name and ID +of the thread which crashed. Subsequent lines then contain a +backtrace, recounting each function in the call stack culminating in +the crash. + +The third form is printed when Emacs misuses the JVM in some fashion +that is detected by the Android CheckJNI facility. It looks like: + +A/art﹕ art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: ... +A/art﹕ art/runtime/check_jni.cc:65] in call to CallVoidMethodV +A/art﹕ art/runtime/check_jni.cc:65] from void android.os.MessageQueue.nativePollOnce(long, int) +A/art﹕ art/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable +A/art﹕ art/runtime/check_jni.cc:65] | group="main" sCount=0 dsCount=0 obj=0x87d30ef0 self=0xb4f07800 +A/art﹕ art/runtime/check_jni.cc:65] | sysTid=18828 nice=-11 cgrp=apps sched=0/0 handle=0xb6fdeec8 +A/art﹕ art/runtime/check_jni.cc:65] | state=R schedstat=( 2249126546 506089308 3210 ) utm=183 stm=41 core=3 HZ=100 +A/art﹕ art/runtime/check_jni.cc:65] | stack=0xbe0c8000-0xbe0ca000 stackSize=8MB +A/art﹕ art/runtime/check_jni.cc:65] | held mutexes= "mutator lock"(shared held) +A/art﹕ art/runtime/check_jni.cc:65] native: #00 pc 00004640 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23) +A/art﹕ art/runtime/check_jni.cc:65] native: #01 pc 00002e8d /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8) +A/art﹕ art/runtime/check_jni.cc:65] native: #02 pc 00248381 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream >&, int, char const*, art::mirror::ArtMethod*)+68) +A/art﹕ art/runtime/check_jni.cc:65] native: #03 pc 0022cd0b /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream >&) const+146) +A/art﹕ art/runtime/check_jni.cc:65] native: #04 pc 000b189b /system/lib/libart.so (art::JniAbort(char const*, char const*)+582) +A/art﹕ art/runtime/check_jni.cc:65] native: #05 pc 000b1fd5 /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+60) +A/art﹕ art/runtime/check_jni.cc:65] native: #06 pc 000b50e5 /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1284) +A/art﹕ art/runtime/check_jni.cc:65] native: #07 pc 000bc59f /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+30) +A/art﹕ art/runtime/check_jni.cc:65] native: #08 pc 00063803 /system/lib/libandroid_runtime.so (???) +A/art﹕ art/runtime/check_jni.cc:65] native: #09 pc 000776bd /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::dispatchVsync(long long, int, unsigned int)+40) +A/art﹕ art/runtime/check_jni.cc:65] native: #10 pc 00077885 /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::handleEvent(int, int, void*)+80) +A/art﹕ art/runtime/check_jni.cc:65] native: #11 pc 00010f6f /system/lib/libutils.so (android::Looper::pollInner(int)+482) +A/art﹕ art/runtime/check_jni.cc:65] native: #12 pc 00011019 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92) +A/art﹕ art/runtime/check_jni.cc:65] native: #13 pc 000830c1 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22) +A/art﹕ art/runtime/check_jni.cc:65] native: #14 pc 000b22d7 /system/framework/arm/boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102) +A/art﹕ art/runtime/check_jni.cc:65] at android.os.MessageQueue.nativePollOnce(Native method) +A/art﹕ art/runtime/check_jni.cc:65] at android.os.MessageQueue.next(MessageQueue.java:143) +A/art﹕ art/runtime/check_jni.cc:65] at android.os.Looper.loop(Looper.java:130) +A/art﹕ art/runtime/check_jni.cc:65] at android.app.ActivityThread.main(ActivityThread.java:5832) +A/art﹕ art/runtime/check_jni.cc:65] at java.lang.reflect.Method.invoke!(Native method) +A/art﹕ art/runtime/check_jni.cc:65] at java.lang.reflect.Method.invoke(Method.java:372) +A/art﹕ art/runtime/check_jni.cc:65] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) +A/art﹕ art/runtime/check_jni.cc:65] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) +A/art﹕ art/runtime/check_jni.cc:65] + +In such situations, the first line explains what infraction Emacs +committed, while the ensuing ones print backtraces for each running +Java thread at the time of the error. + +Since the logcat output is always rapidly being amended, it is worth +piping it to a file or shell command buffer, and then searching for +keywords such as "AndroidRuntime", "Fatal signal", or "JNI DETECTED +ERROR IN APPLICATION". + This file is part of GNU Emacs. commit 0901dbb2f2c294f67e5cf5e15e3d0d8452eaee5a Author: Eli Zaretskii Date: Sun Aug 13 15:19:51 2023 +0300 ; * lisp/loadup.el (native-comp-enable-subr-trampolines): Fix a typo. diff --git a/lisp/loadup.el b/lisp/loadup.el index 9947c2482c3..3ac1224a0ec 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -603,7 +603,7 @@ comp-subr-arities-h (equal dump-mode "pdump")) ;; Don't enable this before bootstrap is completed, as the ;; compiler infrastructure may not be usable yet. - (setq comp-enable-subr-trampolines t)) + (setq native-comp-enable-subr-trampolines t)) (message "Dumping under the name %s" output) (condition-case () (delete-file output) commit eea0116e868d782508540b5dbc07e39b64e808f6 Author: Stefan Kangas Date: Sun Aug 13 12:52:42 2023 +0200 Delete XEmacs compat code from supercite.el * lisp/mail/supercite.el (sc-ask): Delete compatibility code; 'button-release-event-p' is only defined in XEmacs. diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index 1a48c64a663..8d9cb5511ed 100644 --- a/lisp/mail/supercite.el +++ b/lisp/mail/supercite.el @@ -620,9 +620,6 @@ sc-ask ((setq elt (rassq char alist)) (message "%s%s" p (car elt)) (setq p (cdr elt))) - ((if (fboundp 'button-release-event-p) - (button-release-event-p event)) ; ignore them - nil) (t (message "%s%s" p (single-key-description event)) (ding) commit c51d1bce1ea5d97219dff22bc278644cb7495297 Author: Mattias Engdegård Date: Sun Aug 13 11:51:03 2023 +0200 `equal` is not error-free * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns) (side-effect-and-error-free-fns) (byte-compile-side-effect-and-error-free-ops) (byte-compile-side-effect-free-ops): Demote `equal` and `equal-including-properties` from error-free to merely side-effect-free since they may in fact signal error on circularity. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 456b3891bfe..ecc5fff3b67 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1744,6 +1744,7 @@ byte-optimize-set base64-decode-string base64-encode-string base64url-encode-string buffer-hash buffer-line-statistics compare-strings concat copy-alist copy-hash-table copy-sequence elt + equal equal-including-properties featurep get gethash hash-table-count hash-table-rehash-size hash-table-rehash-threshold hash-table-size hash-table-test @@ -1877,7 +1878,7 @@ byte-optimize-set ;; fileio.c default-file-modes ;; fns.c - eql equal equal-including-properties + eql hash-table-p identity proper-list-p safe-length secure-hash-algorithms ;; frame.c @@ -2161,7 +2162,7 @@ byte-after-unbind-ops (defconst byte-compile-side-effect-and-error-free-ops '(byte-constant byte-dup byte-symbolp byte-consp byte-stringp byte-listp - byte-integerp byte-numberp byte-eq byte-equal byte-not byte-car-safe + byte-integerp byte-numberp byte-eq byte-not byte-car-safe byte-cdr-safe byte-cons byte-list1 byte-list2 byte-list3 byte-list4 byte-listN byte-point byte-point-max byte-point-min byte-following-char byte-preceding-char @@ -2172,10 +2173,11 @@ byte-compile-side-effect-free-ops (append '(byte-varref byte-nth byte-memq byte-car byte-cdr byte-length byte-aref byte-symbol-value byte-get byte-concat2 byte-concat3 byte-sub1 byte-add1 - byte-eqlsign byte-gtr byte-lss byte-leq byte-geq byte-diff byte-negate - byte-plus byte-max byte-min byte-mult byte-char-after byte-char-syntax - byte-buffer-substring byte-string= byte-string< byte-nthcdr byte-elt - byte-member byte-assq byte-quo byte-rem byte-substring) + byte-eqlsign byte-equal byte-gtr byte-lss byte-leq byte-geq byte-diff + byte-negate byte-plus byte-max byte-min byte-mult byte-char-after + byte-char-syntax byte-buffer-substring byte-string= byte-string< + byte-nthcdr byte-elt byte-member byte-assq byte-quo byte-rem + byte-substring) byte-compile-side-effect-and-error-free-ops)) ;; This crock is because of the way DEFVAR_BOOL variables work. commit 163e7dac5f2f9e1154ee5ae76fee9e4602a9b7cb Author: Mattias Engdegård Date: Sun Aug 13 10:36:21 2023 +0200 ; * lisp/emacs-lisp/rx.el: slight modernisation of internal rx usage diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index aa1174ea08b..afc9826eefa 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -26,7 +26,7 @@ ;; The translation to string regexp is done by a macro and does not ;; incur any extra processing during run time. Example: ;; -;; (rx bos (or (not (any "^")) +;; (rx bos (or (not "^") ;; (seq "^" (or " *" "[")))) ;; ;; => "\\`\\(?:[^^]\\|\\^\\(?: \\*\\|\\[\\)\\)" @@ -616,7 +616,7 @@ rx--generate-alt ;; Empty set (or any char). ((and (null intervals) (null classes)) (if negated - (rx--translate-symbol 'anything) + (rx--translate-symbol 'anychar) (rx--empty))) ;; More than one character, or at least one class. @@ -1095,15 +1095,15 @@ rx--translate-regexp (opt "^") (opt "]") (* (or (seq "[:" (+ (any "a-z")) ":]") - (not (any "]")))) + (not "]"))) "]") (not (any "*+?^$[\\")) (seq "\\" - (or anything - (seq (any "sScC_") anything) + (or anychar + (seq (any "sScC_") anychar) (seq "(" - (* (or (not (any "\\")) - (seq "\\" (not (any ")"))))) + (* (or (not "\\") + (seq "\\" (not ")")))) "\\)")))) eos) t))) commit ffafe38d0301815ebb3e7c36cfe79dcd84345074 Author: Devon Sean McCullough Date: Sat Aug 12 10:18:47 2023 -0400 Add 2 Welsh characters to iso-transl.el * lisp/international/iso-transl.el (iso-transl-char-map): Add two Welsh characters. (Bug#65248) diff --git a/lisp/international/iso-transl.el b/lisp/international/iso-transl.el index 80f14f3e8cb..459d1ff7f97 100644 --- a/lisp/international/iso-transl.el +++ b/lisp/international/iso-transl.el @@ -203,11 +203,15 @@ iso-transl-char-map ("^I" . [?Î]) ("^O" . [?Ô]) ("^U" . [?Û]) + ("^W" . [?Ŵ]) + ("^Y" . [?Ŷ]) ("^a" . [?â]) ("^e" . [?ê]) ("^i" . [?î]) ("^o" . [?ô]) ("^u" . [?û]) + ("^w" . [?ŵ]) + ("^y" . [?ŷ]) ("^^A" . [?Ǎ]) ("^^C" . [?Č]) ("^^E" . [?Ě])