[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
js2025 52873dcd15b 3/4: Merge remote-tracking branch 'origin/master' int
From: |
João Távora |
Subject: |
js2025 52873dcd15b 3/4: Merge remote-tracking branch 'origin/master' into js2025 |
Date: |
Fri, 17 Jan 2025 08:33:00 -0500 (EST) |
branch: js2025
commit 52873dcd15b3a1b23c6baf7d3986ffa4d686e036
Merge: 73954a678ee f7ff5f1ba4e
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Merge remote-tracking branch 'origin/master' into js2025
---
admin/coccinelle/arrayelts.cocci | 21 +++++++++
admin/coccinelle/calln.cocci | 21 +++++++++
doc/lispref/functions.texi | 2 +-
doc/lispref/strings.texi | 5 ++-
doc/lispref/symbols.texi | 53 ++++++++++-------------
doc/lispref/tips.texi | 2 +-
doc/lispref/variables.texi | 2 +-
doc/misc/ert.texi | 2 +-
etc/NEWS | 36 +++++++++++-----
etc/symbol-releases.eld | 1 +
lib/fcntl.in.h | 6 ++-
lib/file-has-acl.c | 47 +++++++++++++++++---
lib/getopt-pfx-core.h | 3 ++
lib/gnulib.mk.in | 22 +++++++---
lib/mktime-internal.h | 7 ++-
lib/mktime.c | 70 ++++++++++++++----------------
lib/stdlib.in.h | 5 ++-
lib/string.in.h | 36 ++++++++++++++++
lib/sys_select.in.h | 8 +++-
lisp/bookmark.el | 43 ++++++++++---------
lisp/emacs-lisp/cl-macs.el | 40 +++++++++++-------
lisp/emacs-lisp/find-func.el | 26 +++++++++---
lisp/emacs-lisp/rx.el | 2 +-
lisp/leim/quail/iroquoian.el | 54 +++++++++++++----------
lisp/net/nsm.el | 26 ++++++++----
lisp/progmodes/asm-mode.el | 24 ++++++-----
lisp/progmodes/flymake.el | 80 +++++++++++++++++------------------
lisp/repeat.el | 36 +++++++++-------
lisp/tab-bar.el | 6 ++-
lisp/window.el | 3 +-
m4/assert_h.m4 | 8 ++--
m4/gnulib-comp.m4 | 1 +
m4/string_h.m4 | 6 ++-
m4/sys_socket_h.m4 | 45 ++++++++++++--------
src/bytecode.c | 2 +-
src/comp.c | 4 +-
src/eval.c | 2 +-
src/fns.c | 8 ++--
src/font.c | 23 +++++++++-
src/lisp.h | 2 +-
src/msdos.c | 4 +-
src/sysdep.c | 4 +-
src/thread.c | 2 +-
src/w32fns.c | 8 ++--
src/w32term.c | 8 ++--
test/lisp/emacs-lisp/cl-macs-tests.el | 9 ++++
test/lisp/progmodes/flymake-tests.el | 20 +++++++++
test/lisp/repeat-tests.el | 7 ++-
48 files changed, 558 insertions(+), 294 deletions(-)
diff --git a/admin/coccinelle/arrayelts.cocci b/admin/coccinelle/arrayelts.cocci
new file mode 100644
index 00000000000..5376a94bd85
--- /dev/null
+++ b/admin/coccinelle/arrayelts.cocci
@@ -0,0 +1,21 @@
+// Use the ARRAYELTS macro where possible.
+@@
+type T;
+T[] E;
+@@
+- (sizeof (E) / sizeof (E[...]))
++ ARRAYELTS (E)
+
+@@
+type T;
+T[] E;
+@@
+- (sizeof (E) / sizeof (T))
++ ARRAYELTS (E)
+
+@@
+type T;
+T[] E;
+@@
+- (sizeof (E) / sizeof (*E))
++ ARRAYELTS (E)
diff --git a/admin/coccinelle/calln.cocci b/admin/coccinelle/calln.cocci
new file mode 100644
index 00000000000..5e720931fb5
--- /dev/null
+++ b/admin/coccinelle/calln.cocci
@@ -0,0 +1,21 @@
+// Use the calln macro where possible.
+@@
+@@
+- CALLN ( Ffuncall,
++ calln (
+ ...)
+
+@@
+constant c;
+expression e;
+@@
+- Ffuncall ( c, &e )
++ calln ( e )
+
+@@
+constant c;
+expression e;
+@@
+- Ffuncall ( c, &e,
++ calln ( e,
+ ...)
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index bad3c926b27..2b5847d2f64 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -754,7 +754,7 @@ to find the source code because generating a function
dynamically
usually looks very different from the usual static calls to
@code{defun}. You can make the job of finding the code that
generates such functions easier by using the @code{definition-name}
-or @code{definition-type} property, @pxref{Standard Properties}.
+or @code{find-function-type-alist} property, @pxref{Standard Properties}.
@cindex override existing functions
@cindex redefine existing functions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index da0c1abd348..93025574893 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -478,8 +478,9 @@ a raw byte.
@code{clear-string}:
@defun clear-string string
-This makes @var{string} a unibyte string and clears its contents to
-null characters. It may also change @var{string}'s length.
+This makes @var{string} a unibyte string, clears its contents to null
+characters, and removes all text properties. It may also change
+@var{string}'s length.
@end defun
@need 2000
diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi
index 508ee13a244..dc6509c1ae3 100644
--- a/doc/lispref/symbols.texi
+++ b/doc/lispref/symbols.texi
@@ -536,9 +536,9 @@ Do not set them directly; they are managed by
@code{defcustom} and
related functions. @xref{Variable Definitions}.
@cindex @code{definition-name} (symbol property)
-@cindex @code{definition-type} (symbol property)
+@cindex @code{find-function-type-alist} (symbol property)
@item definition-name
-@itemx definition-type
+@itemx find-function-type-alist
These properties help find the definition of a symbol in the source
code when it might be hard to find the definition by textual search
of the source file.
@@ -560,19 +560,22 @@ symbol.
In some cases, the definition cannot be found by looking for the
definition of another symbol. For example, a test file might use a
-macro to generate calls to @code{ert-deftest}
-(@pxref{,,,ert, ERT: Emacs Lisp Regression Testing}) where the code
-is boiler plate and only varying data need to be passed in.
-In such cases, the @code{definition-type} property of the symbol can
-be a symbol that has an entry in @code{find-function-regexp-alist}
-telling how to find the definition of symbols of this type.
+macro to generate calls to @code{ert-deftest} (@pxref{How to Write
+Tests,,,ert, ERT: Emacs Lisp Regression Testing}) where the code is
+boiler plate and only varying data need to be passed in. In such cases,
+the @code{find-function-type-alist} property of the symbol can be an
+alist that augments @code{find-function-regexp-alist} telling how to
+find the definition of symbols of this type.
In the example of a macro defining calls to @code{ert-deftest},
-the macro could put the property @code{definition-type} on each
-test defined. The file defining the macro would also define a
-definition-finding function or regexp and add it to
-@code{find-function-regexp-alist} after that variable is loaded.
-Here is an example using a function to find the definition:
+the macro could put the property @code{find-function-type-alist} on each
+test defined, associating @code{ert--test} (the internal type of ERT
+tests) with the name of a regexp or function that can find the correct
+macro call. The file defining the macro would also have to provide that
+definition-finding function or regexp.
+Here is an example using a function to find the definition.
+The example updates the property using convenience function
+@code{find-function-update-type-alist}.
@example
@group
@@ -581,29 +584,19 @@ Here is an example using a function to find the
definition:
(declare (debug (&rest sexp)))
(let ((test-name (intern (concat ...))))
`(progn
- (put ',test-name 'definition-type 'foo-test-type)
- (ert-deftest ,test-name ()
- ,(concat "Test foo with " ...)
- ...))))
+ (find-function-update-type-alist
+ ',test-name 'ert--test 'foo-find-test-def-function)
+ (ert-deftest ,test-name ()
+ ,(concat "Test foo with " ...)
+ ...))))
@end group
@group
(defun foo-find-test-def-function (test-name)
"Search for the `define-foo-test' call defining TEST-NAME.
Return non-nil if the definition is found."
- (save-match-data
- (let ((regexp ...))
- (save-restriction
- (widen)
- (goto-char (point-min))
- (re-search-forward regexp nil t)))))
-@end group
-
-@group
-(with-eval-after-load "find-func"
- (add-to-list
- 'find-function-regexp-alist
- '(foo-test-type . foo-find-test-def-function)))
+ (let ((regexp ...))
+ (re-search-forward regexp nil t)))
@end group
@end example
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index c2fba3cba8d..1bf52886971 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -228,7 +228,7 @@ definition automatically. Avoid constructing the names in
the macro
itself, since that would confuse these tools.
If your macro cannot be written in this style, the macro can still
help these tools find the defining call by putting the property
-@code{definition-name} or @code{definition-type} on the name.
+@code{definition-name} or @code{find-function-type-alist} on the name.
@xref{Standard Properties}.
@item
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index a2bb1834477..5710971a9fa 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -1117,7 +1117,7 @@ cell).
will use dynamic binding, even for new bindings such as a @code{let}
binding. Depending on how the variable is declared, it can be
special globally, for a single file, or for a portion of a file.
-@xref{Dynamic Binding} for details.
+@xref{Dynamic Binding}, for further details.
@node Dynamic Binding
@subsection Dynamic Binding
diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index c8aac971ec7..0e03afc98ff 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -524,7 +524,7 @@ find where a test was defined only if the test was loaded
from a file.
If the test definition is generated by a macro, the macro may want to
help ERT find the defining call to the macro by putting the property
-@code{definition-type} on the test name.
+@code{find-function-type-alist} on the test name.
@xref{Standard Properties,,,elisp, GNU Emacs Lisp Reference Manual}.
diff --git a/etc/NEWS b/etc/NEWS
index b92b5817d35..a9e4fba8bb2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -90,6 +90,10 @@ If you have been using these variables in Lisp code (for
example, in
font-lock rules), simply quote the symbol, to use the face directly
instead of its now-obsolete variable.
+** Network Security Manager now warns about DHE key exchange by default.
+Emacs now warns about ephemeral Diffie-Hellman key exchanges also when
+'network-security-level' is customized to its default 'medium' value.
+
** Etags
+++
@@ -277,12 +281,13 @@ The Tifinagh script is used to write the Berber languages.
*** New input methods for Northern Iroquoian languages.
Input methods are now implemented for Haudenosaunee languages in the
Northern Iroquoian language family: 'mohawk-postfix' (Mohawk
-[Kanien’kéha / Onkwehonwehnéha]), 'oneida-postfix' (Oneida
-[Onʌyote’a·ká· / Ukwehuwehnéha]), 'cayuga-postfix' (Cayuga
-[Gayogo̱ho:nǫhnéha:ˀ]), 'onondaga-postfix' (Onondaga [Onųdaʔgegáʔ]), and
-'seneca-postfix' (Seneca [Onödowá’ga:’]). Additionally, there is a
-general-purpose 'haudenosaunee-postfix' input method to facilitate
-writing in the orthographies of the five languages simultaneously.
+[Kanien’kéha / Kanyen’kéha / Onkwehonwehnéha]), 'oneida-postfix' (Oneida
+[Onʌyote’a·ká· / Onyota’a:ká: / Ukwehuwehnéha]), 'cayuga-postfix'
+(Cayuga [Gayogo̱ho:nǫhnéha:ˀ]), 'onondaga-postfix' (Onondaga
+[Onųdaʔgegáʔ]), and 'seneca-postfix' (Seneca [Onödowá’ga:’]).
+Additionally, there is a general-purpose 'haudenosaunee-postfix' input
+method to facilitate writing in the orthographies of the five languages
+simultaneously.
---
** 'visual-wrap-prefix-mode' now supports variable-pitch fonts.
@@ -332,6 +337,11 @@ modal editing packages.
* Changes in Specialized Modes and Packages in Emacs 31.1
+---
+** ASM mode
+*** 'asm-mode-set-comment-hook' is obsolete.
+You can now set `asm-comment-char' from 'asm-mode-hook' instead.
+
---
** Ibuffer
*** New column 'recency' in Ibuffer display.
@@ -377,6 +387,9 @@ Emacs 25.1), and gnudoit (obsolete since Emacs 25.1).
*** 'cl-labels' now also accepts '(FUNC EXP)' bindings, like 'cl-flet'.
Such bindings make it possible to compute which function to bind to FUNC.
+---
+*** 'cl-block' names are now lexically scoped, as documented.
+
** Whitespace
---
@@ -1174,11 +1187,14 @@ It offers a more concise way to create a completion
table with metadata.
** 'all-completions' and 'unintern' no longer support old calling conventions.
+++
-** New symbol property 'definition-type' used by 'find-function' and friends.
+** New symbol property 'find-function-type-alist' used by 'find-function' etc.
Macros that define an object in a way that makes the object's name and
-the macro call site defining the object hard to associate can put the
-property 'definition-type' on the object's name to provide instructions
-for finding the definition.
+the macro call site defining the object hard to associate can add an
+entry to the property 'find-function-type-alist' on the object's name to
+provide instructions for finding the definition.
+
+New convenience function 'find-function-update-type-alist' offers a
+concise way to update a symbol's 'find-function-type-alist' property.
* Changes in Emacs 31.1 on Non-Free Operating Systems
diff --git a/etc/symbol-releases.eld b/etc/symbol-releases.eld
index de1eaad6bd1..0609dd1467f 100644
--- a/etc/symbol-releases.eld
+++ b/etc/symbol-releases.eld
@@ -14,6 +14,7 @@
("26.1" fun and-let*)
("26.1" fun if-let*)
("24.4" fun set-transient-map)
+ ("22.1" fun clear-string)
("22.1" fun version=)
("22.1" fun version<)
("22.1" fun version<=)
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 5f06c4fe10f..ac61c0865a4 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -369,8 +369,12 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
# define O_RSYNC 0
#endif
+#if defined O_SEARCH && defined O_PATH && O_SEARCH == O_PATH
+# undef O_SEARCH /* musl mistakenly #defines O_SEARCH to O_PATH. */
+#endif
+
#ifndef O_SEARCH
-# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */
+# define O_SEARCH O_RDONLY /* Often close enough in non-POSIX systems. */
#endif
#ifndef O_SYNC
diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c
index 35dcc19f169..c02cfee842b 100644
--- a/lib/file-has-acl.c
+++ b/lib/file-has-acl.c
@@ -99,6 +99,37 @@ enum {
ACE4_IDENTIFIER_GROUP = 0x00000040
};
+/* AI indicates XATTR may be present but wasn't accessible.
+ This is the case when [l]listxattr failed with E2BIG,
+ or is not supported (!acl_errno_valid()), or failed with EACCES
+ which in Linux kernel 6.12 NFS can mean merely that we lack read access.
+*/
+
+static bool
+aclinfo_may_indicate_xattr (struct aclinfo const *ai)
+{
+ return ai->size < 0 && (!acl_errno_valid (ai->u.err)
+ || ai->u.err == EACCES || ai->u.err == E2BIG);
+}
+
+/* Does NAME have XATTR? */
+
+static bool
+has_xattr (char const *xattr, struct aclinfo const *ai,
+ MAYBE_UNUSED char const *restrict name, MAYBE_UNUSED int flags)
+{
+ if (ai && aclinfo_has_xattr (ai, xattr))
+ return true;
+ else if (!ai || aclinfo_may_indicate_xattr (ai))
+ {
+ int ret = ((flags & ACL_SYMLINK_FOLLOW ? getxattr : lgetxattr)
+ (name, xattr, NULL, 0));
+ if (0 <= ret || (errno == ERANGE || errno == E2BIG))
+ return true;
+ }
+ return false;
+}
+
/* Does AI's xattr set contain XATTR? */
bool
@@ -176,11 +207,13 @@ get_aclinfo (char const *name, struct aclinfo *ai, int
flags)
}
}
- if (0 < ai->size && flags & ACL_GET_SCONTEXT)
+ /* A security context can exist only if extended attributes do. */
+ if (flags & ACL_GET_SCONTEXT
+ && (0 < ai->size || aclinfo_may_indicate_xattr (ai)))
{
if (is_smack_enabled ())
{
- if (aclinfo_has_xattr (ai, XATTR_NAME_SMACK))
+ if (ai->size < 0 || aclinfo_has_xattr (ai, XATTR_NAME_SMACK))
{
ssize_t r = smack_new_label_from_path (name, "security.SMACK64",
flags &
ACL_SYMLINK_FOLLOW,
@@ -191,7 +224,7 @@ get_aclinfo (char const *name, struct aclinfo *ai, int
flags)
else
{
# if USE_SELINUX_SELINUX_H
- if (aclinfo_has_xattr (ai, XATTR_NAME_SELINUX))
+ if (ai->size < 0 || aclinfo_has_xattr (ai, XATTR_NAME_SELINUX))
{
ssize_t r =
((flags & ACL_SYMLINK_FOLLOW ? getfilecon : lgetfilecon)
@@ -352,7 +385,7 @@ file_has_aclinfo (MAYBE_UNUSED char const *restrict name,
int initial_errno = errno;
get_aclinfo (name, ai, flags);
- if (ai->size <= 0)
+ if (!aclinfo_may_indicate_xattr (ai) && ai->size <= 0)
{
errno = ai->size < 0 ? ai->u.err : initial_errno;
return ai->size;
@@ -363,11 +396,11 @@ file_has_aclinfo (MAYBE_UNUSED char const *restrict name,
In earlier Fedora the two types of ACLs were mutually exclusive.
Attempt to work correctly on both kinds of systems. */
- if (!aclinfo_has_xattr (ai, XATTR_NAME_NFSV4_ACL))
+ if (!has_xattr (XATTR_NAME_NFSV4_ACL, ai, name, flags))
return
- (aclinfo_has_xattr (ai, XATTR_NAME_POSIX_ACL_ACCESS)
+ (has_xattr (XATTR_NAME_POSIX_ACL_ACCESS, ai, name, flags)
|| ((d_type == DT_DIR || d_type == DT_UNKNOWN)
- && aclinfo_has_xattr (ai, XATTR_NAME_POSIX_ACL_DEFAULT)));
+ && has_xattr (XATTR_NAME_POSIX_ACL_DEFAULT, ai, name, flags)));
/* A buffer large enough to hold any trivial NFSv4 ACL.
The max length of a trivial NFSv4 ACL is 6 words for owner,
diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h
index 391c7af8e71..7c5ea094683 100644
--- a/lib/getopt-pfx-core.h
+++ b/lib/getopt-pfx-core.h
@@ -37,6 +37,9 @@
# if defined _AIX || defined __hpux || defined __sun || defined __QNX__
# include <stdio.h>
# endif
+# if defined MUSL_LIBC || (defined __FreeBSD__ || defined __DragonFly__) ||
defined __NetBSD__ || defined __OpenBSD__ || (defined __APPLE__ && defined
__MACH__) || defined _AIX || defined __sun || defined __minix || defined
__HAIKU__
+# include <unistd.h>
+# endif
# ifndef __GETOPT_ID
# define __GETOPT_CONCAT(x, y) x ## y
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index a42e77e99b8..ce874048f4a 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -489,6 +489,8 @@ GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
GL_GNULIB_MBSTOWCS = @GL_GNULIB_MBSTOWCS@
+GL_GNULIB_MBS_ENDSWITH = @GL_GNULIB_MBS_ENDSWITH@
+GL_GNULIB_MBS_STARTSWITH = @GL_GNULIB_MBS_STARTSWITH@
GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
@@ -642,6 +644,8 @@ GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_STR_ENDSWITH = @GL_GNULIB_STR_ENDSWITH@
+GL_GNULIB_STR_STARTSWITH = @GL_GNULIB_STR_STARTSWITH@
GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
@@ -2612,17 +2616,17 @@ ifneq (,$(GL_GENERATE_GMP_H_CONDITION))
ifneq (,$(GL_GENERATE_MINI_GMP_H_CONDITION))
# Build gmp.h as a wrapper for mini-gmp.h when using mini-gmp.
gmp.h: $(top_builddir)/config.status
- echo '#include "mini-gmp.h"' > $@-t
- echo '#if GNULIB_LIBGMP_MPQ' >> $@-t
- echo '# include "mini-mpq.h"' >> $@-t
- echo '#endif' >> $@-t
- mv $@-t $@
+ $(gl_V_at)echo '#include "mini-gmp.h"' > $@-t
+ $(AM_V_at)echo '#if GNULIB_LIBGMP_MPQ' >> $@-t
+ $(AM_V_at)echo '# include "mini-mpq.h"' >> $@-t
+ $(AM_V_at)echo '#endif' >> $@-t
+ $(AM_V_at)mv $@-t $@
endif
ifneq (,$(GL_GENERATE_GMP_GMP_H_CONDITION))
# Build gmp.h as a wrapper for gmp/gmp.h.
gmp.h: $(top_builddir)/config.status
- echo '#include <gmp/gmp.h>' > $@-t
- mv $@-t $@
+ $(gl_V_at)echo '#include <gmp/gmp.h>' > $@-t
+ $(AM_V_at)mv $@-t $@
endif
else
gmp.h: $(top_builddir)/config.status
@@ -3655,6 +3659,8 @@ string.h: string.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_MBSSPN''@/$(GL_GNULIB_MBSSPN)/g' \
-e 's/@''GNULIB_MBSSEP''@/$(GL_GNULIB_MBSSEP)/g' \
-e 's/@''GNULIB_MBSTOK_R''@/$(GL_GNULIB_MBSTOK_R)/g' \
+ -e 's/@''GNULIB_MBS_ENDSWITH''@/$(GL_GNULIB_MBS_ENDSWITH)/g' \
+ -e 's/@''GNULIB_MBS_STARTSWITH''@/$(GL_GNULIB_MBS_STARTSWITH)/g' \
-e 's/@''GNULIB_MEMCHR''@/$(GL_GNULIB_MEMCHR)/g' \
-e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \
-e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \
@@ -3673,6 +3679,8 @@ string.h: string.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_STRSTR''@/$(GL_GNULIB_STRSTR)/g' \
-e 's/@''GNULIB_STRCASESTR''@/$(GL_GNULIB_STRCASESTR)/g' \
-e 's/@''GNULIB_STRTOK_R''@/$(GL_GNULIB_STRTOK_R)/g' \
+ -e 's/@''GNULIB_STR_ENDSWITH''@/$(GL_GNULIB_STR_ENDSWITH)/g' \
+ -e 's/@''GNULIB_STR_STARTSWITH''@/$(GL_GNULIB_STR_STARTSWITH)/g' \
-e 's/@''GNULIB_STRERROR''@/$(GL_GNULIB_STRERROR)/g' \
-e 's/@''GNULIB_STRERROR_R''@/$(GL_GNULIB_STRERROR_R)/g' \
-e
's/@''GNULIB_STRERRORNAME_NP''@/$(GL_GNULIB_STRERRORNAME_NP)/g' \
diff --git a/lib/mktime-internal.h b/lib/mktime-internal.h
index 1da98b43732..215be914c2f 100644
--- a/lib/mktime-internal.h
+++ b/lib/mktime-internal.h
@@ -19,6 +19,9 @@
#ifndef _LIBC
# include <time.h>
+# define __libc_lock_lock(lock) ((void) 0)
+# define __libc_lock_unlock(lock) ((void) 0)
+# define __tzset_unlocked() tzset ()
#endif
/* mktime_offset_t is a signed type wide enough to hold a UTC offset
@@ -73,6 +76,8 @@ typedef int mktime_offset_t;
/* Subroutine of mktime. Return the time_t representation of TP and
normalize TP, given that a struct tm * maps to a time_t. If
LOCAL, the mapping is performed by localtime_r, otherwise by gmtime_r.
- Record next guess for localtime-gmtime offset in *OFFSET. */
+ Record next guess for localtime-gmtime offset in *OFFSET.
+
+ If _LIBC, the caller must lock __tzset_lock. */
extern __time64_t __mktime_internal (struct tm *tp, bool local,
mktime_offset_t *offset) attribute_hidden;
diff --git a/lib/mktime.c b/lib/mktime.c
index 74403e4530e..4218fca69b1 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -62,6 +62,9 @@
# define NEED_MKTIME_WORKING 0
#endif
+#ifdef _LIBC
+# include <tzset.h>
+#endif
#include "mktime-internal.h"
#if !defined _LIBC && (NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS)
@@ -98,8 +101,8 @@ my_tzset (void)
tzset ();
# endif
}
-# undef __tzset
-# define __tzset() my_tzset ()
+# undef tzset
+# define tzset() my_tzset ()
#endif
#if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL
@@ -250,6 +253,7 @@ tm_diff (long_int year, long_int yday, int hour, int min,
int sec,
tp->tm_hour, tp->tm_min, tp->tm_sec);
}
+#ifndef _LIBC
/* Convert T to a struct tm value in *TM. Use localtime64_r if LOCAL,
otherwise gmtime64_r. T must be in range for __time64_t. Return
TM if successful, NULL (setting errno) on failure. */
@@ -262,8 +266,8 @@ convert_time (long_int t, bool local, struct tm *tm)
else
return __gmtime64_r (&x, tm);
}
-/* Call it __tzconvert to sync with other parts of glibc. */
-#define __tz_convert convert_time
+# define __tz_convert convert_time
+#endif
/* Convert *T to a broken down time in *TP (as if by localtime if
LOCAL, otherwise as if by gmtime). If *T is out of range for
@@ -320,7 +324,9 @@ ranged_convert (bool local, long_int *t, struct tm *tp)
If *OFFSET's guess is correct, only one reverse mapping call is
needed. If successful, set *TP to the canonicalized struct tm;
otherwise leave *TP alone, return ((time_t) -1) and set errno.
- This function is external because it is used also by timegm.c. */
+ This function is external because it is used also by timegm.c.
+
+ If _LIBC, the caller must lock __tzset_lock. */
__time64_t
__mktime_internal (struct tm *tp, bool local, mktime_offset_t *offset)
{
@@ -349,12 +355,10 @@ __mktime_internal (struct tm *tp, bool local,
mktime_offset_t *offset)
int mday = tp->tm_mday;
int mon = tp->tm_mon;
int year_requested = tp->tm_year;
+ int isdst = tp->tm_isdst;
- /* Ignore any tm_isdst request for timegm. */
- int isdst = local ? tp->tm_isdst : 0;
-
- /* 1 if the previous probe was DST. */
- int dst2 = 0;
+ /* True if the previous probe was DST. */
+ bool dst2 = false;
/* Ensure that mon is in range, and set year accordingly. */
int mon_remainder = mon % 12;
@@ -443,13 +447,10 @@ __mktime_internal (struct tm *tp, bool local,
mktime_offset_t *offset)
Heuristic: probe the adjacent timestamps in both directions,
looking for the desired isdst. If none is found within a
- reasonable duration bound, assume a one-hour DST difference.
+ reasonable duration bound, ignore the disagreement.
This should work for all real time zone histories in the tz
database. */
- /* +1 if we wanted standard time but got DST, -1 if the reverse. */
- int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
-
/* Distance between probes when looking for a DST boundary. In
tzdata2003a, the shortest period of DST is 601200 seconds
(e.g., America/Recife starting 2000-10-08 01:00), and the
@@ -459,21 +460,17 @@ __mktime_internal (struct tm *tp, bool local,
mktime_offset_t *offset)
periods when probing. */
int stride = 601200;
- /* In TZDB 2021e, the longest period of DST (or of non-DST), in
- which the DST (or adjacent DST) difference is not one hour,
- is 457243209 seconds: e.g., America/Cambridge_Bay with leap
- seconds, starting 1965-10-31 00:00 in a switch from
- double-daylight time (-05) to standard time (-07), and
- continuing to 1980-04-27 02:00 in a switch from standard time
- (-07) to daylight time (-06). */
- int duration_max = 457243209;
-
- /* Search in both directions, so the maximum distance is half
- the duration; add the stride to avoid off-by-1 problems. */
- int delta_bound = duration_max / 2 + stride;
+ /* Do not probe too far away from the requested time,
+ by striding until at least a year has passed, but then giving up.
+ This helps avoid unexpected results in (for example) Asia/Kolkata,
+ for which today's users expect to see no DST even though it
+ did observe DST long ago. */
+ int year_seconds_bound = 366 * 24 * 60 * 60 + 1;
+ int delta_bound = year_seconds_bound + stride;
int delta, direction;
+ /* Search in both directions, closest first. */
for (delta = stride; delta < delta_bound; delta += stride)
for (direction = -1; direction <= 1; direction += 2)
{
@@ -503,13 +500,8 @@ __mktime_internal (struct tm *tp, bool local,
mktime_offset_t *offset)
}
}
- /* No unusual DST offset was found nearby. Assume one-hour DST. */
- t += 60 * 60 * dst_difference;
- if (mktime_min <= t && t <= mktime_max && __tz_convert (t, local, &tm))
- goto offset_found;
-
- __set_errno (EOVERFLOW);
- return -1;
+ /* No probe with the requested tm_isdst was found nearby.
+ Ignore the requested tm_isdst. */
}
offset_found:
@@ -548,17 +540,19 @@ __mktime_internal (struct tm *tp, bool local,
mktime_offset_t *offset)
__time64_t
__mktime64 (struct tm *tp)
{
- /* POSIX.1 requires mktime to set external variables like 'tzname'
- as though tzset had been called. */
- __tzset ();
+ __libc_lock_lock (__tzset_lock);
+ __tzset_unlocked ();
# if defined _LIBC || NEED_MKTIME_WORKING
static mktime_offset_t localtime_offset;
- return __mktime_internal (tp, true, &localtime_offset);
+ __time64_t result = __mktime_internal (tp, true, &localtime_offset);
# else
# undef mktime
- return mktime (tp);
+ __time64_t result = mktime (tp);
# endif
+
+ __libc_lock_unlock (__tzset_lock);
+ return result;
}
#endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS */
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index f8e2a6ce344..bd82086ff37 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -62,8 +62,9 @@
/* NetBSD 5.0 mis-defines NULL. */
#include <stddef.h>
-/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */
-#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
+/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>.
+ glibc 2.40 defines WCOREDUMP in <sys/wait.h>, not in <stdlib.h>. */
+#if @GNULIB_SYSTEM_POSIX@ && !(defined WEXITSTATUS && defined WCOREDUMP)
# include <sys/wait.h>
#endif
diff --git a/lib/string.in.h b/lib/string.in.h
index 1bae32ad465..ce488299006 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -1077,6 +1077,22 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
/* The following functions are not specified by POSIX. They are gnulib
extensions. */
+#if @GNULIB_STR_STARTSWITH@
+/* Returns true if STRING starts with PREFIX.
+ Returns false otherwise. */
+_GL_EXTERN_C bool str_startswith (const char *string, const char *prefix)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_STR_ENDSWITH@
+/* Returns true if STRING ends with SUFFIX.
+ Returns false otherwise. */
+_GL_EXTERN_C bool str_endswith (const char *string, const char *prefix)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
#if @GNULIB_MBSLEN@
/* Return the number of multibyte characters in the character string STRING.
This considers multibyte characters, unlike strlen, which counts bytes. */
@@ -1301,6 +1317,26 @@ _GL_EXTERN_C char * mbstok_r (char *restrict string,
const char *delim,
_GL_ARG_NONNULL ((2, 3));
#endif
+#if @GNULIB_MBS_STARTSWITH@
+/* Returns true if STRING starts with PREFIX.
+ Returns false otherwise. */
+_GL_EXTERN_C bool mbs_startswith (const char *string, const char *prefix)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+/* No extra code is needed for multibyte locales for this function. */
+# define mbs_startswith str_startswith
+#endif
+
+#if @GNULIB_MBS_ENDSWITH@
+/* Returns true if STRING ends with SUFFIX.
+ Returns false otherwise.
+ Unlike str_endswith(), this function works correctly in multibyte locales.
+ */
+_GL_EXTERN_C bool mbs_endswith (const char *string, const char *suffix)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
/* Map any int, typically from errno, into an error message. */
#if @GNULIB_STRERROR@
# if @REPLACE_STRERROR@
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index fd3e28fd8e0..a06725020d2 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -165,12 +165,18 @@
#if @HAVE_WINSOCK2_H@
+/* Define type 'suseconds_t'. */
+# if !GNULIB_defined_suseconds_t
+typedef int suseconds_t;
+# define GNULIB_defined_suseconds_t 1
+# endif
+
# if !GNULIB_defined_rpl_fd_isset
/* Re-define FD_ISSET to avoid a WSA call while we are not using
network sockets. */
static int
-rpl_fd_isset (SOCKET fd, fd_set * set)
+rpl_fd_isset (SOCKET fd, const fd_set * set)
{
u_int i;
if (set == NULL)
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 0048330e790..215377635f7 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1256,33 +1256,34 @@ Useful for example to unhide text in `outline-mode'.")
(defun bookmark--jump-via (bookmark-name-or-record display-function)
"Handle BOOKMARK-NAME-OR-RECORD, then call DISPLAY-FUNCTION.
-DISPLAY-FUNCTION is called with the current buffer as argument.
+DISPLAY-FUNCTION is called with the new buffer as argument.
After calling DISPLAY-FUNCTION, set window point to the point specified
by BOOKMARK-NAME-OR-RECORD, if necessary, run `bookmark-after-jump-hook',
and then show any annotations for this bookmark."
- (bookmark-handle-bookmark bookmark-name-or-record)
- ;; Store `point' now, because `display-function' might change it.
- (let ((point (point)))
- (save-current-buffer
- (funcall display-function (current-buffer)))
- (let ((win (get-buffer-window (current-buffer) 0)))
- (if win (set-window-point win point))))
- ;; FIXME: we used to only run bookmark-after-jump-hook in
- ;; `bookmark-jump' itself, but in none of the other commands.
- (when bookmark-fringe-mark
- (let ((overlays (overlays-in (pos-bol) (1+ (pos-bol))))
- temp found)
- (while (and (not found) (setq temp (pop overlays)))
- (when (eq 'bookmark (overlay-get temp 'category))
- (setq found t)))
- (unless found
- (bookmark--set-fringe-mark))))
- (run-hooks 'bookmark-after-jump-hook)
- (if bookmark-automatically-show-annotations
+ (let (buf point)
+ (save-window-excursion
+ (bookmark-handle-bookmark bookmark-name-or-record)
+ (setq buf (current-buffer)
+ point (point)))
+ (funcall display-function buf)
+ (when-let* ((win (get-buffer-window buf 0)))
+ (set-window-point win point))
+ (when bookmark-fringe-mark
+ (let ((overlays (overlays-in (pos-bol) (1+ (pos-bol))))
+ temp found)
+ (while (and (not found) (setq temp (pop overlays)))
+ (when (eq 'bookmark (overlay-get temp 'category))
+ (setq found t)))
+ (unless found
+ (bookmark--set-fringe-mark))))
+ ;; FIXME: we used to only run bookmark-after-jump-hook in
+ ;; `bookmark-jump' itself, but in none of the other commands.
+ (run-hooks 'bookmark-after-jump-hook)
+ (when bookmark-automatically-show-annotations
;; if there is an annotation for this bookmark,
;; show it in a buffer.
- (bookmark-show-annotation bookmark-name-or-record)))
+ (bookmark-show-annotation bookmark-name-or-record))))
;;;###autoload
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 01e7b35cc52..7559c58e77a 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -901,9 +901,13 @@ references may appear inside macro expansions, but not
inside functions
called from BODY."
(declare (indent 1) (debug (symbolp body)))
(if (cl--safe-expr-p `(progn ,@body)) `(progn ,@body)
- `(cl--block-wrapper
- (catch ',(intern (format "--cl-block-%s--" name))
- ,@body))))
+ (let ((var (intern (format "--cl-block-%s--" name))))
+ `(cl--block-wrapper
+ ;; Build a unique "tag" in the form of a fresh cons.
+ ;; We include `var' in the cons, just in case it help debugging.
+ (let ((,var (cons ',var nil)))
+ (catch ,var
+ ,@body))))))
;;;###autoload
(defmacro cl-return (&optional result)
@@ -921,7 +925,7 @@ This is compatible with Common Lisp, but note that `defun'
and
`defmacro' do not create implicit blocks as they do in Common Lisp."
(declare (indent 1) (debug (symbolp &optional form)))
(let ((name2 (intern (format "--cl-block-%s--" name))))
- `(cl--block-throw ',name2 ,result)))
+ `(cl--block-throw ,name2 ,result)))
;;; The "cl-loop" macro.
@@ -3672,20 +3676,24 @@ macro that returns its `&whole' argument."
(defvar cl--active-block-names nil)
-(cl-define-compiler-macro cl--block-wrapper (cl-form)
- (let* ((cl-entry (cons (nth 1 (nth 1 cl-form)) nil))
- (cl--active-block-names (cons cl-entry cl--active-block-names))
- (cl-body (macroexpand-all ;Performs compiler-macro expansions.
- (macroexp-progn (cddr cl-form))
- macroexpand-all-environment)))
- ;; FIXME: To avoid re-applying macroexpand-all, we'd like to be able
- ;; to indicate that this return value is already fully expanded.
- (if (cdr cl-entry)
- `(catch ,(nth 1 cl-form) ,@(macroexp-unprogn cl-body))
- cl-body)))
+(cl-define-compiler-macro cl--block-wrapper (form)
+ (pcase form
+ (`(let ((,var . ,val)) (catch ,var . ,body))
+ (let* ((cl-entry (cons var nil))
+ (cl--active-block-names (cons cl-entry cl--active-block-names))
+ (cl-body (macroexpand-all ;Performs compiler-macro expansions.
+ (macroexp-progn body)
+ macroexpand-all-environment)))
+ ;; FIXME: To avoid re-applying macroexpand-all, we'd like to be able
+ ;; to indicate that this return value is already fully expanded.
+ (if (cdr cl-entry)
+ `(let ((,var . ,val)) (catch ,var ,@(macroexp-unprogn cl-body)))
+ cl-body)))
+ ;; `form' was somehow mangled, god knows what happened, let's not touch it.
+ (_ form)))
(cl-define-compiler-macro cl--block-throw (cl-tag cl-value)
- (let ((cl-found (assq (nth 1 cl-tag) cl--active-block-names)))
+ (let ((cl-found (and (symbolp cl-tag) (assq cl-tag cl--active-block-names))))
(if cl-found (setcdr cl-found t)))
`(throw ,cl-tag ,cl-value))
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 643b6aba2a6..c367d4a3624 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -152,7 +152,11 @@ Each regexp variable's value should actually be a format
string
to be used to substitute the desired symbol name into the regexp.
Instead of regexp variable, types can be mapped to functions as well,
in which case the function is called with one argument (the object
-we're looking for) and it should search for it.")
+we're looking for) and it should search for it.
+
+Symbols can have their own version of this alist on
+the property `find-function-type-alist'.
+See the function `find-function-update-type-alist'.")
(put 'find-function-regexp-alist 'risky-local-variable t)
(define-obsolete-variable-alias 'find-function-source-path
@@ -402,9 +406,9 @@ or just (BUFFER . nil) if the definition can't be found in
the file.
If TYPE is nil, look for a function definition,
otherwise, TYPE specifies the kind of definition.
-If SYMBOL has a property `definition-type',
-the property value is used instead of TYPE.
-TYPE is interpreted via `find-function-regexp-alist'.
+TYPE is looked up in SYMBOL's property `find-function-type-alist'
+(which can be maintained with `find-function-update-type-alist')
+or the variable `find-function-regexp-alist'.
The search is done in the source for library LIBRARY."
(if (null library)
@@ -413,8 +417,6 @@ The search is done in the source for library LIBRARY."
;; that defines something else.
(while (and (symbolp symbol) (get symbol 'definition-name))
(setq symbol (get symbol 'definition-name)))
- (setq type (or (get symbol 'definition-type)
- type))
(if (string-match "\\`src/\\(.*\\.\\(c\\|m\\)\\)\\'" library)
(find-function-C-source symbol (match-string 1 library) type)
(when (string-match "\\.el\\(c\\)\\'" library)
@@ -424,7 +426,10 @@ The search is done in the source for library LIBRARY."
(when (string-match "\\.emacs\\(.el\\)\\'" library)
(setq library (substring library 0 (match-beginning 1))))
(let* ((filename (find-library-name library))
- (regexp-symbol (cdr (assq type find-function-regexp-alist))))
+ (regexp-symbol
+ (or (and (symbolp symbol)
+ (alist-get type (get symbol 'find-function-type-alist)))
+ (alist-get type find-function-regexp-alist))))
(with-current-buffer (find-file-noselect filename)
(let ((regexp (if (functionp regexp-symbol) regexp-symbol
(format (symbol-value regexp-symbol)
@@ -466,6 +471,13 @@ The search is done in the source for library LIBRARY."
(find-function--search-by-expanding-macros
(current-buffer) symbol type))))))))))
+;;;###autoload
+(defun find-function-update-type-alist (symbol type variable)
+ "Update SYMBOL property `find-function-type-alist' with (TYPE . VARIABLE).
+Property `find-function-type-alist' is a symbol-specific version
+of variable `find-function-regexp-alist' and has the same format."
+ (setf (alist-get type (get symbol 'find-function-type-alist)) variable))
+
(defun find-function--try-macroexpand (form)
"Try to macroexpand FORM in full or partially.
This is a best-effort operation in which if macroexpansion fails,
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index a0c8e4d607f..8fbe35220f1 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -1,4 +1,4 @@
-;;; rx.el --- S-exp notation for regexps --*- lexical-binding: t -*-
+;;; rx.el --- S-exp notation for regexps -*- lexical-binding: t -*-
;; Copyright (C) 2001-2025 Free Software Foundation, Inc.
diff --git a/lisp/leim/quail/iroquoian.el b/lisp/leim/quail/iroquoian.el
index 63c24cf4590..6671a1d20f1 100644
--- a/lisp/leim/quail/iroquoian.el
+++ b/lisp/leim/quail/iroquoian.el
@@ -27,8 +27,8 @@
;; Input methods are implemented for all Five Nations Iroquois
;; languages:
-;; - Mohawk (Kanien’kéha / Onkwehonwehnéha)
-;; - Oneida (Onʌyote’a·ká· / Ukwehuwehnéha)
+;; - Mohawk (Kanien’kéha / Kanyen’kéha / Onkwehonwehnéha)
+;; - Oneida (Onʌyote’a·ká· / Onyota’a:ká: / Ukwehuwehnéha)
;; - Onondaga (Onųdaʔgegáʔ)
;; - Cayuga (Gayogo̱ho:nǫhnéha:ˀ)
;; - Seneca (Onödowá’ga:’)
@@ -123,7 +123,7 @@ Entries are as with rules in `quail-define-rules'.")
(quail-define-package
"mohawk-postfix" "Mohawk" "MOH<" t
- "Mohawk (Kanien’kéha) input method with postfix modifiers
+ "Mohawk (Kanien’kéha/Kanyen’kéha) input method with postfix modifiers
Stress diacritics:
@@ -216,8 +216,8 @@ Entries are as with rules in `quail-define-rules'.")
Entries are as with rules in `quail-define-rules'.")
(defconst iroquoian-oneida-consonant-alist
- '((";;" ?\N{MODIFIER LETTER GLOTTAL STOP})
- (";'" ?\N{RIGHT SINGLE QUOTATION MARK}))
+ '((";;" ?\N{RIGHT SINGLE QUOTATION MARK})
+ (";'" ?\N{MODIFIER LETTER GLOTTAL STOP}))
"Alist of rules for consonant letters in Oneida input methods.
Entries are as with rules in `quail-define-rules'.")
@@ -229,7 +229,7 @@ Entries are as with rules in `quail-define-rules'.")
(quail-define-package
"oneida-postfix" "Oneida" "ONE<" t
- "Oneida (Onʌyote’a·ká·) input method with postfix modifiers
+ "Oneida (Onʌyote’a·ká·/Onyota’a:ká:) input method with postfix modifiers
Modifiers:
@@ -258,8 +258,8 @@ Consonants:
| Key | Translation | Description |
|-----+-------------+--------------------------|
-| ;; | ˀ | Glottal stop |
-| ;\\=' | \\=’ | Glottal stop (alternate) |
+| ;; | \\=’ | Glottal stop |
+| ;\\=' | ˀ | Glottal stop (alternate) |
h, k, l, n, s, t, w, and y are bound to a single key.
@@ -393,9 +393,11 @@ Entries are as with rules in `quail-define-rules'.")
Entries are as with rules in `quail-define-rules'.")
(defconst iroquoian-onondaga-nasal-alist
- '(("n-" ?ñ)
+ '(("n~" ?ñ)
+ ("n-" ["ñ"])
("n--" ["n-"])
- ("N-" ?Ñ)
+ ("N~" ?Ñ)
+ ("N-" ["Ñ"])
("N--" ["N-"]))
"Alist of rules for nasal modifier letters in Onondaga input methods.
Entries are as with rules in `quail-define-rules'.")
@@ -433,10 +435,14 @@ Vowels:
|-----------------------------------------------------------|
| Onondaga Nation, New York orthography |
|-----------------------------------------------------------|
-| en- | eñ | Mid front nasal vowel |
-| EN- | EÑ | Mid front nasal vowel (capital) |
-| on- | oñ | Back high nasal vowel |
-| ON- | OÑ | Back high nasal vowel (capital) |
+| en~ | eñ | Mid front nasal vowel |
+| en- | eñ | (same as above) |
+| EN~ | EÑ | Mid front nasal vowel (capital) |
+| EN- | EÑ | (same as above) |
+| on~ | oñ | Back high nasal vowel |
+| on- | oñ | (same as above) |
+| ON~ | OÑ | Back high nasal vowel (capital) |
+| ON- | OÑ | (same as above) |
| a\" | ä | Low front rounded vowel |
| A\" | Ä | Low front rounded vowel (capital) |
|-----------------------------------------------------------|
@@ -895,8 +901,8 @@ Entries are as with rules in `quail-define-rules'.")
This input method can be used to enter the following languages:
-- Mohawk (Kanien’kéha / Onkwehonwehnéha)
-- Oneida (Onʌyote’a·ká· / Ukwehuwehnéha)
+- Mohawk (Kanien’kéha / Kanyen’kéha / Onkwehonwehnéha)
+- Oneida (Onʌyote’a·ká· / Onyota’a:ká: / Ukwehuwehnéha)
- Cayuga (Gayogo̱ho:nǫhnéha:ˀ)
- Onondaga (Onųdaʔgegáʔ)
- Seneca (Onödowá’ga:’)
@@ -942,10 +948,14 @@ Vowels:
| -------------------------------------------------------------------- |
| (Onondaga Nation, New York) |
| -------------------------------------------------------------------- |
-| en- | eñ | Mid front nasal vowel |
-| EN- | EÑ | Mid front nasal vowel (capital) |
-| on- | oñ | Back high nasal vowel |
-| ON- | OÑ | Back high nasal vowel (capital) |
+| en~ | eñ | Mid front nasal vowel |
+| en- | eñ | (same as above) |
+| EN~ | EÑ | Mid front nasal vowel (capital) |
+| EN- | EÑ | (same as above) |
+| on~ | oñ | Back high nasal vowel |
+| on- | oñ | (same as above) |
+| ON~ | OÑ | Back high nasal vowel (capital) |
+| ON- | OÑ | (same as above) |
| a\" | ä | Low front rounded vowel |
| A\" | Ä | Low front rounded vowel (capital) |
| -------------------------------------------------------------------- |
@@ -991,8 +1001,8 @@ Consonants:
|----------------------------------------------------------------------|
| Oneida |
| -------------------------------------------------------------------- |
-| ;\\=' | ˀ | Glottal stop |
-| ;; | \\=’ | Glottal stop (alternate) |
+| ;; | \\=’ | Glottal stop |
+| ;\\=' | ˀ | Glottal stop (alternate) |
| Single-key consonants: h k l n s t w y |
|----------------------------------------------------------------------|
| Onondaga |
diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index e8ca7574d34..8ced6842508 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -151,7 +151,7 @@ If WARN-UNENCRYPTED, query the user if the connection is
unencrypted."
;; Deprecated by NIST from 2016/2023 (see also CVE-2016-2183).
(3des-cipher medium)
;; Towards TLS 1.3
- (dhe-kx high)
+ (dhe-kx medium)
(rsa-kx high)
(cbc-cipher high))
"Alist of TLS connection checks to perform.
@@ -400,13 +400,17 @@ Diffie-Hellman Fails in Practice\", `https://weakdh.org/'
(defun nsm-protocol-check--dhe-kx (_host _port status &optional _settings)
"Check for existence of DH key exchange based on integer factorization.
-In the years since the discovery of Logjam, it was discovered
-that there were rampant use of small subgroup prime or composite
-number for DHE by many servers, and thus allowed themselves to be
-vulnerable to backdoors[1]. Given the difficulty in validating
-Diffie-Hellman parameters, major browser vendors had started to
-remove DHE since 2016[2]. Emacs stops short of banning DHE and
-terminating connection, but prompts the user instead.
+In the years since the discovery of Logjam, it was discovered that there
+were rampant use of small subgroup prime or composite number for DHE by
+many servers, and thus allowed themselves to be vulnerable to
+backdoors[1]. Given the difficulty in validating Diffie-Hellman
+parameters, major browser vendors had started to remove DHE since
+2016[2]. In 2020, the so-called Racoon Attack was discovered, a
+server-side vulnerability that exploits a side-channel to get the shared
+secret key[3].
+
+Emacs stops short of banning DHE and terminating the connection, but
+prompts the user instead.
References:
@@ -414,7 +418,11 @@ References:
Diffie-Hellman Backdoors in TLS.\",
`https://eprint.iacr.org/2016/999.pdf'
[2]: Chrome Platform Status (2017). \"Remove DHE-based ciphers\",
-`https://www.chromestatus.com/feature/5128908798164992'"
+`https://www.chromestatus.com/feature/5128908798164992'
+[3]: Merget, Brinkmann, Aviram, Somorovsky, Mittmann, and
+Schwenk (2020). \"Raccoon Attack: Finding and Exploiting
+Most-Significant-Bit-Oracles in TLS-DH(E)\"
+`https://raccoon-attack.com/RacoonAttack.pdf'"
(let ((kx (plist-get status :key-exchange)))
(when (string-match "^\\bDHE\\b" kx)
(format-message
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index a2334505db9..2d1c645f42c 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -40,10 +40,7 @@
;;
;; Code is indented to the first tab stop level.
-;; This mode runs two hooks:
-;; 1) `asm-mode-set-comment-hook' before the part of the initialization
-;; depending on `asm-comment-char', and
-;; 2) `asm-mode-hook' at the end of initialization.
+;; This mode runs the hook `asm-mode-hook' at the end of initialization.
;;; Code:
@@ -105,6 +102,8 @@
cpp-font-lock-keywords)
"Additional expressions to highlight in Assembler mode.")
+(make-obsolete-variable 'asm-mode-set-comment-hook 'asm-mode-hook "31.0")
+
;;;###autoload
(define-derived-mode asm-mode prog-mode "Assembler"
"Major mode for editing typical assembler code.
@@ -117,9 +116,7 @@ Features a private abbrev table and the following bindings:
The character used for making comments is set by the variable
`asm-comment-char' (which defaults to `?\\;').
-
-Alternatively, you may set this variable in `asm-mode-set-comment-hook',
-which is called near the beginning of mode initialization.
+Alternatively, you may set this variable in `asm-mode-hook'.
Turning on Asm mode runs the hook `asm-mode-hook' at the end of initialization.
@@ -127,15 +124,18 @@ Special commands:
\\{asm-mode-map}"
:after-hook
(progn
- (run-hooks 'asm-mode-set-comment-hook)
;; Make our own local child of `asm-mode-map'
;; so we can define our own comment character.
- (use-local-map (make-composed-keymap nil asm-mode-map))
- (local-set-key (vector asm-comment-char) #'asm-comment)
+ ;; FIXME: Use `post-self-insert-hook' instead and make it conditional
+ ;; on some "electricity" config var.
+ (unless (lookup-key asm-mode-map (vector asm-comment-char))
+ (use-local-map (make-composed-keymap nil asm-mode-map))
+ (local-set-key (vector asm-comment-char) #'asm-comment))
(set-syntax-table (make-syntax-table asm-mode-syntax-table))
(modify-syntax-entry asm-comment-char "< b")
- (setq-local comment-start (string asm-comment-char)))
+ (unless (local-variable-p 'comment-start)
+ (setq-local comment-start (string asm-comment-char))))
(setq local-abbrev-table asm-mode-abbrev-table)
(setq-local font-lock-defaults '(asm-font-lock-keywords))
@@ -143,6 +143,8 @@ Special commands:
;; Stay closer to the old TAB behavior (was tab-to-tab-stop).
(setq-local tab-always-indent nil)
+ (run-hooks 'asm-mode-set-comment-hook)
+
(setq-local comment-add 1)
(setq-local comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*")
(setq-local comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index fa999dde142..9dda53713f5 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1262,6 +1262,37 @@ with a report function."
"Recent changes collected by `flymake-after-change-function'.")
(defvar flymake-mode)
+(defun flymake--import-foreign-diagnostics ()
+ ;; Other diagnostic sources may already target this buffer's file
+ ;; before we turned on: these sources may be of two types...
+ (let ((source (current-buffer))
+ (bfn buffer-file-name))
+ ;; 1. For `flymake-list-only-diagnostics': here, we do nothing.
+ ;; FIXME: We could remove the corresponding entry from that
+ ;; variable, as we assume that new diagnostics will come in soon
+ ;; via the brand new `flymake-mode' setup. For simplicity's
+ ;; sake, we have opted to leave the backend for now.
+ nil
+ ;; 2. other buffers where a backend has created "foreign
+ ;; diagnostics" and pointed them here. We must highlight them in
+ ;; this buffer, i.e. create overlays for them. Those other
+ ;; buffers and backends are still responsible for them, i.e. the
+ ;; current buffer does not "own" these foreign diags.
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (when flymake-mode
+ (maphash (lambda (_backend state)
+ (maphash (lambda (file diags)
+ (when (or (eq file source)
+ (string= bfn (expand-file-name
file)))
+ (with-current-buffer source
+ (mapc (lambda (diag)
+ (flymake--highlight-line diag
+ 'foreign))
+ diags))))
+ (flymake--state-foreign-diags state)))
+ flymake--state))))))
+
(defun flymake-start (&optional deferred force)
"Start a syntax check for the current buffer.
DEFERRED is a list of symbols designating conditions to wait for
@@ -1335,7 +1366,8 @@ Interactively, with a prefix arg, FORCE is t."
backend))
(t
(flymake--run-backend backend backend-args)))
- nil))))))))
+ nil)))
+ (flymake--import-foreign-diagnostics))))))
(defvar flymake-mode-map
(let ((map (make-sparse-keymap)))
@@ -1396,45 +1428,13 @@ special *Flymake log* buffer." :group 'flymake :lighter
;; AutoResize margins.
(flymake--resize-margins)
- ;; If Flymake happened to be already ON, we must cleanup
- ;; existing diagnostic overlays, lest we forget them by blindly
- ;; reinitializing `flymake--state' in the next line.
- ;; See https://github.com/joaotavora/eglot/issues/223.
- (mapc #'flymake--delete-overlay (flymake--really-all-overlays))
- (setq flymake--state (make-hash-table))
+ ;; We can't just `clrhash' `flymake--state': there may be in
+ ;; in-transit requests from other backends if `flymake-mode' was
+ ;; already active. I.e. `flymake-mode' function should be as
+ ;; idempotent as possible. See bug#69809.
+ (unless flymake--state (setq flymake--state (make-hash-table)))
(setq flymake--recent-changes nil)
-
- (when flymake-start-on-flymake-mode (flymake-start t))
-
- ;; Other diagnostic sources may already target this buffer's file
- ;; before we turned on: these sources may be of two types...
- (let ((source (current-buffer))
- (bfn buffer-file-name))
- ;; 1. For `flymake-list-only-diagnostics': here, we do nothing.
- ;; FIXME: We could remove the corresponding entry from that
- ;; variable, as we assume that new diagnostics will come in soon
- ;; via the brand new `flymake-mode' setup. For simplicity's
- ;; sake, we have opted to leave the backend for now.
- nil
- ;; 2. other buffers where a backend has created "foreign"
- ;; diagnostics and pointed them here. We must highlight them in
- ;; this buffer, i.e. create overlays for them. Those other
- ;; buffers and backends are still responsible for them, i.e. the
- ;; current buffer does not "own" these foreign diags.
- (dolist (buffer (buffer-list))
- (with-current-buffer buffer
- (when (and flymake-mode flymake--state)
- (maphash (lambda (_backend state)
- (maphash (lambda (file diags)
- (when (or (eq file source)
- (string= bfn (expand-file-name
file)))
- (with-current-buffer source
- (mapc (lambda (diag)
- (flymake--highlight-line diag
-
'foreign))
- diags))))
- (flymake--state-foreign-diags state)))
- flymake--state))))))
+ (when flymake-start-on-flymake-mode (flymake-start t)))
;; Turning the mode OFF.
(t
@@ -2045,7 +2045,7 @@ some of this variable's contents the diagnostic
listings.")
(cl-loop
for buf in visited-buffers
do (with-current-buffer buf
- (when (and flymake-mode flymake--state)
+ (when flymake-mode
(maphash
(lambda (_backend state)
(maphash
diff --git a/lisp/repeat.el b/lisp/repeat.el
index 7f6278ee283..fe8145e5daa 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -453,21 +453,25 @@ See `describe-repeat-maps' for a list of all repeatable
commands."
(and (symbolp real-this-command)
(get real-this-command property))))
-(defun repeat-get-map (&optional rep-map)
- "Return a transient map for keys repeatable after the current command."
+(defun repeat-get-map-sym ()
+ "Return a transient map possibly as a symbol."
(when repeat-mode
- (let ((rep-map (or rep-map repeat-map (repeat--command-property
'repeat-map)))
+ (let ((map-sym (or repeat-map (repeat--command-property 'repeat-map)))
(continue (repeat--command-property 'repeat-continue)))
(when continue
(if repeat-in-progress
(when (and (consp continue)
(memq repeat-in-progress continue))
- (setq rep-map repeat-in-progress))
- (setq rep-map nil)))
- (when rep-map
- (when (and (symbolp rep-map) (boundp rep-map))
- (setq rep-map (symbol-value rep-map)))
- rep-map))))
+ (setq map-sym repeat-in-progress))
+ (setq map-sym nil)))
+ map-sym)))
+
+(defun repeat-get-map (map)
+ "Return a transient map for keys repeatable after the current command."
+ (when map
+ (when (and (symbolp map) (boundp map))
+ (setq map (symbol-value map)))
+ map))
(defun repeat-check-key (key map)
"Check if the last KEY is suitable for activating the repeating MAP."
@@ -496,20 +500,21 @@ See `describe-repeat-maps' for a list of all repeatable
commands."
"Function run before commands to handle repeatable keys."
(when (and repeat-mode repeat-keep-prefix repeat-in-progress
(not prefix-arg) current-prefix-arg)
- (let ((map (repeat-get-map)))
+ (let* ((map-sym (repeat-get-map-sym))
+ (map (repeat-get-map map-sym)))
;; Only when repeat-post-hook will activate the same map
(when (repeat-check-map map)
;; Optimize to use less logic in the function `repeat-get-map'
;; for the next call: when called again from `repeat-post-hook'
;; it will use the variable `repeat-map'.
- (setq repeat-map map)
+ (setq repeat-map map-sym)
;; Preserve universal argument
(setq prefix-arg current-prefix-arg)))))
(defun repeat-post-hook ()
"Function run after commands to set transient keymap for repeatable keys."
(let* ((was-in-progress repeat-in-progress)
- (map-sym (or repeat-map (repeat--command-property 'repeat-map)))
+ (map-sym (repeat-get-map-sym))
(map (repeat-get-map map-sym)))
(setq repeat-in-progress nil)
(when (repeat-check-map map)
@@ -561,8 +566,9 @@ This function can be used to force exit of repetition while
it's active."
(defun repeat-echo-message-string (keymap)
"Return a string with the list of repeating keys in KEYMAP."
(let (keys)
- (map-keymap (lambda (key cmd) (and cmd (push (cons key cmd) keys)))
- keymap)
+ (cl--map-keymap-recursively
+ (lambda (key cmd) (and cmd (push (cons (copy-sequence key) cmd) keys)))
+ keymap)
(format-message
"Repeat with %s%s"
(mapconcat (lambda (key-cmd)
@@ -572,7 +578,7 @@ This function can be used to force exit of repetition while
it's active."
(get cmd 'repeat-hint))))
;; Reuse `read-multiple-choice' formatting.
(cdr (rmc--add-key-description (list key hint)))
- (propertize (key-description (vector key))
+ (propertize (key-description key)
'face 'read-multiple-choice-face))))
keys ", ")
(if repeat-exit-key
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 0858e7b4634..b570949bfec 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1662,7 +1662,11 @@ Negative TAB-NUMBER counts tabs from the end of the tab
bar."
;; `window-state-put' fails when called in the minibuffer
(when (window-minibuffer-p)
(select-window (get-mru-window)))
- (window-state-put ws nil 'safe)))
+ (window-state-put ws nil 'safe)
+
+ (when tab-bar-history-mode
+ (puthash (selected-frame) nil tab-bar-history-back)
+ (puthash (selected-frame) nil tab-bar-history-forward))))
(when tab-bar-select-restore-context
(window-point-context-use))
diff --git a/lisp/window.el b/lisp/window.el
index 886128c7daa..b91c45226a1 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3828,7 +3828,8 @@ ABSOLUTE is non-nil, PIXELWISE is implicitly non-nil too."
(top-body
(when body
(+ (window-pixel-top window) border-width
- (window-header-line-height window))))
+ (window-header-line-height window)
+ (window-tab-line-height window))))
(right (+ left (if pixelwise
(window-pixel-width window)
(window-total-width window))))
diff --git a/m4/assert_h.m4 b/m4/assert_h.m4
index 91f446e7f6d..e77524caff9 100644
--- a/m4/assert_h.m4
+++ b/m4/assert_h.m4
@@ -1,5 +1,5 @@
# assert_h.m4
-# serial 4
+# serial 5
dnl Copyright (C) 2011-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -64,11 +64,13 @@ AC_DEFUN([gl_ASSERT_H],
[#if (!(defined __clang__ \
? (defined __cplusplus \
? __cplusplus >= 201703L \
- : __STDC_VERSION__ >= 202000L && __clang_major__ >= 16) \
+ : __STDC_VERSION__ >= 202000L && __clang_major__ >= 16 \
+ && !defined __sun) \
: (defined __GNUC__ \
? (defined __cplusplus \
? __cplusplus >= 201103L && __GNUG__ >= 6 \
- : __STDC_VERSION__ >= 202000L && __GNUC__ >= 13) \
+ : __STDC_VERSION__ >= 202000L && __GNUC__ >= 13 \
+ && !defined __sun) \
: defined HAVE_C_STATIC_ASSERT)) \
&& !defined assert \
&& (!defined __cplusplus \
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 771181cb1bf..dd083cae05d 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -388,6 +388,7 @@ AC_DEFUN([gl_INIT],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1])
])
gl_UNISTD_MODULE_INDICATOR([getopt-posix])
+ gl_MUSL_LIBC
AC_REQUIRE([AC_CANONICAL_HOST])
gl_FUNC_GETRANDOM
gl_CONDITIONAL([GL_COND_OBJ_GETRANDOM],
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index a07738479d4..d0a67608114 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -1,5 +1,5 @@
# string_h.m4
-# serial 39
+# serial 43
dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -70,6 +70,8 @@ AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSTR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASESTR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOK_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STR_STARTSWITH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STR_ENDSWITH])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSLEN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNLEN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCHR])
@@ -84,6 +86,8 @@ AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSPN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSEP])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOK_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBS_STARTSWITH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBS_ENDSWITH])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR_R])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERRORNAME_NP])
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
index 75e97485724..fb69209b4dc 100644
--- a/m4/sys_socket_h.m4
+++ b/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
# sys_socket_h.m4
-# serial 29
+# serial 31
dnl Copyright (C) 2005-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -53,24 +53,10 @@ AC_DEFUN_ONCE([gl_SYS_SOCKET_H],
fi
# We need to check for ws2tcpip.h now.
gl_PREREQ_SYS_H_SOCKET
- AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
- /* sys/types.h is not needed according to POSIX, but the
- sys/socket.h in i386-unknown-freebsd4.10 and
- powerpc-apple-darwin5.5 required it. */
-#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
-#endif
-])
+ gl_PREREQ_SYS_SA_FAMILY
if test $ac_cv_type_struct_sockaddr_storage = no; then
HAVE_STRUCT_SOCKADDR_STORAGE=0
fi
- if test $ac_cv_type_sa_family_t = no; then
- HAVE_SA_FAMILY_T=0
- fi
if test $ac_cv_type_struct_sockaddr_storage != no; then
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
[],
@@ -159,6 +145,32 @@ AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP],
AC_SUBST([HAVE_WS2TCPIP_H])
])
+# Common prerequisites of the <sys/socket.h> replacement and of the <sys/un.h>
+# replacement.
+# Sets and substitutes HAVE_SA_FAMILY_T.
+AC_DEFUN([gl_PREREQ_SYS_SA_FAMILY],
+[
+ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+ AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+ if test $ac_cv_type_sa_family_t = yes; then
+ HAVE_SA_FAMILY_T=1
+ else
+ HAVE_SA_FAMILY_T=0
+ fi
+ AC_SUBST([HAVE_SA_FAMILY_T])
+])
+
# gl_SYS_SOCKET_MODULE_INDICATOR([modulename])
# sets the shell variable that indicates the presence of the given module
# to a C preprocessor expression that will evaluate to 1.
@@ -203,6 +215,5 @@ AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
- HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T])
HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4])
])
diff --git a/src/bytecode.c b/src/bytecode.c
index fcf369400b9..d62d7d067b1 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -327,7 +327,7 @@ If the third argument is incorrect, Emacs may crash. */)
static void
bcall0 (Lisp_Object f)
{
- Ffuncall (1, &f);
+ calln (f);
}
/* The bytecode stack size in bytes.
diff --git a/src/comp.c b/src/comp.c
index 96b314b2709..2603a2f4334 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -862,7 +862,7 @@ freloc_check_fill (void)
static void
bcall0 (Lisp_Object f)
{
- Ffuncall (1, &f);
+ calln (f);
}
static gcc_jit_block *
@@ -2279,7 +2279,7 @@ emit_limple_insn (Lisp_Object insn)
ptrdiff_t i = 0;
FOR_EACH_TAIL (p)
{
- if (i == sizeof (arg) / sizeof (Lisp_Object))
+ if (i == ARRAYELTS (arg))
break;
arg[i++] = XCAR (p);
}
diff --git a/src/eval.c b/src/eval.c
index b0cc2505a35..941d121c2fb 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2967,7 +2967,7 @@ run_hook_with_args_2 (Lisp_Object hook, Lisp_Object arg1,
Lisp_Object arg2)
Lisp_Object
apply1 (Lisp_Object fn, Lisp_Object arg)
{
- return NILP (arg) ? Ffuncall (1, &fn) : CALLN (Fapply, fn, arg);
+ return NILP (arg) ? calln (fn) : CALLN (Fapply, fn, arg);
}
DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0,
diff --git a/src/fns.c b/src/fns.c
index 191154c651a..07df2a5e90e 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3307,14 +3307,16 @@ ARRAY is a vector, string, char-table, or bool-vector.
*/)
return array;
}
-DEFUN ("clear-string", Fclear_string, Sclear_string,
- 1, 1, 0,
+DEFUN ("clear-string", Fclear_string, Sclear_string, 1, 1, 0,
doc: /* Clear the contents of STRING.
-This makes STRING unibyte and may change its length. */)
+This makes STRING unibyte, clears its contents to null characters, and
+removes all text properties. This may change its length. */)
(Lisp_Object string)
{
CHECK_STRING (string);
ptrdiff_t len = SBYTES (string);
+ Fset_text_properties (make_fixnum (0), make_fixnum (SCHARS (string)),
+ Qnil, string);
if (len != 0 || STRING_MULTIBYTE (string))
{
CHECK_IMPURE (string, XSTRING (string));
diff --git a/src/font.c b/src/font.c
index 86382267a4a..dfe479f9355 100644
--- a/src/font.c
+++ b/src/font.c
@@ -418,8 +418,24 @@ font_style_to_value (enum font_property_index prop,
Lisp_Object val,
eassert (len < 255);
elt = make_vector (2, make_fixnum (100));
ASET (elt, 1, val);
- ASET (font_style_table, prop - FONT_WEIGHT_INDEX,
- CALLN (Fvconcat, table, make_vector (1, elt)));
+ Lisp_Object new_table = CALLN (Fvconcat, table, make_vector (1, elt));
+ /* Update the corresponding variable with the new value of the
+ modified slot of font_style_table. */
+ switch (prop)
+ {
+ case FONT_WEIGHT_INDEX:
+ Vfont_weight_table = new_table;
+ break;
+ case FONT_SLANT_INDEX:
+ Vfont_slant_table = new_table;
+ break;
+ case FONT_WIDTH_INDEX:
+ Vfont_width_table = new_table;
+ break;
+ default:
+ break;
+ }
+ ASET (font_style_table, prop - FONT_WEIGHT_INDEX, new_table);
return (100 << 8) | (i << 4);
}
else
@@ -5977,6 +5993,9 @@ This variable cannot be set; trying to do so will signal
an error. */);
Vfont_width_table = BUILD_STYLE_TABLE (width_table);
make_symbol_constant (intern_c_string ("font-width-table"));
+ /* Because the above 3 variables are slots in the vector we create
+ below, and because that vector is staticpro'd, we don't explicitly
+ staticpro the variables, to avoid wasting slots in staticvec[]. */
staticpro (&font_style_table);
font_style_table = CALLN (Fvector, Vfont_weight_table, Vfont_slant_table,
Vfont_width_table);
diff --git a/src/lisp.h b/src/lisp.h
index e3142f3b8cc..a8fe2e9f6bc 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3528,7 +3528,7 @@ enum maxargs
INLINE Lisp_Object
call0 (Lisp_Object fn)
{
- return Ffuncall (1, &fn);
+ return calln (fn);
}
extern void defvar_lisp (struct Lisp_Objfwd const *, char const *);
diff --git a/src/msdos.c b/src/msdos.c
index 6ee35b9e853..63a5400bc7d 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -2069,7 +2069,7 @@ dos_set_keyboard (int code, int always)
keyboard_map_all = always;
dos_keyboard_layout = 1;
- for (i = 0; i < (sizeof (keyboard_layout_list)/sizeof (struct
keyboard_layout_list)); i++)
+ for (i = 0; i < ARRAYELTS (keyboard_layout_list); i++)
if (code == keyboard_layout_list[i].country_code)
{
keyboard = keyboard_layout_list[i].keyboard_map;
@@ -2512,7 +2512,7 @@ dos_rawgetc (void)
one. */
if (code == -1)
{
- if (sc >= (sizeof (ibmpc_translate_map) / sizeof (short)))
+ if (sc >= ARRAYELTS (ibmpc_translate_map))
continue;
if ((code = ibmpc_translate_map[sc]) == Ignore)
continue;
diff --git a/src/sysdep.c b/src/sysdep.c
index 188b3c3958a..3d9c49d9280 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -3160,7 +3160,7 @@ static const struct speed_struct speeds[] =
static speed_t
convert_speed (speed_t speed)
{
- for (size_t i = 0; i < sizeof speeds / sizeof speeds[0]; i++)
+ for (size_t i = 0; i < ARRAYELTS (speeds); i++)
{
if (speed == speeds[i].internal)
return speed;
@@ -3380,7 +3380,7 @@ list_system_processes (void)
int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC};
#endif
size_t len;
- size_t mibsize = sizeof mib / sizeof mib[0];
+ size_t mibsize = ARRAYELTS (mib);
struct kinfo_proc *procs;
size_t i;
diff --git a/src/thread.c b/src/thread.c
index bb62283dd21..5610f8be0dd 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -741,7 +741,7 @@ invoke_thread_function (void)
{
specpdl_ref count = SPECPDL_INDEX ();
- current_thread->result = Ffuncall (1, ¤t_thread->function);
+ current_thread->result = calln (current_thread->function);
return unbind_to (count, Qnil);
}
diff --git a/src/w32fns.c b/src/w32fns.c
index c7963d2c616..452740f46ca 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4154,7 +4154,7 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg,
UINT wParam,
windows_msg.time = GetMessageTime ();
TranslateMessage (&windows_msg);
}
- count = get_wm_chars (hwnd, buf, sizeof (buf)/sizeof (*buf), 1,
+ count = get_wm_chars (hwnd, buf, ARRAYELTS (buf), 1,
/* The message may have been synthesized by
who knows what; be conservative. */
modifier_set (VK_LCONTROL)
@@ -8379,8 +8379,7 @@ DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog,
2, 5, 0,
file_details_w->lStructSize = sizeof (*file_details_w);
/* Set up the inout parameter for the selected file name. */
file_details_w->lpstrFile = filename_buf_w;
- file_details_w->nMaxFile =
- sizeof (filename_buf_w) / sizeof (*filename_buf_w);
+ file_details_w->nMaxFile = ARRAYELTS (filename_buf_w);
file_details_w->hwndOwner = FRAME_W32_WINDOW (f);
/* Undocumented Bug in Common File Dialog:
If a filter is not specified, shell links are not resolved. */
@@ -8413,8 +8412,7 @@ DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog,
2, 5, 0,
else
file_details_a->lStructSize = sizeof (*file_details_a);
file_details_a->lpstrFile = filename_buf_a;
- file_details_a->nMaxFile =
- sizeof (filename_buf_a) / sizeof (*filename_buf_a);
+ file_details_a->nMaxFile = ARRAYELTS (filename_buf_a);
file_details_a->hwndOwner = FRAME_W32_WINDOW (f);
file_details_a->lpstrFilter = filter_a;
file_details_a->lpstrInitialDir = dir_a;
diff --git a/src/w32term.c b/src/w32term.c
index c81779b8517..cb7bc7e4540 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -276,7 +276,7 @@ int event_record_index;
record_event (char *locus, int type)
{
- if (event_record_index == sizeof (event_record) / sizeof (struct record))
+ if (event_record_index == ARRAYELTS (event_record))
event_record_index = 0;
event_record[event_record_index].locus = locus;
@@ -5259,7 +5259,7 @@ w32_read_socket (struct terminal *terminal,
hlinfo->mouse_face_hidden = true;
}
- if (temp_index == sizeof temp_buffer / sizeof (short))
+ if (temp_index == ARRAYELTS (temp_buffer))
temp_index = 0;
temp_buffer[temp_index++] = msg.msg.wParam;
inev.kind = NON_ASCII_KEYSTROKE_EVENT;
@@ -5285,7 +5285,7 @@ w32_read_socket (struct terminal *terminal,
hlinfo->mouse_face_hidden = true;
}
- if (temp_index == sizeof temp_buffer / sizeof (short))
+ if (temp_index == ARRAYELTS (temp_buffer))
temp_index = 0;
temp_buffer[temp_index++] = msg.msg.wParam;
@@ -5400,7 +5400,7 @@ w32_read_socket (struct terminal *terminal,
hlinfo->mouse_face_hidden = true;
}
- if (temp_index == sizeof temp_buffer / sizeof (short))
+ if (temp_index == ARRAYELTS (temp_buffer))
temp_index = 0;
temp_buffer[temp_index++] = msg.msg.wParam;
inev.kind = MULTIMEDIA_KEY_EVENT;
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el
b/test/lisp/emacs-lisp/cl-macs-tests.el
index 663961dc317..628bae36e48 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -728,6 +728,15 @@ collection clause."
(cons (f1 7) 8)))
'(7 . 8))))
+(ert-deftest cl-macs--test-cl-block-lexbind-bug-75498 ()
+ (should (equal
+ (let ((ret (lambda (f)
+ (cl-block a (funcall f) (cl-return-from a :ret)))))
+ (cl-block a
+ (list :oops
+ (funcall ret (lambda () (cl-return-from a :clo))))))
+ :clo)))
+
(ert-deftest cl-flet/edebug ()
"Check that we can instrument `cl-flet' forms (bug#65344)."
(with-temp-buffer
diff --git a/test/lisp/progmodes/flymake-tests.el
b/test/lisp/progmodes/flymake-tests.el
index 6d639708c90..7831cc87ec4 100644
--- a/test/lisp/progmodes/flymake-tests.el
+++ b/test/lisp/progmodes/flymake-tests.el
@@ -183,6 +183,26 @@ SEVERITY-PREDICATE is used to setup
("no-problems.h")
(should-error (flymake-goto-next-error nil nil t)))))
+(ert-deftest foreign-diagnostics ()
+ "Test Flymake in one file impacts another"
+ (skip-unless (and (executable-find "gcc")
+ (not (ert-gcc-is-clang-p))
+ (executable-find "make")))
+ (flymake-tests--with-flymake
+ ("another-problematic-file.c")
+ (flymake-tests--with-flymake
+ ("some-problems.h")
+ (search-forward "frob")
+ (backward-char 1)
+ (should (eq 'flymake-note (face-at-point)))
+ (let ((diags (flymake-diagnostics (point))))
+ (should (= 1 (length diags)))
+ (should (eq :note (flymake-diagnostic-type (car diags))))
+ ;; This note would never been here if it werent' a foreign
+ ;; diagnostic sourced in 'another-problematic-file.c'.
+ (should (string-match "previous declaration"
+ (flymake-diagnostic-text (car diags))))))))
+
(defmacro flymake-tests--assert-set (set
should
should-not)
diff --git a/test/lisp/repeat-tests.el b/test/lisp/repeat-tests.el
index 70690722164..8e564b3e081 100644
--- a/test/lisp/repeat-tests.el
+++ b/test/lisp/repeat-tests.el
@@ -233,8 +233,11 @@
'((1 u)) "tz")
;; 'C-M-o' shared with another map should continue current map
(repeat-tests--check
- "C-M-s t C-M-o t C-M-o t z"
- '((1 s) (1 t) (1 o) (1 t) (1 o) (1 t)) "z"))))
+ "C-M-s t C-M-o C-M-o t z"
+ '((1 s) (1 t) (1 o) (1 o) (1 t)) "z")
+ (repeat-tests--check
+ "C-M-a c C-M-o C-M-o c z"
+ '((1 a) (1 c) (1 o) (1 o) (1 c)) "z"))))
(require 'use-package)