commit 19c983ddedf083f82008472c13dfd08ec94b615f (HEAD, refs/remotes/origin/master) Author: Andrea Corallo Date: Sat May 18 08:59:17 2024 +0200 * Work around GCC bug affecting Garbage Collection (bug#65727). * src/lisp.h (flush_stack_call_func): Prevent GCC sibling call optimization to run with an asm inline. diff --git a/src/lisp.h b/src/lisp.h index 41f8af35e8a..8ee37f5298a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4479,6 +4479,12 @@ flush_stack_call_func (void (*func) (void *arg), void *arg) { __builtin_unwind_init (); flush_stack_call_func1 (func, arg); + /* Work around GCC sibling call optimization making + '__builtin_unwind_init' ineffective (bug#65727). + See . */ +#if defined __GNUC__ && !defined __clang__ + asm (""); +#endif } extern void garbage_collect (void); commit db039399cccd38b767bf6a30ba6c5da593eb69cf Author: Dmitry Gutov Date: Sat May 18 03:24:56 2024 +0300 Fix project-find-regexp in remote projects * lisp/progmodes/xref.el (xref--hits-file-prefix): New variable. Something to prepend to each file name (bug#69233). (xref--convert-hits): Use it to also store the "default directory" part of the filename conditionally on whether it's remote. (xref--collect-matches): Use the new variable here. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 25693d9cbef..534bd930e13 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -2082,15 +2082,17 @@ Such as the current syntax table and the applied syntax properties." (defvar xref--last-file-buffer nil) (defvar xref--temp-buffer-file-name nil) (defvar xref--hits-remote-id nil) +(defvar xref--hits-file-prefix nil) (defun xref--convert-hits (hits regexp) - (let (xref--last-file-buffer - (tmp-buffer (generate-new-buffer " *xref-temp*")) - (xref--hits-remote-id (if (file-name-absolute-p (cadar hits)) - ;; TODO: Add some test for this. - (file-remote-p default-directory) - default-directory)) - (syntax-needed (xref--regexp-syntax-dependent-p regexp))) + (let* (xref--last-file-buffer + (tmp-buffer (generate-new-buffer " *xref-temp*")) + (xref--hits-remote-id (file-remote-p default-directory)) + (xref--hits-file-prefix (if (and hits (file-name-absolute-p (cadar hits))) + ;; TODO: Add some test for this. + xref--hits-remote-id + (expand-file-name default-directory))) + (syntax-needed (xref--regexp-syntax-dependent-p regexp))) (unwind-protect (mapcan (lambda (hit) (xref--collect-matches hit regexp tmp-buffer syntax-needed)) @@ -2099,7 +2101,7 @@ Such as the current syntax table and the applied syntax properties." (defun xref--collect-matches (hit regexp tmp-buffer syntax-needed) (pcase-let* ((`(,line ,file ,text) hit) - (file (and file (concat xref--hits-remote-id file))) + (file (and file (concat xref--hits-file-prefix file))) (buf (xref--find-file-buffer file))) (if buf (with-current-buffer buf commit 646b8da4a5ec8b4b4a8e461683ff0786a95d1f85 Author: Dmitry Gutov Date: Sat May 18 03:00:29 2024 +0300 xref--group-name-for-display: Undo most of the latest change * lisp/progmodes/xref.el (xref--group-name-for-display): Remove the DD-SUFFIX parameter, returning the function more like to how it was (bug#69233). (xref--analyze, xref--add-log-current-defun): Revert the previous change accordingly. * test/lisp/progmodes/xref-tests.el: Undo the last change. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index ecaeac18c3a..25693d9cbef 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1048,15 +1048,11 @@ beginning of the line." (defun xref--add-log-current-defun () "Return the string used to group a set of locations. This function is used as a value for `add-log-current-defun-function'." - (let ((project-root (xref--project-root (project-current)))) - (xref--group-name-for-display - (if-let (item (xref--item-at-point)) - (xref-location-group (xref-match-item-location item)) - (xref--imenu-extract-index-name)) - project-root - (and - (string-prefix-p project-root default-directory) - (substring default-directory (length project-root)))))) + (xref--group-name-for-display + (if-let (item (xref--item-at-point)) + (xref-location-group (xref-match-item-location item)) + (xref--imenu-extract-index-name)) + (xref--project-root (project-current)))) (defun xref--next-error-function (n reset?) (when reset? @@ -1188,15 +1184,12 @@ GROUP is a string for decoration purposes and XREF is an (xref--apply-truncation))) (run-hooks 'xref-after-update-hook)) -(defun xref--group-name-for-display (group project-root dd-suffix) +(defun xref--group-name-for-display (group project-root) "Return GROUP formatted in the preferred style. The style is determined by the value of `xref-file-name-display'. If GROUP looks like a file name, its value is formatted according -to that style. Otherwise it is returned unchanged. - -PROJECT-ROOT is the root of the current project, if any. DD-SUFFIX is -the relative name of `default-directory' relative to the project root." +to that style. Otherwise it is returned unchanged." ;; XXX: The way we verify that it's indeed a file name and not some ;; other kind of string, e.g. Java package name or TITLE from ;; `tags-apropos-additional-actions', is pretty lax. But we don't @@ -1210,15 +1203,10 @@ the relative name of `default-directory' relative to the project root." (nondirectory (file-name-nondirectory group)) (project-relative - (cond - ((not (file-name-absolute-p group)) - (concat dd-suffix group)) - ((and project-root - (string-prefix-p project-root group)) - (substring group (length project-root))) - ;; Default to absolute when there's not project around. - (t - (expand-file-name group)))))) + (if (and project-root + (string-prefix-p project-root group)) + (substring group (length project-root)) + group)))) (defun xref--analyze (xrefs) "Find common groups in XREFS and format group names. @@ -1231,13 +1219,10 @@ Return an alist of the form ((GROUP . (XREF ...)) ...)." (eq xref-file-name-display 'project-relative) (project-current))) (project-root (and project - (expand-file-name (xref--project-root project)))) - (dd-suffix (and project-root - (string-prefix-p project-root default-directory) - (substring default-directory (length project-root))))) + (expand-file-name (xref--project-root project))))) (mapcar (lambda (pair) - (cons (xref--group-name-for-display (car pair) project-root dd-suffix) + (cons (xref--group-name-for-display (car pair) project-root) (cdr pair))) alist))) diff --git a/test/lisp/progmodes/xref-tests.el b/test/lisp/progmodes/xref-tests.el index 39eab7c7fd1..89051256273 100644 --- a/test/lisp/progmodes/xref-tests.el +++ b/test/lisp/progmodes/xref-tests.el @@ -132,7 +132,6 @@ (lambda (loc) (xref--group-name-for-display (xref-location-group loc) - nil nil)) (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)"))) (list @@ -146,7 +145,6 @@ (lambda (loc) (xref--group-name-for-display (xref-location-group loc) - nil nil)) (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)"))) (list @@ -163,8 +161,7 @@ (lambda (loc) (xref--group-name-for-display (xref-location-group loc) - data-parent-dir - nil)) + data-parent-dir)) (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)"))) (list "xref-resources/file1.txt" commit 1f08984a67c94e957bec7f8c59818b627a67427b Author: Po Lu Date: Fri May 17 19:21:05 2024 +0800 Port to certain Android environments with no GUI * configure.ac (USER_FULL_NAME): Define to android_user_full_name only when a GUI system is being built. Otherwise, set to pw->pw_gecos or NULL consistently with the presence of pw->pw_gecos. * src/editfns.c (Fuser_full_name): Adjust to match. Accept NULL values from USER_FULL_NAME. diff --git a/configure.ac b/configure.ac index 626e09aad8a..cab9eedd6cf 100644 --- a/configure.ac +++ b/configure.ac @@ -2464,11 +2464,6 @@ AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"], [The type of system you are compiling for; sets 'system-type'.]) AC_SUBST([SYSTEM_TYPE]) -# Check for pw_gecos in struct passwd; this is known to be missing on -# Android. - -AC_CHECK_MEMBERS([struct passwd.pw_gecos], [], [], [#include ]) - pre_PKG_CONFIG_CFLAGS=$CFLAGS pre_PKG_CONFIG_LIBS=$LIBS @@ -2754,6 +2749,17 @@ AC_SUBST([ANDROID_BUILD_CFLAGS]) AC_SUBST([ANDROID_SHARED_USER_ID]) AC_SUBST([ANDROID_SHARED_USER_NAME]) +# Check for pw_gecos in struct passwd; this is known to be missing on +# Android. + +AH_TEMPLATE([USER_FULL_NAME], [How to get a user's full name.]) +AC_CHECK_MEMBERS([struct passwd.pw_gecos], [], [], [#include ]) +AS_IF([test x"$REALLY_ANDROID" = "xyes"], + [AC_DEFINE([USER_FULL_NAME], [android_user_full_name (pw)])], + [AS_IF([test x"$ac_cv_member_struct_passwd_pw_gecos" = "xyes"], + [AC_DEFINE([USER_FULL_NAME], [pw->pw_gecos])], + [AC_DEFINE([USER_FULL_NAME], [NULL])])]) + if test "${with_pgtk}" = "yes"; then window_system=pgtk fi @@ -6460,9 +6466,6 @@ AC_SUBST([SEPCHAR]) dnl Everybody supports this, except MS-DOS. AC_DEFINE([subprocesses], [1], [Define to enable asynchronous subprocesses.]) -AC_DEFINE([USER_FULL_NAME], [pw->pw_gecos], [How to get a user's full name.]) - - AC_DEFINE([DIRECTORY_SEP], ['/'], [Character that separates directories in a file name.]) diff --git a/src/editfns.c b/src/editfns.c index fbfaaf66644..6b110b3d0e0 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1247,11 +1247,10 @@ is in general a comma-separated list. */) if (!pw) return Qnil; -#if defined HAVE_ANDROID && !defined ANDROID_STUBIFY - p = android_user_full_name (pw); -#else p = USER_FULL_NAME; -#endif + if (!p) + return Qnil; + /* Chop off everything after the first comma, since 'pw_gecos' is a comma-separated list. */ q = strchr (p, ',');