commit 8797e514ab68c12ed05d3af88e6baba64bf08f4d (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sat Feb 25 15:38:38 2023 -0800 Disable xattr test on MS-Windows. * nt/mingw-cfg.site (enable_xattr): Set to "no". (Bug#61782) diff --git a/nt/mingw-cfg.site b/nt/mingw-cfg.site index 7ca19cbad06..425eaace30d 100644 --- a/nt/mingw-cfg.site +++ b/nt/mingw-cfg.site @@ -170,3 +170,6 @@ gl_cv_func_free_preserves_errno=yes # Don't build the Gnulib nanosleep module: it requires W2K or later, # and MinGW does have nanosleep. gl_cv_func_nanosleep=yes +# Suppress configure-time diagnostic from unnecessary libxattr check, +# as xattr will not be supported here. +enable_xattr=no commit a5be840c7b72592b8e6ba894b1be8e643ce3df0f Author: Po Lu Date: Sun Feb 26 14:42:14 2023 +0800 Fix the MS-DOS build * msdos/sedlibmk.inp: Update getopt.h conditions. diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 634bf999e50..c3f410bd74d 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -428,6 +428,8 @@ s/= @GL_GENERATE_STDINT_H_CONDITION@/= 1/ s/= @GL_GENERATE_LIMITS_H_CONDITION@/= 1/ s/= @GL_GENERATE_ERRNO_H_CONDITION@/= / s/= @GL_GENERATE_LIMITS_H_CONDITION@/= / +s/= @GL_GENERATE_GETOPT_CDEFS_H_CONDITION@/= 1/ +s/= @GL_GENERATE_GETOPT_H_CONDITION@/= 1/ s/= @GL_GENERATE_GMP_H_CONDITION@/= 1/ s/= @GL_GENERATE_GMP_GMP_H_CONDITION@/= / s/= @GL_GENERATE_MINI_GMP_H_CONDITION@/= 1/ commit 580bb8f46c413506e53f77a25fbdea3322922f88 Merge: 9565e34762a 3cae0e3d96a Author: Stefan Kangas Date: Sun Feb 26 06:30:12 2023 +0100 Merge from origin/emacs-29 3cae0e3d96a python-ts-mode: Fix single-quote string fontification 68d753e3712 ; * etc/NEWS: Fix typos. ab0cc4e7811 Fix infloop in bidi.c 3b8b23f66df ; Fix doc string of 'emacs-lisp-byte-compile' # Conflicts: # etc/NEWS commit 9565e34762af6e0db51e9ae01683eb5d4c97ff3d Author: Jim Porter Date: Fri Feb 24 21:49:54 2023 -0800 Be more cautious in completing Eshell variable assignments Previously, Eshell treated cases like the second argument in "tar --directory=dir" as a variable assignment, but that prevented 'pcomplete/tar' from implementing its own completion for that argument (bug#61778). * lisp/eshell/esh-var.el (eshell-complete-variable-assignment): Only handle completion when all initial arguments are variable assignments. * test/lisp/eshell/em-cmpl-tests.el (em-cmpl-test/variable-assign-completion/non-assignment): New test. diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 0031324b537..5d6299af564 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -862,11 +862,19 @@ eshell-variables-list (defun eshell-complete-variable-assignment () "If there is a variable assignment, allow completion of entries." - (let ((arg (pcomplete-actual-arg)) pos) - (when (string-match (concat "\\`" eshell-variable-name-regexp "=") arg) - (setq pos (match-end 0)) - (if (string-match "\\(:\\)[^:]*\\'" arg) - (setq pos (match-end 1))) + (catch 'not-assignment + ;; The current argument can only be a variable assignment if all + ;; arguments leading up to it are also variable assignments. See + ;; `eshell-handle-local-variables'. + (dotimes (offset (1+ pcomplete-index)) + (unless (string-match (concat "\\`" eshell-variable-name-regexp "=") + (pcomplete-actual-arg 'first offset)) + (throw 'not-assignment nil))) + ;; We have a variable assignment. Handle it. + (let ((arg (pcomplete-actual-arg)) + (pos (match-end 0))) + (when (string-match "\\(:\\)[^:]*\\'" arg) + (setq pos (match-end 1))) (setq pcomplete-stub (substring arg pos)) (throw 'pcomplete-completions (pcomplete-entries))))) diff --git a/test/lisp/eshell/em-cmpl-tests.el b/test/lisp/eshell/em-cmpl-tests.el index ecab7332822..be2199c0464 100644 --- a/test/lisp/eshell/em-cmpl-tests.el +++ b/test/lisp/eshell/em-cmpl-tests.el @@ -217,6 +217,20 @@ em-cmpl-test/variable-assign-completion (should (equal (eshell-insert-and-complete "VAR=f") "VAR=file.txt "))))) +(ert-deftest em-cmpl-test/variable-assign-completion/non-assignment () + "Test completion of things that look like variable assignment, but aren't. +For example, the second argument in \"tar --directory=dir\" looks +like it could be a variable assignment, but it's not. We should +let `pcomplete-tar' handle it instead. + +See ." + (with-temp-eshell + (ert-with-temp-directory default-directory + (write-region nil nil (expand-file-name "file.txt")) + (make-directory "dir") + (should (equal (eshell-insert-and-complete "tar --directory=") + "tar --directory=dir/"))))) + (ert-deftest em-cmpl-test/user-ref-completion () "Test completion of user references like \"~user\". See ." commit 2baf08683fcf4b6b1ad65a6dc239b889d78a74b2 Author: Stefan Monnier Date: Sat Feb 25 22:34:02 2023 -0500 (bytecomp-warn--ignore): New test Add tests for the interaction of `ignore` with warnings. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-warn--ignore): New test. (bytecomp--with-warning-test): Really make it a function. diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 00abe730948..185abaf5c22 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -888,8 +888,6 @@ bytecomp-tests--warnings (defun bytecomp--with-warning-test (re-warning form) (declare (indent 1)) - `(bytecomp--with-warning-test-1 ,re-warning ,form)) -(defun bytecomp--with-warning-test-1 (re-warning form) (with-current-buffer (get-buffer-create "*Compile-Log*") (let ((inhibit-read-only t)) (erase-buffer)) (let ((text-quoting-style 'grave) @@ -901,6 +899,16 @@ bytecomp--with-warning-test-1 (should (re-search-forward (string-replace " " "[ \n]+" re-warning)))))))) +(ert-deftest bytecomp-warn--ignore () + (bytecomp--with-warning-test "unused" + '(lambda (y) 6)) + (bytecomp--with-warning-test "\\`\\'" ;No warning! + '(lambda (y) (ignore y) 6)) + (bytecomp--with-warning-test "assq" + '(lambda (x y) (progn (assq x y) 5))) + (bytecomp--with-warning-test "\\`\\'" ;No warning! + '(lambda (x y) (progn (ignore (assq x y)) 5)))) + (ert-deftest bytecomp-warn-wrong-args () (bytecomp--with-warning-test "remq.*3.*2" '(remq 1 2 3))) commit b26d0dd58371f19fec44e9c5d8a64697ee06d8b5 Author: Paul Eggert Date: Sat Feb 25 17:13:00 2023 -0800 Omit no-longer-needed SEEK_END workaround * lib-src/ebrowse.c (SEEK_END): Remove; no longer needed on any supported SunOS version. diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 469e90d04bb..371fa6c938b 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -31,11 +31,6 @@ Copyright (C) 1992-2023 Free Software Foundation, Inc. #include #include -/* The SunOS compiler doesn't have SEEK_END. */ -#ifndef SEEK_END -#define SEEK_END 2 -#endif - /* Files are read in chunks of this number of bytes. */ enum { READ_CHUNK_SIZE = 100 * 1024 }; commit 6a3a729705f74f630d0a98344531f39d051b543e Author: Paul Eggert Date: Sat Feb 25 17:01:22 2023 -0800 Update from Gnulib by running admin/merge-gnulib diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h index 3a2fde5ad4f..095e3930feb 100644 --- a/lib/getopt-pfx-core.h +++ b/lib/getopt-pfx-core.h @@ -47,7 +47,7 @@ #define _GETOPT_PFX_CORE_H 1 # define optind __GETOPT_ID (optind) # define optopt __GETOPT_ID (optopt) -/* Work around a a problem on macOS, which declares getopt with a +/* Work around a problem on macOS, which declares getopt with a trailing __DARWIN_ALIAS(getopt) that would expand to something like __asm("_" "rpl_getopt" "$UNIX2003") were it not for the following hack to suppress the macOS declaration . */ diff --git a/lib/limits.in.h b/lib/limits.in.h index eaeac472299..a01b4c6a280 100644 --- a/lib/limits.in.h +++ b/lib/limits.in.h @@ -119,11 +119,14 @@ #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) /* Macros specified by C23. */ -#if (! defined BOOL_WIDTH \ - && (defined _GNU_SOURCE \ - || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__))) -# define BOOL_MAX 1 -# define BOOL_WIDTH 1 +#if (defined _GNU_SOURCE \ + || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__)) +# if ! defined BOOL_WIDTH +# define BOOL_WIDTH 1 +# define BOOL_MAX 1 +# elif ! defined BOOL_MAX +# define BOOL_MAX ((((1U << (BOOL_WIDTH - 1)) - 1) << 1) + 1) +# endif #endif #endif /* _@GUARD_PREFIX@_LIMITS_H */ diff --git a/lib/string.in.h b/lib/string.in.h index aa088213927..b6bf432e1f1 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -126,7 +126,11 @@ #define _@GUARD_PREFIX@_STRING_H # if (@REPLACE_FREE@ && !defined free \ && !(defined __cplusplus && defined GNULIB_NAMESPACE)) /* We can't do '#define free rpl_free' here. */ +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_EXTERN_C void rpl_free (void *) throw (); +# else _GL_EXTERN_C void rpl_free (void *); +# endif # undef _GL_ATTRIBUTE_DEALLOC_FREE # define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1) # else diff --git a/lib/unistd.in.h b/lib/unistd.in.h index bfc501e5a7d..8ba9867894e 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -40,6 +40,24 @@ # undef _GL_INCLUDING_UNISTD_H #endif +/* Avoid lseek bugs in FreeBSD, macOS . + This bug is fixed after FreeBSD 13; see . + Use macOS "9999" to stand for a future fixed macOS version. */ +#if defined __FreeBSD__ && __FreeBSD__ < 14 +# undef SEEK_DATA +# undef SEEK_HOLE +#elif defined __APPLE__ && defined __MACH__ && defined SEEK_DATA +# ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ +# include +# endif +# if (!defined MAC_OS_X_VERSION_MIN_REQUIRED \ + || MAC_OS_X_VERSION_MIN_REQUIRED < 99990000) +# include /* It also defines the two macros. */ +# undef SEEK_DATA +# undef SEEK_HOLE +# endif +#endif + /* Get all possible declarations of gethostname(). */ #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ && !defined _GL_INCLUDING_WINSOCK2_H diff --git a/lib/verify.h b/lib/verify.h index 8f786af7f5a..f0b3fc5851b 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -265,6 +265,8 @@ #define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \ # define _GL_SA3 static_assert # define _GL_SA_PICK(x1,x2,x3,x4,...) x4 # define static_assert(...) _GL_EXPAND(_GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)) (__VA_ARGS__) +/* Avoid "fatal error C1189: #error: The C++ Standard Library forbids macroizing keywords." */ +# define _ALLOW_KEYWORD_MACROS 1 # else # define static_assert _Static_assert /* C11 requires this #define. */ # endif diff --git a/m4/assert_h.m4 b/m4/assert_h.m4 index 3801452ef0d..d255855d313 100644 --- a/m4/assert_h.m4 +++ b/m4/assert_h.m4 @@ -46,10 +46,13 @@ AC_DEFUN gl_NEXT_HEADERS([assert.h])]) dnl The "zz" puts this toward config.h's end, to avoid potential - dnl collisions with other definitions. #undef assert so that - dnl programs are not tempted to use it without specifically - dnl including assert.h. Break the #undef apart with a comment - dnl so that 'configure' does not comment it out. + dnl collisions with other definitions. + dnl #undef assert so that programs are not tempted to use it without + dnl specifically including assert.h. + dnl #undef __ASSERT_H__ so that on IRIX, when programs later include + dnl , this include actually defines assert. + dnl Break the #undef_s apart with a comment so that 'configure' does + dnl not comment them out. AH_VERBATIM([zzstatic_assert], [#if (!defined HAVE_C_STATIC_ASSERT && !defined assert \ && (!defined __cplusplus \ @@ -57,6 +60,9 @@ AC_DEFUN && __GNUG__ < 6 && __clang_major__ < 6))) #include #undef/**/assert + #ifdef __sgi + #undef/**/__ASSERT_H__ + #endif /* Solaris 11.4 defines static_assert as a macro with 2 arguments. We need it also to be invocable with a single argument. */ #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus diff --git a/m4/fdopendir.m4 b/m4/fdopendir.m4 index 2c975397118..dfcc46c03e2 100644 --- a/m4/fdopendir.m4 +++ b/m4/fdopendir.m4 @@ -1,4 +1,4 @@ -# serial 14 +# serial 15 # See if we need to provide fdopendir. dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. @@ -49,12 +49,12 @@ AC_DEFUN [gl_cv_func_fdopendir_works=yes], [gl_cv_func_fdopendir_works=no], [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;; - # Guess yes on musl systems. - *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;; + # Guess yes on musl systems. + *-musl* | midipix*) gl_cv_func_fdopendir_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;; esac ])]) case "$gl_cv_func_fdopendir_works" in diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index c0181abdc50..c84a2afd9c5 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 80 +# gnulib-common.m4 serial 82 dnl Copyright (C) 2007-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, @@ -356,7 +356,7 @@ AC_DEFUN [[__maybe_unused__]] nevertheless produces a warning. */ #ifndef _GL_ATTRIBUTE_MAYBE_UNUSED # if defined __clang__ && defined __cplusplus -# if __clang_major__ >= 10 +# if !defined __apple_build_version__ && __clang_major__ >= 10 # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] # endif # elif defined __has_c_attribute @@ -1095,6 +1095,113 @@ AC_DEFUN m4_popdef([gl_header_name]) ]) +dnl Preparations for gl_CHECK_FUNCS_MACOS. +AC_DEFUN([gl_PREPARE_CHECK_FUNCS_MACOS], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_COMPILER_CLANG]) + AC_CACHE_CHECK([for compiler option needed when checking for future declarations], + [gl_cv_compiler_check_future_option], + [case "$host_os" in + dnl This is only needed on macOS. + darwin*) + if test $gl_cv_compiler_clang = yes; then + dnl Test whether the compiler supports the option + dnl '-Werror=unguarded-availability-new'. + save_ac_compile="$ac_compile" + ac_compile="$ac_compile -Werror=unguarded-availability-new" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])], + [gl_cv_compiler_check_future_option='-Werror=unguarded-availability-new'], + [gl_cv_compiler_check_future_option=none]) + ac_compile="$save_ac_compile" + else + gl_cv_compiler_check_future_option=none + fi + ;; + *) gl_cv_compiler_check_future_option=none ;; + esac + ]) +]) + +dnl Pieces of the expansion of +dnl gl_CHECK_FUNCS_ANDROID +dnl gl_CHECK_FUNCS_MACOS +dnl gl_CHECK_FUNCS_ANDROID_MACOS + +AC_DEFUN([gl_CHECK_FUNCS_DEFAULT_CASE], +[ + *) + AC_CHECK_FUNC([$1]) + [gl_cv_onwards_func_][$1]=$[ac_cv_func_][$1] + ;; +]) + +AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_ANDROID], +[ + linux*-android*) + AC_CHECK_DECL([$1], , , [$2]) + if test $[ac_cv_have_decl_][$1] = yes; then + AC_CHECK_FUNC([[$1]]) + if test $[ac_cv_func_][$1] = yes; then + [gl_cv_onwards_func_][$1]=yes + else + dnl The function is declared but does not exist. This should not + dnl happen normally. But anyway, we know that a future version + dnl of Android will have the function. + [gl_cv_onwards_func_][$1]='future OS version' + fi + else + [gl_cv_onwards_func_][$1]='future OS version' + fi + ;; +]) + +AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_MACOS], +[ + darwin*) + if test "x$gl_cv_compiler_check_future_option" != "xnone"; then + dnl Use a compile test, not a link test. + save_ac_compile="$ac_compile" + ac_compile="$ac_compile $gl_cv_compiler_check_future_option" + save_ac_compile_for_check_decl="$ac_compile_for_check_decl" + ac_compile_for_check_decl="$ac_compile_for_check_decl $gl_cv_compiler_check_future_option" + unset [ac_cv_have_decl_][$1] + AC_CHECK_DECL([$1], , , [$2]) + ac_compile="$save_ac_compile" + ac_compile_for_check_decl="$save_ac_compile_for_check_decl" + [ac_cv_func_][$1]="$[ac_cv_have_decl_][$1]" + if test $[ac_cv_func_][$1] = yes; then + [gl_cv_onwards_func_][$1]=yes + else + unset [ac_cv_have_decl_][$1] + AC_CHECK_DECL([$1], , , [$2]) + if test $[ac_cv_have_decl_][$1] = yes; then + [gl_cv_onwards_func_][$1]='future OS version' + else + [gl_cv_onwards_func_][$1]=no + fi + fi + else + AC_CHECK_FUNC([$1]) + [gl_cv_onwards_func_][$1]=$[ac_cv_func_][$1] + fi + ;; +]) + +AC_DEFUN([gl_CHECK_FUNCS_SET_RESULTS], +[ + case "$[gl_cv_onwards_func_][$1]" in + future*) [ac_cv_func_][$1]=no ;; + *) [ac_cv_func_][$1]=$[gl_cv_onwards_func_][$1] ;; + esac + if test $[ac_cv_func_][$1] = yes; then + AC_DEFINE([HAVE_]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ]), + [1], [Define to 1 if you have the `$1' function.]) + fi +]) + dnl gl_CHECK_FUNCS_ANDROID([func], [[#include ]]) dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem dnl on Android. @@ -1137,39 +1244,87 @@ AC_DEFUN [[gl_cv_onwards_func_][$1]], [gl_SILENT([ case "$host_os" in - linux*-android*) - AC_CHECK_DECL([$1], , , [$2]) - if test $[ac_cv_have_decl_][$1] = yes; then - AC_CHECK_FUNC([[$1]]) - if test $[ac_cv_func_][$1] = yes; then - [gl_cv_onwards_func_][$1]=yes - else - dnl The function is declared but does not exist. This should not - dnl happen normally. But anyway, we know that a future version - dnl of Android will have the function. - [gl_cv_onwards_func_][$1]='future OS version' - fi - else - [gl_cv_onwards_func_][$1]='future OS version' - fi - ;; - *) - AC_CHECK_FUNC([$1]) - [gl_cv_onwards_func_][$1]=$[ac_cv_func_][$1] - ;; + gl_CHECK_FUNCS_CASE_FOR_ANDROID([$1], [$2]) + gl_CHECK_FUNCS_DEFAULT_CASE([$1]) esac ]) ]) - case "$[gl_cv_onwards_func_][$1]" in - future*) [ac_cv_func_][$1]=no ;; - *) [ac_cv_func_][$1]=$[gl_cv_onwards_func_][$1] ;; - esac - if test $[ac_cv_func_][$1] = yes; then - AC_DEFINE([HAVE_]m4_translit([[$1]], - [abcdefghijklmnopqrstuvwxyz], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ]), - [1], [Define to 1 if you have the `$1' function.]) - fi + gl_CHECK_FUNCS_SET_RESULTS([$1]) +]) + +dnl gl_CHECK_FUNCS_MACOS([func], [[#include ]]) +dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem +dnl on macOS. +dnl +dnl When code is compiled on macOS, it is in the context of a certain minimum +dnl macOS version, that can be set through the option '-mmacosx-version-min='. +dnl In other words, you don't compile for a specific version of macOS. You +dnl compile for all versions of macOS, onwards from the given version. +dnl Thus, the question "does the OS have the function func" has three possible +dnl answers: +dnl - yes, in all versions starting from the given version, +dnl - no, in no version, +dnl - not in the given version, but in a later version of macOS. +dnl +dnl In detail, this works as follows: +dnl If func was added to, say, macOS version 13, then the libc has the +dnl symbol func always, whereas the header file declares func +dnl conditionally with a special availability attribute: +dnl ... func (...) __attribute__((availability(macos,introduced=13.0))); +dnl Thus, when compiling with "clang mmacosx-version-min=13", there is no +dnl warning about the use of func, and the resulting binary +dnl - runs fine on macOS 13, +dnl - aborts with a dyld "Symbol not found" message on macOS 12. +dnl Whereas, when compiling with "clang mmacosx-version-min=12", there is a +dnl warning: 'func' is only available on macOS 13.0 or newer +dnl [-Wunguarded-availability-new], +dnl and the resulting binary +dnl - runs fine on macOS 13, +dnl - crashes with a SIGSEGV (signal 11) on macOS 12. +dnl +dnl This macro sets two variables: +dnl - gl_cv_onwards_func_ to yes / no / "future OS version" +dnl - ac_cv_func_ to yes / no / no +dnl The first variable allows to distinguish all three cases. +dnl The second variable is set, so that an invocation +dnl gl_CHECK_FUNCS_MACOS([func], [[#include ]]) +dnl can be used as a drop-in replacement for +dnl AC_CHECK_FUNCS([func]). +AC_DEFUN([gl_CHECK_FUNCS_MACOS], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_PREPARE_CHECK_FUNCS_MACOS]) + AC_CACHE_CHECK([for [$1]], + [[gl_cv_onwards_func_][$1]], + [gl_SILENT([ + case "$host_os" in + gl_CHECK_FUNCS_CASE_FOR_MACOS([$1], [$2]) + gl_CHECK_FUNCS_DEFAULT_CASE([$1]) + esac + ]) + ]) + gl_CHECK_FUNCS_SET_RESULTS([$1]) +]) + +dnl gl_CHECK_FUNCS_ANDROID_MACOS([func], [[#include ]]) +dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem +dnl on Android and on macOS. +dnl It is the combination of gl_CHECK_FUNCS_ANDROID and gl_CHECK_FUNCS_MACOS. +AC_DEFUN([gl_CHECK_FUNCS_ANDROID_MACOS], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_PREPARE_CHECK_FUNCS_MACOS]) + AC_CACHE_CHECK([for [$1]], + [[gl_cv_onwards_func_][$1]], + [gl_SILENT([ + case "$host_os" in + gl_CHECK_FUNCS_CASE_FOR_ANDROID([$1], [$2]) + gl_CHECK_FUNCS_CASE_FOR_MACOS([$1], [$2]) + gl_CHECK_FUNCS_DEFAULT_CASE([$1]) + esac + ]) + ]) + gl_CHECK_FUNCS_SET_RESULTS([$1]) ]) dnl Expands to some code for use in .c programs that, on native Windows, defines diff --git a/m4/limits-h.m4 b/m4/limits-h.m4 index 5088fa16fd3..4f8ce41098a 100644 --- a/m4/limits-h.m4 +++ b/m4/limits-h.m4 @@ -23,6 +23,7 @@ AC_DEFUN_ONCE int wb = WORD_BIT; int ullw = ULLONG_WIDTH; int bw = BOOL_WIDTH; + int bm = BOOL_MAX; ]])], [gl_cv_header_limits_width=yes], [gl_cv_header_limits_width=no])]) diff --git a/m4/lstat.m4 b/m4/lstat.m4 index 7e667fb187a..2bc46697934 100644 --- a/m4/lstat.m4 +++ b/m4/lstat.m4 @@ -1,4 +1,4 @@ -# serial 33 +# serial 34 # Copyright (C) 1997-2001, 2003-2023 Free Software Foundation, Inc. # @@ -56,6 +56,9 @@ AC_DEFUN linux-* | linux) # Guess yes on Linux systems. gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + midipix*) + # Guess yes on systems that emulate the Linux system calls. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; *-gnu* | gnu*) # Guess yes on glibc systems. gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; diff --git a/m4/malloc.m4 b/m4/malloc.m4 index 554029243d1..bc580176f5f 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,4 +1,4 @@ -# malloc.m4 serial 28 +# malloc.m4 serial 29 dnl Copyright (C) 2007, 2009-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, @@ -25,7 +25,7 @@ AC_DEFUN [case "$host_os" in # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | gnu* | *-musl* | midnightbsd* \ + | gnu* | *-musl* | midipix* | midnightbsd* \ | hpux* | solaris* | cygwin* | mingw* | msys* ) ac_cv_func_malloc_0_nonnull="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. diff --git a/m4/pselect.m4 b/m4/pselect.m4 index 9f2b282cee0..6c3d1b8f97f 100644 --- a/m4/pselect.m4 +++ b/m4/pselect.m4 @@ -1,4 +1,4 @@ -# pselect.m4 serial 10 +# pselect.m4 serial 11 dnl Copyright (C) 2011-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, @@ -54,6 +54,8 @@ AC_DEFUN case "$host_os" in # Guess yes on Linux systems. linux-* | linux) gl_cv_func_pselect_detects_ebadf="guessing yes" ;; + # Guess yes on systems that emulate the Linux system calls. + midipix*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;; # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. diff --git a/m4/readlink.m4 b/m4/readlink.m4 index 078b93aa9dc..f1d41d2b113 100644 --- a/m4/readlink.m4 +++ b/m4/readlink.m4 @@ -1,4 +1,4 @@ -# readlink.m4 serial 16 +# readlink.m4 serial 17 dnl Copyright (C) 2003, 2007, 2009-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, @@ -38,6 +38,9 @@ AC_DEFUN # Guess yes on Linux or glibc systems. linux-* | linux | *-gnu* | gnu*) gl_cv_func_readlink_trailing_slash="guessing yes" ;; + # Guess yes on systems that emulate the Linux system calls. + midipix*) + gl_cv_func_readlink_trailing_slash="guessing yes" ;; # Guess no on AIX or HP-UX. aix* | hpux*) gl_cv_func_readlink_trailing_slash="guessing no" ;; @@ -75,6 +78,9 @@ AC_DEFUN # Guess yes on Linux or glibc systems. linux-* | linux | *-gnu* | gnu*) gl_cv_func_readlink_truncate="guessing yes" ;; + # Guess yes on systems that emulate the Linux system calls. + midipix*) + gl_cv_func_readlink_truncate="guessing yes" ;; # Guess no on AIX or HP-UX. aix* | hpux*) gl_cv_func_readlink_truncate="guessing no" ;; diff --git a/m4/realloc.m4 b/m4/realloc.m4 index d22138fc7ac..26053914cbe 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -1,4 +1,4 @@ -# realloc.m4 serial 26 +# realloc.m4 serial 27 dnl Copyright (C) 2007, 2009-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, @@ -25,7 +25,7 @@ AC_DEFUN [case "$host_os" in # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | gnu* | *-musl* | midnightbsd* \ + | gnu* | *-musl* | midipix* | midnightbsd* \ | hpux* | solaris* | cygwin* | mingw* | msys* ) ac_cv_func_realloc_0_nonnull="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. diff --git a/m4/symlink.m4 b/m4/symlink.m4 index 7796ec8bbc0..52d6c115ca5 100644 --- a/m4/symlink.m4 +++ b/m4/symlink.m4 @@ -1,4 +1,4 @@ -# serial 9 +# serial 10 # See if we need to provide symlink replacement. dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. @@ -38,6 +38,8 @@ AC_DEFUN [case "$host_os" in # Guess yes on Linux systems. linux-* | linux) gl_cv_func_symlink_works="guessing yes" ;; + # Guess yes on systems that emulate the Linux system calls. + midipix*) gl_cv_func_symlink_works="guessing yes" ;; # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_symlink_works="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. commit 3cae0e3d96a5436735ab34327fc5c20e0cc864ee (refs/remotes/origin/emacs-29) Author: Dmitry Gutov Date: Sun Feb 26 03:09:29 2023 +0200 python-ts-mode: Fix single-quote string fontification * lisp/progmodes/python.el (python--treesit-fontify-string): Look for ', not just ", as opening delimiter (bug#61796). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 8220e3086fd..5aab31c3ea8 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1070,7 +1070,7 @@ python--treesit-fontify-string ;; Don't highlight string prefixes like f/r/b. (save-excursion (goto-char string-beg) - (when (search-forward "\"" string-end t) + (when (re-search-forward "[\"']" string-end t) (setq string-beg (match-beginning 0)))) (treesit-fontify-with-override string-beg string-end face override start end))) commit e91d29f0048d49c4f186e76b8d55cf39e7e77d63 Author: Stefan Monnier Date: Sat Feb 25 17:45:40 2023 -0500 bytecomp--with-warning-test: Make it a function * lisp/emacs-lisp/bytecomp.el (bytecomp--with-warning-test): Make it a function. diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 4b0a714e52d..00abe730948 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -886,19 +886,20 @@ bytecomp-tests--warnings ;; Should not warn that mt--test2 is not known to be defined. (should-not (re-search-forward "my--test2" nil t)))) -(defmacro bytecomp--with-warning-test (re-warning form) +(defun bytecomp--with-warning-test (re-warning form) (declare (indent 1)) - `(with-current-buffer (get-buffer-create "*Compile-Log*") + `(bytecomp--with-warning-test-1 ,re-warning ,form)) +(defun bytecomp--with-warning-test-1 (re-warning form) + (with-current-buffer (get-buffer-create "*Compile-Log*") (let ((inhibit-read-only t)) (erase-buffer)) (let ((text-quoting-style 'grave) - (macroexp--warned - (make-hash-table :test #'equal :weakness 'key)) ; oh dear - (form ,form)) + (macroexp--warned ; oh dear + (make-hash-table :test #'equal :weakness 'key))) (ert-info ((prin1-to-string form) :prefix "form: ") (byte-compile form) (ert-info ((prin1-to-string (buffer-string)) :prefix "buffer: ") (should (re-search-forward - (string-replace " " "[ \n]+" ,re-warning)))))))) + (string-replace " " "[ \n]+" re-warning)))))))) (ert-deftest bytecomp-warn-wrong-args () (bytecomp--with-warning-test "remq.*3.*2" commit 68d753e3712fdd91fcdc306517ced3321d07a9d1 Author: Michael Albinus Date: Sat Feb 25 18:45:14 2023 +0100 ; * etc/NEWS: Fix typos. diff --git a/etc/NEWS b/etc/NEWS index b6c6f2c6362..5a244285efa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -828,12 +828,12 @@ filter/sentinel error has been handled. +++ ** New faces for font-lock. These faces are primarily meant for use with tree-sitter. They are: -'font-lock-function-call-face', 'font-lock-variable-ref-face', 'font-lock-bracket-face', 'font-lock-delimiter-face', -'font-lock-escape-face', 'font-lock-misc-punctuation-face', -'font-lock-number-face', 'font-lock-operator-face', -'font-lock-property-name-face', 'font-lock-property-ref-face', -'font-lock-punctuation-face', and 'font-lock-regexp-face'. +'font-lock-escape-face', 'font-lock-function-call-face', +'font-lock-misc-punctuation-face', 'font-lock-number-face', +'font-lock-operator-face', 'font-lock-property-name-face', +'font-lock-property-ref-face', 'font-lock-punctuation-face', +'font-lock-regexp-face', and 'font-lock-variable-ref-face'. +++ ** New face 'variable-pitch-text'. commit ab0cc4e78111167a79bd861cb570ced189303131 Author: Eli Zaretskii Date: Sat Feb 25 17:19:15 2023 +0200 Fix infloop in bidi.c * src/bidi.c (bidi_set_paragraph_end): Reset the isolate_level to zero. Whenever stack_idx is reset to zero, the isolate_level must also be reset, since there cannot be any isolate status outside of embeddings. Failure to reset isolate_level will cause us infloop when we see a PDI. Reported by Matt Beshara . diff --git a/src/bidi.c b/src/bidi.c index 93875d243e4..3c26ae19322 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1126,6 +1126,7 @@ bidi_set_paragraph_end (struct bidi_it *bidi_it) bidi_it->invalid_levels = 0; bidi_it->invalid_isolates = 0; bidi_it->stack_idx = 0; + bidi_it->isolate_level = 0; bidi_it->resolved_level = bidi_it->level_stack[0].level; } commit 3b8b23f66df2c52add54b764a37925818c426581 Author: Eli Zaretskii Date: Sat Feb 25 15:51:04 2023 +0200 ; Fix doc string of 'emacs-lisp-byte-compile' * lisp/progmodes/elisp-mode.el (emacs-lisp-byte-compile): Doc fix. (Bug#61784) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 1c339d08148..b2709616d22 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -191,7 +191,7 @@ elisp-context-menu menu) (defun emacs-lisp-byte-compile () - "Byte compile the file containing the current buffer." + "Byte-compile the current buffer's file." (interactive nil emacs-lisp-mode) (if buffer-file-name (byte-compile-file buffer-file-name) commit 309e6aaa6867cd9a33e185d929afe18a660a8151 Author: Michael Heerdegen Date: Wed Feb 22 14:56:07 2023 +0100 Make also 'diary-lunar-phases' report eclipses * lisp/calendar/lunar.el (diary-lunar-phases): Report eclipses. (calendar-lunar-phases): Tweak. diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el index 4f8f34d954f..5b22043102d 100644 --- a/lisp/calendar/lunar.el +++ b/lisp/calendar/lunar.el @@ -245,10 +245,11 @@ calendar-lunar-phases (insert (mapconcat (lambda (x) - (format "%s: %s %s %s" (calendar-date-string (car x)) - (lunar-phase-name (nth 2 x)) - (cadr x) - (car (last x)))) + (let ((eclipse (nth 3 x))) + (concat (calendar-date-string (car x)) ": " + (lunar-phase-name (nth 2 x)) " " + (cadr x) (unless (string-empty-p eclipse) " ") + eclipse))) (lunar-phase-list m1 y1) "\n"))) (message "Computing phases of the moon...done")))) @@ -283,9 +284,13 @@ diary-lunar-phases (while (calendar-date-compare phase (list date)) (setq index (1+ index) phase (lunar-phase index))) - (if (calendar-date-equal (car phase) date) - (cons mark (concat (lunar-phase-name (nth 2 phase)) " " - (cadr phase)))))) + (and (calendar-date-equal (car phase) date) + (cons mark + (let ((eclipse (nth 3 phase))) + (concat (lunar-phase-name (nth 2 phase)) " " + (cadr phase) + (unless (string-empty-p eclipse) " ") + eclipse)))))) ;; For the Chinese calendar the calculations for the new moon need to be more ;; accurate than those above, so we use more terms in the approximation.