commit 6fc502c1ef327ab357c971b9bffbbd7cb6a436f1 (HEAD, refs/remotes/origin/master) Author: João Távora Date: Sun Sep 6 08:35:53 2020 +0100 Don't resort Icomplete candidates when default already on top Fixes: bug#43222 Icomplete mode re-sorts candidates, bubbling the default to top if it's found somewhere down the list. This is done according to two criteria: exact match and prefix match. Before this fix, it didn't take into account the possibility that the exact match for the default would already be on top, and would incorrectly bubble a prefixing completion down the list to the top. This commit fixes that. * lisp/icomplete.el (icomplete--sorted-completions): Rework. Recomment. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index ba266cfbfe..47d78a0bc8 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -469,6 +469,7 @@ Usually run by inclusion in `minibuffer-setup-hook'." with beg = (icomplete--field-beg) with end = (icomplete--field-end) with all = (completion-all-sorted-completions beg end) + ;; First, establish the "bubble up" predicates. for fn in (cond ((and minibuffer-default (stringp minibuffer-default) ; bug#38992 (= (icomplete--field-end) (icomplete--field-beg))) @@ -493,14 +494,18 @@ Usually run by inclusion in `minibuffer-setup-hook'." ;; what vanilla Emacs and `ido-mode' both do. `(,(lambda (comp) (string= "./" comp))))) - thereis (cl-loop - for l on all - while (consp (cdr l)) - for comp = (cadr l) - when (funcall fn comp) - do (setf (cdr l) (cddr l)) - and return - (completion--cache-all-sorted-completions beg end (cons comp all))) + ;; Now, look for a completion matching one of those predicates + ;; to bubble up (unless that completion is already on top). + thereis (or + (and (funcall fn (car all)) all) + (cl-loop + for l on all + while (consp (cdr l)) + for comp = (cadr l) + when (funcall fn comp) + do (setf (cdr l) (cddr l)) + and return + (completion--cache-all-sorted-completions beg end (cons comp all)))) finally return all))) commit 669b46e6a39bb5ba5d2ed14baebd585af6130ec9 Author: Thomas Fitzsimmons Date: Sat Sep 5 22:53:00 2020 -0400 EUDC: Reword macOS Contacts back end overview * doc/misc/eudc.texi (macOS Contacts): Shorten section. diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 4ead6032b7..69a8512f17 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -166,15 +166,11 @@ your own local BBDB (@pxref{Creating BBDB Records}) @node macOS Contacts @section macOS Contacts -macOS Contacts is the rolodex-like application that ships with the -macOS operating system@footnote{Apple have changed the names of their -operating system and some applications over time. macOS used to be -called Mac OS X in the past, and the Contacts application was -previously called Address Book.}. - -EUDC considers macOS Contacts as a directory server back end just like -LDAP, though the macOS Contacts application always resides locally on -your machine. +This EUDC back end considers macOS Contacts as a directory server just +like LDAP, though the macOS Contacts application always runs locally +on your machine. The Contacts application was previously called +Address Book; the EUDC macOS Contacts back end also works on those +older versions. @node Installation commit 71d067252ce797850e67c56b46646ca5dd82064e Author: Thomas Fitzsimmons Date: Sat Sep 5 21:57:23 2020 -0400 EUDC: Fix a minor formatting issue * lisp/net/eudcb-macos-contacts.el (eudc-macos-contacts-query-internal): Move result to its own line to eliminate a lisp-mode warning. diff --git a/lisp/net/eudcb-macos-contacts.el b/lisp/net/eudcb-macos-contacts.el index e2d10e33d4..3c0d88fc23 100644 --- a/lisp/net/eudcb-macos-contacts.el +++ b/lisp/net/eudcb-macos-contacts.el @@ -96,7 +96,8 @@ RETURN-ATTRS is a list of attributes to return, defaulting to (name (nth 0 args)) (email (nth 1 args))) (setq result (cons `((name . ,name) - (email . ,email)) result)))) + (email . ,email)) + result)))) (forward-line)) result))) commit 2bba9cd409ce4b53639328e17da81db8dbda72c7 Author: Paul Eggert Date: Sat Sep 5 17:48:45 2020 -0700 Update from Gnulib This incorporates: 2020-09-05 verify: avoid __builtin_assume 2020-08-30 strerrorname_np: New module 2020-08-26 include_next, stdint, time_rz: Change configure message * lib/gnulib.mk.in: Regenerate. * lib/string.in.h, lib/verify.h, m4/include_next.m4, m4/stdint.m4: * m4/string_h.m4, m4/time_rz.m4: Copy from Gnulib. diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index f564d50122..9953198fb3 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -442,6 +442,7 @@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERRORNAME_NP = @GNULIB_STRERRORNAME_NP@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRFTIME = @GNULIB_STRFTIME@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ @@ -662,6 +663,7 @@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ @@ -965,6 +967,7 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRFTIME = @REPLACE_STRFTIME@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ @@ -2859,6 +2862,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GNULIB_STRERRORNAME_NP)/g' \ -e 's/@''GNULIB_SIGABBREV_NP''@/$(GNULIB_SIGABBREV_NP)/g' \ -e 's/@''GNULIB_SIGDESCR_NP''@/$(GNULIB_SIGDESCR_NP)/g' \ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ @@ -2883,6 +2887,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \ -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ @@ -2900,6 +2905,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ diff --git a/lib/string.in.h b/lib/string.in.h index 776133c5eb..9724addef4 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -1045,6 +1045,30 @@ _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - " # endif #endif +/* Return the name of the system error code ERRNUM. */ +#if @GNULIB_STRERRORNAME_NP@ +# if @REPLACE_STRERRORNAME_NP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strerrorname_np +# define strerrorname_np rpl_strerrorname_np +# endif +_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum)); +_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum)); +# else +# if !@HAVE_STRERRORNAME_NP@ +_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIASWARN (strerrorname_np); +#elif defined GNULIB_POSIXCHECK +# undef strerrorname_np +# if HAVE_RAW_DECL_STRERRORNAME_NP +_GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - " + "use gnulib module strerrorname_np for portability"); +# endif +#endif + /* Return an abbreviation string for the signal number SIG. */ #if @GNULIB_SIGABBREV_NP@ # if ! @HAVE_SIGABBREV_NP@ diff --git a/lib/verify.h b/lib/verify.h index ca2a154073..fa1ed717d0 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -246,13 +246,6 @@ template /* @assert.h omit start@ */ -#if defined __has_builtin -/* */ -# define _GL_HAS_BUILTIN_ASSUME __has_builtin (__builtin_assume) -#else -# define _GL_HAS_BUILTIN_ASSUME 0 -#endif - #if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)) # define _GL_HAS_BUILTIN_TRAP 1 #elif defined __has_builtin @@ -312,36 +305,14 @@ template Although assuming R can help a compiler generate better code or diagnostics, performance can suffer if R uses hard-to-optimize - features such as function calls not inlined by the compiler. */ - -/* Use __builtin_assume in preference to __builtin_unreachable, because - in clang versions 8.0.x and older, the definition based on - __builtin_assume has an effect on optimizations, whereas the definition - based on __builtin_unreachable does not. (GCC so far has only - __builtin_unreachable.) */ -#if _GL_HAS_BUILTIN_ASSUME -/* Use __builtin_constant_p to help clang's data-flow analysis for the case - assume (0). - Use a temporary variable, to avoid a clang warning - "the argument to '__builtin_assume' has side effects that will be discarded" - if R contains invocations of functions not marked as 'const'. - The type of the temporary variable can't be __typeof__ (R), because that - does not work on bit field expressions. Use '_Bool' or 'bool' as type - instead. */ -# if defined __cplusplus -# define assume(R) \ - (__builtin_constant_p (R) && !(R) \ - ? (void) __builtin_unreachable () \ - : (void) ({ bool _gl_verify_temp = (R); \ - __builtin_assume (_gl_verify_temp); })) -# else -# define assume(R) \ - (__builtin_constant_p (R) && !(R) \ - ? (void) __builtin_unreachable () \ - : (void) ({ _Bool _gl_verify_temp = (R); \ - __builtin_assume (_gl_verify_temp); })) -# endif -#elif _GL_HAS_BUILTIN_UNREACHABLE + features such as function calls not inlined by the compiler. + + Avoid Clang's __builtin_assume, as it breaks GNU Emacs master + as of 2020-08-23T21:09:49Z!eggert@cs.ucla.edu; see + . It's not known whether this breakage + is a Clang bug or an Emacs bug; play it safe for now. */ + +#if _GL_HAS_BUILTIN_UNREACHABLE # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) #elif 1200 <= _MSC_VER # define assume(R) __assume (R) diff --git a/m4/include_next.m4 b/m4/include_next.m4 index 33601aa3b4..9221d9f7d5 100644 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -1,4 +1,4 @@ -# include_next.m4 serial 25 +# include_next.m4 serial 26 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -106,19 +106,21 @@ dnl We intentionally avoid using AC_LANG_SOURCE here. AC_SUBST([INCLUDE_NEXT]) AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) AC_SUBST([PRAGMA_SYSTEM_HEADER]) - AC_CACHE_CHECK([whether system header files limit the line length], - [gl_cv_pragma_columns], - [dnl HP NonStop systems, which define __TANDEM, have this misfeature. - AC_EGREP_CPP([choke me], + + dnl HP NonStop systems, which define __TANDEM, limit the line length + dnl after including some system header files. + AC_CACHE_CHECK([whether source code line length is unlimited], + [gl_cv_source_line_length_unlimited], + [AC_EGREP_CPP([choke me], [ #ifdef __TANDEM choke me #endif ], - [gl_cv_pragma_columns=yes], - [gl_cv_pragma_columns=no]) + [gl_cv_source_line_length_unlimited=no], + [gl_cv_source_line_length_unlimited=yes]) ]) - if test $gl_cv_pragma_columns = yes; then + if test $gl_cv_source_line_length_unlimited = no; then PRAGMA_COLUMNS="#pragma COLUMNS 10000" else PRAGMA_COLUMNS= diff --git a/m4/stdint.m4 b/m4/stdint.m4 index e0fa8a51fb..d5f5d6133a 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 55 +# stdint.m4 serial 56 dnl Copyright (C) 2001-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -302,9 +302,10 @@ static const char *macro_values[] = HAVE_C99_STDINT_H=1 dnl Now see whether the system works without dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. - AC_CACHE_CHECK([whether stdint.h predates C++11], - [gl_cv_header_stdint_predates_cxx11_h], - [gl_cv_header_stdint_predates_cxx11_h=yes + dnl If not, there would be problems when stdint.h is included from C++. + AC_CACHE_CHECK([whether stdint.h works without ISO C predefines], + [gl_cv_header_stdint_without_STDC_macros], + [gl_cv_header_stdint_without_STDC_macros=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ @@ -315,13 +316,14 @@ gl_STDINT_INCLUDES intmax_t im = INTMAX_MAX; int32_t i32 = INT32_C (0x7fffffff); ]])], - [gl_cv_header_stdint_predates_cxx11_h=no])]) + [gl_cv_header_stdint_without_STDC_macros=yes]) + ]) - if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + if test $gl_cv_header_stdint_without_STDC_macros = no; then AC_DEFINE([__STDC_CONSTANT_MACROS], [1], - [Define to 1 if the system predates C++11.]) + [Define to 1 if the system predates C++11.]) AC_DEFINE([__STDC_LIMIT_MACROS], [1], - [Define to 1 if the system predates C++11.]) + [Define to 1 if the system predates C++11.]) fi AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], [gl_cv_header_stdint_width], diff --git a/m4/string_h.m4 b/m4/string_h.m4 index d7c12aaae8..29796b8629 100644 --- a/m4/string_h.m4 +++ b/m4/string_h.m4 @@ -5,7 +5,7 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 26 +# serial 27 # Written by Paul Eggert. @@ -28,7 +28,7 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY], ]], [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r - strerror_r sigabbrev_np sigdescr_np strsignal strverscmp]) + strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp]) AC_REQUIRE([AC_C_RESTRICT]) ]) @@ -44,47 +44,48 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR], AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ - GNULIB_EXPLICIT_BZERO=0; AC_SUBST([GNULIB_EXPLICIT_BZERO]) - GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) - GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) - GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) - GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) - GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) - GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) - GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) - GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) - GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) - GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) - GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) - GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) - GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) - GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) - GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) - GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) - GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) - GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) - GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) - GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) - GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) - GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) - GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) - GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) - GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) - GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) - GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) - GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) - GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) - GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) - GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) - GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) - GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) - GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) - GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) - GNULIB_SIGABBREV_NP=0;AC_SUBST([GNULIB_SIGABBREV_NP]) - GNULIB_SIGDESCR_NP=0; AC_SUBST([GNULIB_SIGDESCR_NP]) - GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) - GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) - HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) + GNULIB_EXPLICIT_BZERO=0; AC_SUBST([GNULIB_EXPLICIT_BZERO]) + GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) + GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) + GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) + GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) + GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) + GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) + GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) + GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) + GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) + GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) + GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) + GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) + GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) + GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) + GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) + GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) + GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) + GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) + GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) + GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) + GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) + GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) + GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) + GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) + GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) + GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) + GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) + GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) + GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) + GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) + GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) + GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) + GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) + GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) + GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) + GNULIB_STRERRORNAME_NP=0; AC_SUBST([GNULIB_STRERRORNAME_NP]) + GNULIB_SIGABBREV_NP=0; AC_SUBST([GNULIB_SIGABBREV_NP]) + GNULIB_SIGDESCR_NP=0; AC_SUBST([GNULIB_SIGDESCR_NP]) + GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) + GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) + HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO]) HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) @@ -104,6 +105,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R]) + HAVE_STRERRORNAME_NP=1; AC_SUBST([HAVE_STRERRORNAME_NP]) HAVE_SIGABBREV_NP=1; AC_SUBST([HAVE_SIGABBREV_NP]) HAVE_SIGDESCR_NP=1; AC_SUBST([HAVE_SIGDESCR_NP]) HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) @@ -121,6 +123,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) + REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) ]) diff --git a/m4/time_rz.m4 b/m4/time_rz.m4 index 2dd64b2848..30161c01e6 100644 --- a/m4/time_rz.m4 +++ b/m4/time_rz.m4 @@ -13,12 +13,12 @@ AC_DEFUN([gl_TIME_RZ], AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) AC_REQUIRE([AC_STRUCT_TIMEZONE]) - # Mac OS X 10.6 loops forever with some time_t values. + # On Mac OS X 10.6, localtime loops forever with some time_t values. # See Bug#27706, Bug#27736, and # https://lists.gnu.org/r/bug-gnulib/2017-07/msg00142.html - AC_CACHE_CHECK([whether localtime loops forever near extrema], - [gl_cv_func_localtime_infloop_bug], - [gl_cv_func_localtime_infloop_bug=no + AC_CACHE_CHECK([whether localtime works even near extrema], + [gl_cv_func_localtime_works], + [gl_cv_func_localtime_works=yes AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include @@ -37,10 +37,10 @@ AC_DEFUN([gl_TIME_RZ], return tm && tm->tm_isdst; ]])], [(TZ=QQQ0 ./conftest$EXEEXT) >/dev/null 2>&1 || - gl_cv_func_localtime_infloop_bug=yes], + gl_cv_func_localtime_works=no], [], - [gl_cv_func_localtime_infloop_bug="guessing no"])]) - if test "$gl_cv_func_localtime_infloop_bug" = yes; then + [gl_cv_func_localtime_works="guessing yes"])]) + if test "$gl_cv_func_localtime_works" = no; then AC_DEFINE([HAVE_LOCALTIME_INFLOOP_BUG], 1, [Define if localtime-like functions can loop forever on extreme arguments.]) commit 2c1d8397788c1385debef514c59a6461b2e5408e Author: Stefan Kangas Date: Sun Sep 6 02:21:59 2020 +0200 * lisp/svg.el: Bump package version to 1.1. diff --git a/lisp/svg.el b/lisp/svg.el index 7aadbc2359..eeb945f53b 100644 --- a/lisp/svg.el +++ b/lisp/svg.el @@ -5,7 +5,7 @@ ;; Author: Lars Magne Ingebrigtsen ;; Felix E. Klee ;; Keywords: image -;; Version: 1.0 +;; Version: 1.1 ;; Package-Requires: ((emacs "25")) ;; This file is part of GNU Emacs. commit ccd5f0d0a99f93c5507c888b5a0c1a5af2d89106 Author: Lars Ingebrigtsen Date: Sun Sep 6 02:02:42 2020 +0200 Fix eww-change-select defaults in a different way * lisp/net/eww.el (eww-change-select): Fix bug#43218 in a more safe way than the previous version. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index b800d1890f..4b897fa34e 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1450,14 +1450,13 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (cons (plist-get (cdr elem) :display) (plist-get (cdr elem) :value)))) input))) - (display - (completing-read "Change value: " options nil 'require-match - nil nil (car (rassoc (plist-get input :value) - options)))) + (display (completing-read "Change value: " options nil 'require-match)) (inhibit-read-only t)) - (plist-put input :value (cdr (assoc-string display options t))) - (goto-char - (eww-update-field display)))) + ;; If the user doesn't enter anything, don't change anything. + (when (> (length display) 0) + (plist-put input :value (cdr (assoc-string display options t))) + (goto-char + (eww-update-field display))))) (defun eww-update-field (string &optional offset) (unless offset commit 585fe00557489e49188b6a301f001ef01ff15dcb Author: Lars Ingebrigtsen Date: Sat Sep 5 23:11:43 2020 +0200 Fix up previous icomplete-show-matches-on-no-input change * lisp/icomplete.el (icomplete-completions): Ensure that the default value is cleared (bug#43120). diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 8a68df876c..ba266cfbfe 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -715,7 +715,7 @@ matches exist." (setq prospects (nreverse prospects)) ;; Return the first match if the user hits enter. (when icomplete-show-matches-on-no-input - (setq completion-content-when-empty (car prospects))) + (setq-local completion-content-when-empty (car prospects))) ;; Decorate first of the prospects. (when prospects (let ((first (copy-sequence (pop prospects)))) commit 6cf62141c4467314f67c2ef75a4bf94d41ff050f Author: Paul Eggert Date: Sat Sep 5 12:13:32 2020 -0700 Reinstall recent GC-related changes The report that they broke macOS was a false alarm, as the previous commit was also broken (Bug#43152#62). * src/alloc.c (live_string_holding, live_cons_holding) (live_symbol_holding): Count only pointers that point to a struct component, or are a tagged pointer to the start of the struct. Exception: for non-bool-vector pseudovectors, count any pointer past the header, since it’s too much of a pain to write code for every pseudovector. (live_float_holding, live_vector_pointer): New functions, which are similar about counting pointers. (live_float_p, live_large_vector_holding) (live_small_vector_pointer, mark_maybe_pointer): Use them. (mark_maybe_object, mark_maybe_objects): Remove, and remove all callers; mark_maybe_pointer now suffices. (mark_objects): New function. * src/alloc.c (mark_vectorlike, mark_face_cache): * src/eval.c (mark_specpdl): * src/fringe.c (mark_fringe_data): * src/keyboard.c (mark_kboards): Simplify by using mark_objects. * src/lisp.h (SAFE_ALLOCA_LISP_EXTRA): Clear any Lisp_Object arrays large enough to not fit into the stack, so that GC need not worry about whether they contain objects. diff --git a/src/alloc.c b/src/alloc.c index b16b2f8b93..b12922b585 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4457,9 +4457,17 @@ live_string_holding (struct mem_node *m, void *p) must not be on the free-list. */ if (0 <= offset && offset < sizeof b->strings) { - struct Lisp_String *s = p = cp -= offset % sizeof b->strings[0]; - if (s->u.s.data) - return s; + ptrdiff_t off = offset % sizeof b->strings[0]; + if (off == Lisp_String + || off == 0 + || off == offsetof (struct Lisp_String, u.s.size_byte) + || off == offsetof (struct Lisp_String, u.s.intervals) + || off == offsetof (struct Lisp_String, u.s.data)) + { + struct Lisp_String *s = p = cp -= off; + if (s->u.s.data) + return s; + } } return NULL; } @@ -4489,9 +4497,15 @@ live_cons_holding (struct mem_node *m, void *p) && (b != cons_block || offset / sizeof b->conses[0] < cons_block_index)) { - struct Lisp_Cons *s = p = cp -= offset % sizeof b->conses[0]; - if (!deadp (s->u.s.car)) - return s; + ptrdiff_t off = offset % sizeof b->conses[0]; + if (off == Lisp_Cons + || off == 0 + || off == offsetof (struct Lisp_Cons, u.s.u.cdr)) + { + struct Lisp_Cons *s = p = cp -= off; + if (!deadp (s->u.s.car)) + return s; + } } return NULL; } @@ -4522,9 +4536,23 @@ live_symbol_holding (struct mem_node *m, void *p) && (b != symbol_block || offset / sizeof b->symbols[0] < symbol_block_index)) { - struct Lisp_Symbol *s = p = cp -= offset % sizeof b->symbols[0]; - if (!deadp (s->u.s.function)) - return s; + ptrdiff_t off = offset % sizeof b->symbols[0]; + if (off == Lisp_Symbol + + /* Plain '|| off == 0' would run afoul of GCC 10.2 + -Wlogical-op, as Lisp_Symbol happens to be zero. */ + || (Lisp_Symbol != 0 && off == 0) + + || off == offsetof (struct Lisp_Symbol, u.s.name) + || off == offsetof (struct Lisp_Symbol, u.s.val) + || off == offsetof (struct Lisp_Symbol, u.s.function) + || off == offsetof (struct Lisp_Symbol, u.s.plist) + || off == offsetof (struct Lisp_Symbol, u.s.next)) + { + struct Lisp_Symbol *s = p = cp -= off; + if (!deadp (s->u.s.function)) + return s; + } } return NULL; } @@ -4536,23 +4564,70 @@ live_symbol_p (struct mem_node *m, void *p) } -/* Return true if P is a pointer to a live Lisp float on - the heap. M is a pointer to the mem_block for P. */ +/* If P is a (possibly-tagged) pointer to a live Lisp_Float on the + heap, return the address of the Lisp_Float. Otherwise, return NULL. + M is a pointer to the mem_block for P. */ -static bool -live_float_p (struct mem_node *m, void *p) +static struct Lisp_Float * +live_float_holding (struct mem_node *m, void *p) { eassert (m->type == MEM_TYPE_FLOAT); struct float_block *b = m->start; char *cp = p; ptrdiff_t offset = cp - (char *) &b->floats[0]; - /* P must point to the start of a Lisp_Float and not be - one of the unused cells in the current float block. */ - return (0 <= offset && offset < sizeof b->floats - && offset % sizeof b->floats[0] == 0 + /* P must point to (or be a tagged pointer to) the start of a + Lisp_Float and not be one of the unused cells in the current + float block. */ + if (0 <= offset && offset < sizeof b->floats) + { + int off = offset % sizeof b->floats[0]; + if ((off == Lisp_Float || off == 0) && (b != float_block - || offset / sizeof b->floats[0] < float_block_index)); + || offset / sizeof b->floats[0] < float_block_index)) + { + p = cp - off; + return p; + } + } + return NULL; +} + +static bool +live_float_p (struct mem_node *m, void *p) +{ + return live_float_holding (m, p) == p; +} + +/* Return VECTOR if P points within it, NULL otherwise. */ + +static struct Lisp_Vector * +live_vector_pointer (struct Lisp_Vector *vector, void *p) +{ + void *vvector = vector; + char *cvector = vvector; + char *cp = p; + ptrdiff_t offset = cp - cvector; + return ((offset == Lisp_Vectorlike + || offset == 0 + || (sizeof vector->header <= offset + && offset < vector_nbytes (vector) + && (! (vector->header.size & PSEUDOVECTOR_FLAG) + ? (offsetof (struct Lisp_Vector, contents) <= offset + && (((offset - offsetof (struct Lisp_Vector, contents)) + % word_size) + == 0)) + /* For non-bool-vector pseudovectors, treat any pointer + past the header as valid since it's too much of a pain + to write special-case code for every pseudovector. */ + : (! PSEUDOVECTOR_TYPEP (&vector->header, PVEC_BOOL_VECTOR) + || offset == offsetof (struct Lisp_Bool_Vector, size) + || (offsetof (struct Lisp_Bool_Vector, data) <= offset + && (((offset + - offsetof (struct Lisp_Bool_Vector, data)) + % sizeof (bits_word)) + == 0)))))) + ? vector : NULL); } /* If P is a pointer to a live, large vector-like object, return the object. @@ -4563,10 +4638,7 @@ static struct Lisp_Vector * live_large_vector_holding (struct mem_node *m, void *p) { eassert (m->type == MEM_TYPE_VECTORLIKE); - struct Lisp_Vector *vp = p; - struct Lisp_Vector *vector = large_vector_vec (m->start); - struct Lisp_Vector *next = ADVANCE (vector, vector_nbytes (vector)); - return vector <= vp && vp < next ? vector : NULL; + return live_vector_pointer (large_vector_vec (m->start), p); } static bool @@ -4596,7 +4668,7 @@ live_small_vector_holding (struct mem_node *m, void *p) { struct Lisp_Vector *next = ADVANCE (vector, vector_nbytes (vector)); if (vp < next && !PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FREE)) - return vector; + return live_vector_pointer (vector, vp); vector = next; } return NULL; @@ -4608,117 +4680,33 @@ live_small_vector_p (struct mem_node *m, void *p) return live_small_vector_holding (m, p) == p; } -/* Mark OBJ if we can prove it's a Lisp_Object. */ +/* If P points to Lisp data, mark that as live if it isn't already + marked. */ static void -mark_maybe_object (Lisp_Object obj) +mark_maybe_pointer (void *p) { + struct mem_node *m; + #if USE_VALGRIND - VALGRIND_MAKE_MEM_DEFINED (&obj, sizeof (obj)); + VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); #endif - int type_tag = XTYPE (obj); - intptr_t pointer_word_tag = LISP_WORD_TAG (type_tag), offset, ipo; - - switch (type_tag) - { - case_Lisp_Int: case Lisp_Type_Unused0: - return; - - case Lisp_Symbol: - offset = (intptr_t) lispsym; - break; - - default: - offset = 0; - break; - } - - INT_ADD_WRAPV ((intptr_t) XLP (obj), offset - pointer_word_tag, &ipo); - void *po = (void *) ipo; - /* If the pointer is in the dump image and the dump has a record of the object starting at the place where the pointer points, we definitely have an object. If the pointer is in the dump image and the dump has no idea what the pointer is pointing at, we definitely _don't_ have an object. */ - if (pdumper_object_p (po)) + if (pdumper_object_p (p)) { /* Don't use pdumper_object_p_precise here! It doesn't check the tag bits. OBJ here might be complete garbage, so we need to verify both the pointer and the tag. */ - if (pdumper_find_object_type (po) == type_tag) - mark_object (obj); - return; - } - - struct mem_node *m = mem_find (po); - - if (m != MEM_NIL) - { - bool mark_p = false; - - switch (type_tag) - { - case Lisp_String: - mark_p = m->type == MEM_TYPE_STRING && live_string_p (m, po); - break; - - case Lisp_Cons: - mark_p = m->type == MEM_TYPE_CONS && live_cons_p (m, po); - break; - - case Lisp_Symbol: - mark_p = m->type == MEM_TYPE_SYMBOL && live_symbol_p (m, po); - break; - - case Lisp_Float: - mark_p = m->type == MEM_TYPE_FLOAT && live_float_p (m, po); - break; - - case Lisp_Vectorlike: - mark_p = (m->type == MEM_TYPE_VECTOR_BLOCK - ? live_small_vector_p (m, po) - : (m->type == MEM_TYPE_VECTORLIKE - && live_large_vector_p (m, po))); - break; - - default: - eassume (false); - } - - if (mark_p) - mark_object (obj); - } -} - -void -mark_maybe_objects (Lisp_Object const *array, ptrdiff_t nelts) -{ - for (Lisp_Object const *lim = array + nelts; array < lim; array++) - mark_maybe_object (*array); -} - -/* If P points to Lisp data, mark that as live if it isn't already - marked. */ - -static void -mark_maybe_pointer (void *p) -{ - struct mem_node *m; - -#if USE_VALGRIND - VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); -#endif - - if (pdumper_object_p (p)) - { int type = pdumper_find_object_type (p); if (pdumper_valid_object_type_p (type)) mark_object (type == Lisp_Symbol ? make_lisp_symbol (p) : make_lisp_ptr (p, type)); - /* See mark_maybe_object for why we can confidently return. */ return; } @@ -4762,9 +4750,12 @@ mark_maybe_pointer (void *p) break; case MEM_TYPE_FLOAT: - if (! live_float_p (m, p)) - return; - obj = make_lisp_ptr (p, Lisp_Float); + { + struct Lisp_Float *h = live_float_holding (m, p); + if (!h) + return; + obj = make_lisp_ptr (h, Lisp_Float); + } break; case MEM_TYPE_VECTORLIKE: @@ -4849,11 +4840,6 @@ mark_memory (void const *start, void const *end) intptr_t ip; INT_ADD_WRAPV ((intptr_t) p, (intptr_t) lispsym, &ip); mark_maybe_pointer ((void *) ip); - - verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0); - if (alignof (Lisp_Object) == GC_POINTER_ALIGNMENT - || (uintptr_t) pp % alignof (Lisp_Object) == 0) - mark_maybe_object (*(Lisp_Object const *) pp); } } @@ -6261,7 +6247,6 @@ mark_vectorlike (union vectorlike_header *header) { struct Lisp_Vector *ptr = (struct Lisp_Vector *) header; ptrdiff_t size = ptr->header.size; - ptrdiff_t i; eassert (!vector_marked_p (ptr)); @@ -6276,8 +6261,7 @@ mark_vectorlike (union vectorlike_header *header) the number of Lisp_Object fields that we should trace. The distinction is used e.g. by Lisp_Process which places extra non-Lisp_Object fields at the end of the structure... */ - for (i = 0; i < size; i++) /* ...and then mark its elements. */ - mark_object (ptr->contents[i]); + mark_objects (ptr->contents, size); } /* Like mark_vectorlike but optimized for char-tables (and @@ -6376,8 +6360,7 @@ mark_face_cache (struct face_cache *c) { if (c) { - int i, j; - for (i = 0; i < c->used; ++i) + for (int i = 0; i < c->used; i++) { struct face *face = FACE_FROM_ID_OR_NULL (c->f, i); @@ -6386,8 +6369,7 @@ mark_face_cache (struct face_cache *c) if (face->font && !vectorlike_marked_p (&face->font->header)) mark_vectorlike (&face->font->header); - for (j = 0; j < LFACE_VECTOR_SIZE; ++j) - mark_object (face->lface[j]); + mark_objects (face->lface, LFACE_VECTOR_SIZE); } } } @@ -6500,6 +6482,13 @@ mark_hash_table (struct Lisp_Vector *ptr) } } +void +mark_objects (Lisp_Object *obj, ptrdiff_t n) +{ + for (ptrdiff_t i = 0; i < n; i++) + mark_object (obj[i]); +} + /* Determine type of generic Lisp_Object and mark it accordingly. This function implements a straightforward depth-first marking diff --git a/src/eval.c b/src/eval.c index 9daae92e55..126ee2e955 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3960,7 +3960,7 @@ mark_specpdl (union specbinding *first, union specbinding *ptr) break; case SPECPDL_UNWIND_ARRAY: - mark_maybe_objects (pdl->unwind_array.array, pdl->unwind_array.nelts); + mark_objects (pdl->unwind_array.array, pdl->unwind_array.nelts); break; case SPECPDL_UNWIND_EXCURSION: @@ -3974,8 +3974,7 @@ mark_specpdl (union specbinding *first, union specbinding *ptr) mark_object (backtrace_function (pdl)); if (nargs == UNEVALLED) nargs = 1; - while (nargs--) - mark_object (backtrace_args (pdl)[nargs]); + mark_objects (backtrace_args (pdl), nargs); } break; diff --git a/src/fringe.c b/src/fringe.c index c3d64fefc8..75496692d5 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -1733,11 +1733,7 @@ If nil, also continue lines which are exactly as wide as the window. */); void mark_fringe_data (void) { - int i; - - for (i = 0; i < max_fringe_bitmaps; i++) - if (!NILP (fringe_faces[i])) - mark_object (fringe_faces[i]); + mark_objects (fringe_faces, max_fringe_bitmaps); } /* Initialize this module when Emacs starts. */ diff --git a/src/keyboard.c b/src/keyboard.c index 5fa58abce1..590d183c4c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -12475,13 +12475,11 @@ keys_of_keyboard (void) void mark_kboards (void) { - KBOARD *kb; - Lisp_Object *p; - for (kb = all_kboards; kb; kb = kb->next_kboard) + for (KBOARD *kb = all_kboards; kb; kb = kb->next_kboard) { if (kb->kbd_macro_buffer) - for (p = kb->kbd_macro_buffer; p < kb->kbd_macro_ptr; p++) - mark_object (*p); + mark_objects (kb->kbd_macro_buffer, + kb->kbd_macro_ptr - kb->kbd_macro_buffer); mark_object (KVAR (kb, Voverriding_terminal_local_map)); mark_object (KVAR (kb, Vlast_command)); mark_object (KVAR (kb, Vreal_last_command)); diff --git a/src/lisp.h b/src/lisp.h index bc069ef277..88e69b9061 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3756,12 +3756,12 @@ extern AVOID memory_full (size_t); extern AVOID buffer_memory_full (ptrdiff_t); extern bool survives_gc_p (Lisp_Object); extern void mark_object (Lisp_Object); +extern void mark_objects (Lisp_Object *, ptrdiff_t); #if defined REL_ALLOC && !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC extern void refill_memory_reserve (void); #endif extern void alloc_unexec_pre (void); extern void alloc_unexec_post (void); -extern void mark_maybe_objects (Lisp_Object const *, ptrdiff_t); extern void mark_stack (char const *, char const *); extern void flush_stack_call_func1 (void (*func) (void *arg), void *arg); @@ -4873,7 +4873,10 @@ safe_free_unbind_to (ptrdiff_t count, ptrdiff_t sa_count, Lisp_Object val) (buf) = AVAIL_ALLOCA (alloca_nbytes); \ else \ { \ - (buf) = xmalloc (alloca_nbytes); \ + /* Although only the first nelt words need clearing, \ + typically EXTRA is 0 or small so just use xzalloc; \ + this is simpler and often faster. */ \ + (buf) = xzalloc (alloca_nbytes); \ record_unwind_protect_array (buf, nelt); \ } \ } while (false) commit 940ea1549117f56642fd6830bdbccf8865a932bb Author: Michael Albinus Date: Sat Sep 5 19:29:47 2020 +0200 Adapt tramp-test30-make-process * test/lisp/net/tramp-tests.el (tramp-list-tramp-buffers) (tramp-time-diff): Don't declare. (tramp-test30-make-process): Adapt test. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c170d2c6bf..3914f9ae44 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -57,9 +57,7 @@ (declare-function tramp-get-remote-perl "tramp-sh") (declare-function tramp-get-remote-stat "tramp-sh") (declare-function tramp-list-tramp-buffers "tramp-cmds") -(declare-function tramp-method-out-of-band-p "tramp-sh") (declare-function tramp-smb-get-localname "tramp-smb") -(declare-function tramp-time-diff "tramp") (defvar ange-ftp-make-backup-files) (defvar auto-save-file-name-transforms) (defvar tramp-connection-properties) @@ -4498,11 +4496,8 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." ;; Read output. (with-timeout (10 (tramp--test-timeout-handler)) (while (accept-process-output proc 0 nil t))) - (should - (string-match - (if (eq system-type 'windows-nt) - "unknown signal\n\\'" "killed.*\n\\'") - (buffer-string)))) + ;; On some MS Windows systems, it returns "unknown signal". + (should (string-match "unknown signal\\|killed" (buffer-string)))) ;; Cleanup. (ignore-errors (delete-process proc))) commit a04e76ac7d553b48bd35c1331b3e6720de3ec4cc Author: Michael Albinus Date: Sat Sep 5 19:29:12 2020 +0200 Minor improvements in Tramp error reporting * lisp/net/tramp-cmds.el (tramp-bug): Handle `tramp-suppress-trace' property. (tramp-reporter-dump-variable): Improve variable dump. * lisp/net/tramp.el (tramp--startup-hook, tramp-password-save-function): Add `tramp-suppress-trace' property. diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 52cc186ecf..827d5f60a2 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -482,9 +482,7 @@ For details, see `tramp-rename-files'." (defun tramp-bug () "Submit a bug report to the Tramp developers." (interactive) - (let ((reporter-prompt-for-summary-p t) - ;; In rare cases, it could contain the password. So we make it nil. - tramp-password-save-function) + (let ((reporter-prompt-for-summary-p t)) (reporter-submit-bug-report tramp-bug-report-address ; to-address (format "tramp (%s %s/%s)" ; package name and version @@ -492,10 +490,11 @@ For details, see `tramp-rename-files'." (sort (delq nil (mapcar (lambda (x) - (and x (boundp x) (cons x 'tramp-reporter-dump-variable))) + (and x (boundp x) (not (get x 'tramp-suppress-trace)) + (cons x 'tramp-reporter-dump-variable))) (append (mapcar #'intern (all-completions "tramp-" obarray #'boundp)) - ;; Non-tramp variables of interest. + ;; Non-Tramp variables of interest. '(shell-prompt-pattern backup-by-copying backup-by-copying-when-linked @@ -552,11 +551,11 @@ buffer in your bug report. (string-match-p (concat "[^" (bound-and-true-p mm-7bit-chars) "]") val)) (with-current-buffer reporter-eval-buffer - (set - varsym - (format - "(decode-coding-string (base64-decode-string \"%s\") 'raw-text)" - (base64-encode-string (encode-coding-string val 'raw-text))))))) + (set varsym + `(decode-coding-string + (base64-decode-string + ,(base64-encode-string (encode-coding-string val 'raw-text))) + 'raw-text))))) ;; Dump variable. (reporter-dump-variable varsym mailbuf) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 28067faba3..96446399dd 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -80,6 +80,7 @@ (eval-and-compile ;; So it's also available in tramp-loaddefs.el! (defvar tramp--startup-hook nil "Forms to be executed at the end of tramp.el.") + (put 'tramp--startup-hook 'tramp-suppress-trace t) (defmacro tramp--with-startup (&rest body) "Schedule BODY to be executed at the end of tramp.el." @@ -1241,6 +1242,7 @@ the (optional) timestamp of last activity on this connection.") "Password save function. Will be called once the password has been verified by successful authentication.") +(put 'tramp-password-save-function 'tramp-suppress-trace t) (defconst tramp-completion-file-name-handler-alist '((file-name-all-completions commit 82b695faa3c501fc59b1972c43284d7e02510d7f Author: Lars Ingebrigtsen Date: Sat Sep 5 17:24:42 2020 +0200 Revert "Display name with with spaces, but keep symbol name underneath" This reverts commit e0c77bb62c1c950a82ea0517646d989dc5c1fe27. We can't use a string with a display string here, anyway, because it's used in other contexts. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 3e239bd875..7153ba40e1 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -561,8 +561,7 @@ value unless you are sure you know what it does." (unless no-suffix (goto-char (point-max)) (insert "...")) - (propertize (symbol-name symbol) - 'display (buffer-string)))))) + (buffer-string))))) (defcustom custom-unlispify-tag-names t "Display tag names as words instead of symbols if non-nil." commit f303b64f0e1d949adaf2e6fce3d3c5a6728d898e Author: Lars Ingebrigtsen Date: Sat Sep 5 17:23:31 2020 +0200 Revert "info-lookup-symbol: Fix the suggested default value in Custom buffers" This reverts commit ccae4ea6990580e7489e7c9f958b4a094b32b8b8. We can't use a string with a display string here, anyway, because it's used in other contexts. diff --git a/lisp/info-look.el b/lisp/info-look.el index 97d4f11af8..4e379cadef 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -298,8 +298,7 @@ If optional argument QUERY is non-nil, query for the help mode." (enable-recursive-minibuffers t) (value (completing-read (if default - (format "Describe %s (default %s): " topic - (substring-no-properties default)) + (format "Describe %s (default %s): " topic default) (format "Describe %s: " topic)) completions nil nil nil 'info-lookup-history default))) (list (if (equal value "") default value) mode))) @@ -649,9 +648,6 @@ Return nil if there is nothing appropriate in the buffer near point." (> end beg))) (buffer-substring-no-properties beg end))))) (error nil))) -;; We don't need this anymore, because now Custom inserts the unlispified name -;; in the buffer. (Bug#41905) -(make-obsolete 'info-lookup-guess-custom-symbol nil "28.1") (defun info-lookup-guess-gdb-script-symbol () "Get symbol at point in GDB script buffers." @@ -1069,6 +1065,7 @@ Return nil if there is nothing appropriate in the buffer near point." :mode 'Custom-mode :ignore-case t :regexp "[^][()`'‘’,:\" \t\n]+" + :parse-rule 'info-lookup-guess-custom-symbol :other-modes '(emacs-lisp-mode)) (info-lookup-maybe-add-help commit ccae4ea6990580e7489e7c9f958b4a094b32b8b8 Author: Mauro Aranda Date: Sat Sep 5 17:07:30 2020 +0200 info-lookup-symbol: Fix the suggested default value in Custom buffers * lisp/info-look.el (info-lookup-maybe-add-help 'Custom-mode): Don't pass info-lookup-guess-custom-symbol as the :parse-rule, since we don't need it anymore. (Bug#41905) (info-lookup-guess-custom-symbol): Now unused, mark as obsolete. (info-lookup-interactive-arguments): Get rid of text properties before passing the default value to completing-read. diff --git a/lisp/info-look.el b/lisp/info-look.el index 4e379cadef..97d4f11af8 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -298,7 +298,8 @@ If optional argument QUERY is non-nil, query for the help mode." (enable-recursive-minibuffers t) (value (completing-read (if default - (format "Describe %s (default %s): " topic default) + (format "Describe %s (default %s): " topic + (substring-no-properties default)) (format "Describe %s: " topic)) completions nil nil nil 'info-lookup-history default))) (list (if (equal value "") default value) mode))) @@ -648,6 +649,9 @@ Return nil if there is nothing appropriate in the buffer near point." (> end beg))) (buffer-substring-no-properties beg end))))) (error nil))) +;; We don't need this anymore, because now Custom inserts the unlispified name +;; in the buffer. (Bug#41905) +(make-obsolete 'info-lookup-guess-custom-symbol nil "28.1") (defun info-lookup-guess-gdb-script-symbol () "Get symbol at point in GDB script buffers." @@ -1065,7 +1069,6 @@ Return nil if there is nothing appropriate in the buffer near point." :mode 'Custom-mode :ignore-case t :regexp "[^][()`'‘’,:\" \t\n]+" - :parse-rule 'info-lookup-guess-custom-symbol :other-modes '(emacs-lisp-mode)) (info-lookup-maybe-add-help commit 60e3353697efb00afd084d45dba41adcafc388f9 Author: Lucas Werkmeister Date: Sat Sep 5 16:54:45 2020 +0200 Mark sgml-basic-offset as safe for integers * lisp/textmodes/sgml-mode.el (sgml-basic-offset): Add :safe. (Bug#43215) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 1672dce4f2..04f1dddf5f 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -46,7 +46,8 @@ (defcustom sgml-basic-offset 2 "Specifies the basic indentation level for `sgml-indent-line'." - :type 'integer) + :type 'integer + :safe #'integerp) (defcustom sgml-attribute-offset 0 "Specifies a delta for attribute indentation in `sgml-indent-line'. commit 4b2371631167e509668b6268334e324fdd2f0327 Author: Lars Ingebrigtsen Date: Sat Sep 5 16:40:58 2020 +0200 Explain in the tab-always-indent doc how to make TAB insert a TAB * lisp/indent.el (tab-always-indent): Mention how to make TAB insert a TAB character always (bug#37183). diff --git a/lisp/indent.el b/lisp/indent.el index 0a0dd99ce0..9f32cedfa4 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -53,7 +53,16 @@ If `complete', TAB first tries to indent the current line, and if the line was already indented, then try to complete the thing at point. Some programming language modes have their own variable to control this, -e.g., `c-tab-always-indent', and do not respect this variable." +e.g., `c-tab-always-indent', and do not respect this variable. + +If you want the TAB key to always insert a literal TAB character, +this can't be controlled by setting this variable. Instead you +could say something like: + +\(setq overriding-terminal-local-map + (let ((map (make-sparse-keymap))) + (define-key map [?\t] 'self-insert-command) + map))" :group 'indent :type '(choice (const :tag "Always indent" t) commit 3c69864a9c9ae45680660420b25807ab14255a11 Author: Lars Ingebrigtsen Date: Sat Sep 5 15:50:40 2020 +0200 Fix default value in selects in eww * lisp/net/eww.el (eww-change-select): Make hitting RET with an empty string use a default (bug#43218). diff --git a/lisp/net/eww.el b/lisp/net/eww.el index dedf1c6271..b800d1890f 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1451,7 +1451,9 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (plist-get (cdr elem) :value)))) input))) (display - (completing-read "Change value: " options nil 'require-match)) + (completing-read "Change value: " options nil 'require-match + nil nil (car (rassoc (plist-get input :value) + options)))) (inhibit-read-only t)) (plist-put input :value (cdr (assoc-string display options t))) (goto-char commit b9bdc48b4c79c88e36216b404997084fecf1bed2 Author: Lars Ingebrigtsen Date: Sat Sep 5 15:42:26 2020 +0200 Fix in selects in eww * lisp/net/eww.el (eww-tag-select): Use all the options. This fixes the problem with elements that wrap them (bug#43217). diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 04deb5bee0..dedf1c6271 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1402,16 +1402,15 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (options nil) (start (point)) (max 0)) - (dolist (elem (dom-non-text-children dom)) - (when (eq (dom-tag elem) 'option) - (when (dom-attr elem 'selected) - (nconc menu (list :value (dom-attr elem 'value)))) - (let ((display (dom-text elem))) - (setq max (max max (length display))) - (push (list 'item - :value (dom-attr elem 'value) - :display display) - options)))) + (dolist (elem (dom-by-tag dom 'option)) + (when (dom-attr elem 'selected) + (nconc menu (list :value (dom-attr elem 'value)))) + (let ((display (dom-text elem))) + (setq max (max max (length display))) + (push (list 'item + :value (dom-attr elem 'value) + :display display) + options))) (when options (setq options (nreverse options)) ;; If we have no selected values, default to the first value. commit 81657507c296843971e4a921377451ecc3739e5e Author: Lars Ingebrigtsen Date: Sat Sep 5 14:36:29 2020 +0200 Tweak how cperl-mode fontifies hashes and arrays * lisp/progmodes/cperl-mode.el (cperl-init-faces): Fontify hashes and arrays (%foo and @foo) before the keywords, since the keyword regexps are "wider" and the hash/array regexp just match those two things (bug#22867). diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 5dee5007e2..7a1c2e4d24 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -5776,8 +5776,8 @@ indentation and initial hashes. Behaves usually outside of comment." t-font-lock-keywords) cperl-font-lock-keywords cperl-font-lock-keywords-1 cperl-font-lock-keywords-2 (append - cperl-font-lock-keywords-1 - t-font-lock-keywords-1))) + t-font-lock-keywords-1 + cperl-font-lock-keywords-1))) (if (fboundp 'ps-print-buffer) (cperl-ps-print-init)) (if (or (featurep 'choose-color) (featurep 'font-lock-extra)) (eval ; Avoid a warning commit eca6c9281f0506f9c8c866ae2025288c44ea994a Author: Lars Ingebrigtsen Date: Sat Sep 5 14:31:52 2020 +0200 Protect compilation-auto-jump against code killing the buffer * lisp/progmodes/compile.el (compilation-auto-jump): Something may have killed the buffer before the timer fired (bug#24585). diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 0dedde3d01..1b1920bf19 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1148,12 +1148,13 @@ POS and RES.") (setcdr l1 (cons (list ,key) l2))))))) (defun compilation-auto-jump (buffer pos) - (with-current-buffer buffer - (goto-char pos) - (let ((win (get-buffer-window buffer 0))) - (if win (set-window-point win pos))) - (if compilation-auto-jump-to-first-error - (compile-goto-error)))) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (goto-char pos) + (let ((win (get-buffer-window buffer 0))) + (if win (set-window-point win pos))) + (if compilation-auto-jump-to-first-error + (compile-goto-error))))) ;; This function is the central driver, called when font-locking to gather ;; all information needed to later jump to corresponding source code. commit a30268907c44bb88e601c61c1be9bd4949ad2f7d Author: Mauro Aranda Date: Sat Sep 5 14:13:03 2020 +0200 Improve call to widget-create-child-and-convert in cus-edit * lisp/cus-edit.el (custom-variable-value-create): Pass tag as the :tag property value (bug#41905). diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 59ac52f0a4..3e239bd875 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2686,7 +2686,7 @@ try matching its doc string against `custom-guess-doc-alist'." :sample-face (if obsolete 'custom-variable-obsolete 'custom-variable-tag) - tag) + :tag tag) buttons) (push (widget-create-child-and-convert widget type commit e0c77bb62c1c950a82ea0517646d989dc5c1fe27 Author: ej-32u Date: Sat Sep 5 14:12:22 2020 +0200 Display name with with spaces, but keep symbol name underneath * lisp/cus-edit.el (custom-unlispify-menu-entry): Display the pretty name, but keep the real symbol name as the value (bug#41905). Copyright-paperwork-exempt: yes diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 23ceb3a857..59ac52f0a4 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -561,7 +561,8 @@ value unless you are sure you know what it does." (unless no-suffix (goto-char (point-max)) (insert "...")) - (buffer-string))))) + (propertize (symbol-name symbol) + 'display (buffer-string)))))) (defcustom custom-unlispify-tag-names t "Display tag names as words instead of symbols if non-nil." commit 31c3f53816feb4c40c52cf2840c171a9d631de66 Author: Mauro Aranda Date: Sat Sep 5 13:53:18 2020 +0200 Preserve user customizations after disabling a theme * lisp/custom.el (enable-theme): Since we are enabling the theme, bind custom--inhibit-theme-enable to nil. Then rely on custom-push-theme to do the right thing with the theme settings and prior user settings, instead of manipulating the property here. This way, when disabling a theme, we restore user preferences, even when the values were changed outside of customize. (disable-theme): Call custom-push-theme instead of handling theme settings directly. (custom-push-theme): Avoid another instance of Bug#28904: we don't need the changed theme when the value recorded for it is going to be the same as the recorded for the user theme. * test/lisp/custom-tests.el (custom--test-theme-variables): Get rid of a portion of the test that will always fail, because the user theme has priority over every other theme. Expect the test to pass now that we preserve user customizations after disabling a theme (bug#34027). diff --git a/lisp/custom.el b/lisp/custom.el index 7581457ce8..cc445fe765 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -907,7 +907,15 @@ See `custom-known-themes' for a list of known themes." (boundp symbol)) (let ((sv (get symbol 'standard-value)) (val (symbol-value symbol))) - (unless (and sv (equal (eval (car sv)) val)) + (unless (or + ;; We only do this trick if the current value + ;; is different from the standard value. + (and sv (equal (eval (car sv)) val)) + ;; And we don't do it if we would end up recording + ;; the same value for the user theme. This way we avoid + ;; having ((user VALUE) (changed VALUE)). That would be + ;; useless, because we don't disable the user theme. + (and (eq theme 'user) (equal (custom-quote val) value))) (setq old `((changed ,(custom-quote val)))))))) (put symbol prop (cons (list theme value) old))) (put theme 'theme-settings @@ -1368,13 +1376,14 @@ function runs. To disable other themes, use `disable-theme'." obarray (lambda (sym) (get sym 'theme-settings)) t)))) (unless (custom-theme-p theme) (error "Undefined Custom theme %s" theme)) - (let ((settings (get theme 'theme-settings))) + (let ((settings (get theme 'theme-settings)) ; '(prop symbol theme value) + ;; We are enabling the theme, so don't inhibit enabling it. (Bug#34027) + (custom--inhibit-theme-enable nil)) ;; Loop through theme settings, recalculating vars/faces. (dolist (s settings) (let* ((prop (car s)) - (symbol (cadr s)) - (spec-list (get symbol prop))) - (put symbol prop (cons (cddr s) (assq-delete-all theme spec-list))) + (symbol (cadr s))) + (custom-push-theme prop symbol theme 'set (nth 3 s)) (cond ((eq prop 'theme-face) (custom-theme-recalc-face symbol)) @@ -1443,7 +1452,7 @@ See `custom-enabled-themes' for a list of enabled themes." (let* ((prop (car s)) (symbol (cadr s)) (val (assq-delete-all theme (get symbol prop)))) - (put symbol prop val) + (custom-push-theme prop symbol theme 'reset) (cond ((eq prop 'theme-value) (custom-theme-recalc-variable symbol)) diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el index 766e484498..7853c84bb6 100644 --- a/test/lisp/custom-tests.el +++ b/test/lisp/custom-tests.el @@ -99,7 +99,6 @@ ;; This is demonstrating bug#34027. (ert-deftest custom--test-theme-variables () "Test variables setting with enabling / disabling a custom theme." - :expected-result :failed ;; We load custom-resources/custom--test-theme.el. (let ((custom-theme-load-path `(,(expand-file-name "custom-resources" (file-name-directory #$))))) @@ -115,15 +114,10 @@ (should (equal custom--test-user-option 'baz)) (should (equal custom--test-variable 'baz)) + ;; Enable and then disable. (enable-theme 'custom--test) - ;; The variables have the theme values. - (should (equal custom--test-user-option 'bar)) - (should (equal custom--test-variable 'bar)) - (disable-theme 'custom--test) ;; The variables should have the changed values, by reverting. - ;; This doesn't work as expected. Instead, they have their - ;; initial values `foo'. (should (equal custom--test-user-option 'baz)) (should (equal custom--test-variable 'baz)))) commit 22570d18bab6614ea21ea4fd9156eeb684194f6e Author: Andrew G Cohen Date: Sat Sep 5 16:47:06 2020 +0800 ; Document new gnus-summary-line-format items * lisp/gnus/gnus.el (gnus-summary-line-format): Include %Z, %G, and %g in the docstring. * doc/misc/gnus.texi (Summary Buffer Lines): Document %Z, %G, and %g specifications. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 593f113ac1..de5e8f33b5 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -4968,6 +4968,15 @@ The address (from the @code{From} header). This works the same way as the @code{a} spec. @item L Number of lines in the article. +@item Z +Retrieval Score Value (RSV) of the article; nil if not in an nnselect +group. +@item G +Originating group name of the article; nil if not in an nnselect +group. +@item g +Short form of the originating group name of the article; nil if not in +an nnselect group. @item c Number of characters in the article. This specifier is not supported in some methods (like nnfolder). diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 4e3fc9868b..561e6b8cf4 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -2705,6 +2705,11 @@ with some simple extensions. %k Pretty-printed version of the above (string) For example, \"1.2k\" or \"0.4M\". %L Number of lines in the article (integer) +%Z RSV of the article; nil if not in an nnselect group (integer) +%G Originating group name for the article; nil if not + in an nnselect group (string) +%g Short from of the originating group name for the article; + nil if not in an nnselect group (string) %I Indentation based on thread level (a string of spaces) %B A complex trn-style thread tree (string)