commit 458135155675a29a2c064998afc0cb416cd38b52 (HEAD, refs/remotes/origin/master) Author: Yuan Fu Date: Sun Jan 19 22:34:11 2025 -0800 Make treesit-language-remap-alist completely transparent (bug#72388) * doc/lispref/parsing.texi (Using Parser): Update manual. * src/treesit.c (Ftreesit_parser_create): Use the LANGUAGE argument given as the language for the parser, not the actual language. diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index bd8b0b1f561..8f1ee614ff2 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -570,10 +570,27 @@ The value of this variable should be an alist of in the alist, creating a parser for @var{language-a} actually creates a parser for @var{language-b}. By extension, anything that creates a node or makes a query of @var{language-a} will be redirected to use -@var{language-b} instead. +@var{language-b} instead. This mapping is completely transparent, the +parser created will report as @var{language-b}, and the sames goes for +nodes created by this parser. -Note that calling @code{treesit-parser-language} on a parser for -@var{language-a} still returns @var{language-a}. +Specifically, the parser created by @code{treesit-parser-create} will +report to use whatever @var{language} was given to it. For example, +if language @code{cpp} is mapped to @code{cuda}: + +@example +@group +(setq treesit-language-remap-alist '((cpp . cuda))) + +(treesit-parser-language (treesit-parser-create 'cpp)) +;; => 'cpp + +(treesit-parser-language (treesit-parser-create 'cuda)) +;; => 'cuda +@end group +@end example + +Even though both parser are actually @code{cuda} parser. @end defvar @node Retrieving Nodes diff --git a/src/treesit.c b/src/treesit.c index 2f06de67ad8..f179e4561cf 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1657,8 +1657,8 @@ an indirect buffer. */) treesit_check_buffer_size (buf); - language = resolve_language_symbol (language); - CHECK_SYMBOL (language); + Lisp_Object remapped_lang = resolve_language_symbol (language); + CHECK_SYMBOL (remapped_lang); /* See if we can reuse a parser. */ if (NILP (no_reuse)) @@ -1679,7 +1679,7 @@ an indirect buffer. */) Lisp_Object signal_data = Qnil; TSParser *parser = ts_parser_new (); struct treesit_loaded_lang loaded_lang - = treesit_load_language (language, &signal_symbol, &signal_data); + = treesit_load_language (remapped_lang, &signal_symbol, &signal_data); TSLanguage *lang = loaded_lang.lang; if (lang == NULL) xsignal (signal_symbol, signal_data); @@ -1687,7 +1687,10 @@ an indirect buffer. */) always succeed. */ ts_parser_set_language (parser, lang); - /* Create parser. */ + /* Create parser. Use the unmapped LANGUAGE symbol, so the nodes + created by this parser (and this parser) self identify as the + unmapped language. This makes the grammar mapping completely + transparent. */ Lisp_Object lisp_parser = make_treesit_parser (buf_orig, parser, NULL, language, tag); commit 9093a0f824d709af15a29da528259dbca30f5c29 Author: Stefan Kangas Date: Mon Jan 20 03:10:34 2025 +0100 pdumper: Add static_assert for EMACS_RELOC_TYPE_BITS * src/pdumper.c: Add static_assert for EMACS_RELOC_TYPE_BITS. diff --git a/src/pdumper.c b/src/pdumper.c index 3c143fdc2c5..e83c7bcf9a1 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -226,6 +226,8 @@ enum EMACS_RELOC_LENGTH_BITS = DUMP_OFF_WIDTH - EMACS_RELOC_TYPE_BITS }; +static_assert (RELOC_EMACS_EMACS_LV <= (1 << EMACS_RELOC_TYPE_BITS)); + struct emacs_reloc { ENUM_BF (emacs_reloc_type) type : EMACS_RELOC_TYPE_BITS; commit 278d1994af4c52a5590c793d27d8fd2867fe7a66 Author: Stefan Kangas Date: Mon Jan 20 01:55:19 2025 +0100 Remove redundant case_Lisp_Int macro The case_Lisp_Int macro was originally introduced with different definitions depending on USE_2_TAGS_FOR_INTS. However, since commit 2b5701247845, we have assumed that USE_2_TAGS_FOR_INTS is always defined, and the macro has only a single definition. As a result, the macro is now unnecessary, and replacing it with standard C case labels improves readability and understanding. * src/lisp.h (case_Lisp_Int): Delete macro. * src/alloc.c (process_mark_stack, survives_gc_p): * src/data.c (Fcl_type_of): * src/fns.c (value_cmp, sxhash_obj): * src/pdumper.c (dump_object): * src/print.c (print_object): * src/xfaces.c (face_attr_equal_p): Remove uses of above macro. diff --git a/src/alloc.c b/src/alloc.c index d2d68256139..c4e2ff52015 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -7383,7 +7383,8 @@ process_mark_stack (ptrdiff_t base_sp) break; } - case_Lisp_Int: + case Lisp_Int0: + case Lisp_Int1: break; default: @@ -7437,7 +7438,8 @@ survives_gc_p (Lisp_Object obj) switch (XTYPE (obj)) { - case_Lisp_Int: + case Lisp_Int0: + case Lisp_Int1: survives_p = true; break; diff --git a/src/data.c b/src/data.c index 8236721961f..077719c4062 100644 --- a/src/data.c +++ b/src/data.c @@ -209,7 +209,8 @@ a fixed set of types. */) { switch (XTYPE (object)) { - case_Lisp_Int: + case Lisp_Int0: + case Lisp_Int1: return Qfixnum; case Lisp_Symbol: diff --git a/src/fns.c b/src/fns.c index 7c2d571589c..081ed2b9f51 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3069,7 +3069,8 @@ value_cmp (Lisp_Object a, Lisp_Object b, int maxdepth) switch (XTYPE (a)) { - case_Lisp_Int: + case Lisp_Int0: + case Lisp_Int1: { EMACS_INT ia = XFIXNUM (a); if (FIXNUMP (b)) @@ -5522,7 +5523,8 @@ sxhash_obj (Lisp_Object obj, int depth) switch (XTYPE (obj)) { - case_Lisp_Int: + case Lisp_Int0: + case Lisp_Int1: return XUFIXNUM (obj); case Lisp_Symbol: diff --git a/src/lisp.h b/src/lisp.h index d0354d83629..0ac1e1933fd 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -468,7 +468,6 @@ typedef EMACS_INT Lisp_Word; /* Fixnums use 2 tags, to give them one extra bit, thus extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ #define INTMASK (EMACS_INT_MAX >> (INTTYPEBITS - 1)) -#define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 /* Idea stolen from GDB. Pedantic GCC complains about enum bitfields, and xlc and Oracle Studio c99 complain vociferously about them. */ diff --git a/src/pdumper.c b/src/pdumper.c index 97d3d1412b7..3c143fdc2c5 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -3238,7 +3238,8 @@ dump_object (struct dump_context *ctx, Lisp_Object object) case Lisp_Float: offset = dump_float (ctx, XFLOAT (object)); break; - case_Lisp_Int: + case Lisp_Int0: + case Lisp_Int1: eassert ("should not be dumping int: is self-representing" && 0); abort (); default: diff --git a/src/print.c b/src/print.c index f990d6a5dc1..43698f309b1 100644 --- a/src/print.c +++ b/src/print.c @@ -2291,7 +2291,8 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) switch (XTYPE (obj)) { - case_Lisp_Int: + case Lisp_Int0: + case Lisp_Int1: { EMACS_INT i = XFIXNUM (obj); char escaped_name; diff --git a/src/xfaces.c b/src/xfaces.c index 5e76e598d84..e9500b98524 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -4425,7 +4425,8 @@ face_attr_equal_p (Lisp_Object v1, Lisp_Object v2) return memcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0; - case_Lisp_Int: + case Lisp_Int0: + case Lisp_Int1: case Lisp_Symbol: return false; commit dcccb9256262f8e992b75602dd4e861371b97361 Author: Paul Eggert Date: Sun Jan 19 16:23:06 2025 -0800 Port better to AIX 7.3 with -lsqlite3 but not sqlite3.h * configure.ac (HAVE_SQLITE): Yes only if sqlite3.h can be included (Bug#75667). diff --git a/configure.ac b/configure.ac index 1d8c281ee21..ba39074c83a 100644 --- a/configure.ac +++ b/configure.ac @@ -3716,9 +3716,18 @@ if test "${with_sqlite3}" != "no"; then CFLAGS="$SAVE_CFLAGS" fi else - AC_CHECK_LIB([sqlite3], [sqlite3_open_v2], - [HAVE_SQLITE3=yes], - [HAVE_SQLITE3=no]) + AC_CACHE_CHECK([for sqlite3], + [emacs_cv_have_sqlite3], + [OLIBS=$LIBS + LIBS="-lsqlite3 $LIBS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include + sqlite3 *handle;]], + [[return sqlite3_open_v2 ("", &handle, 0, "");]])], + [emacs_cv_have_sqlite3=yes], + [emacs_cv_have_sqlite3=no]) + LIBS=$OLIBS]) + HAVE_SQLITE3=$emacs_cv_have_sqlite3 if test "$HAVE_SQLITE3" = "yes"; then SQLITE3_LIBS=-lsqlite3 LIBS="$SQLITE3_LIBS $LIBS" commit a94988c01d45e4e494789d8715eed7ff7b383341 Author: Paul Eggert Date: Sun Jan 19 11:29:59 2025 -0800 Port better to AIX 7.3 with -lz but not zlib.h * configure.ac (HAVE_ZLIB, LIBZ): Define only if zlib.h can be included (Bug#75667). diff --git a/configure.ac b/configure.ac index debdaadfc7b..1d8c281ee21 100644 --- a/configure.ac +++ b/configure.ac @@ -5036,22 +5036,29 @@ AC_SUBST([LCMS2_LIBS]) HAVE_ZLIB=no LIBZ= -if test "${with_zlib}" != "no"; then - OLIBS=$LIBS - AC_SEARCH_LIBS([inflateEnd], [z], [HAVE_ZLIB=yes]) - LIBS=$OLIBS - case $ac_cv_search_inflateEnd in - -*) LIBZ=$ac_cv_search_inflateEnd ;; - esac -fi -if test "${HAVE_ZLIB}" = "yes"; then - AC_DEFINE([HAVE_ZLIB], [1], - [Define to 1 if you have the zlib library (-lz).]) - ### mingw32 doesn't use -lz, since it loads the library dynamically. - if test "${opsys}" = "mingw32"; then - LIBZ= - fi -fi +AS_IF([test "${with_zlib}" != "no"], + [AC_CACHE_CHECK([for library containing inflateEnd], + [emacs_cv_libz], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include + z_stream stream;]], + [[return inflateEnd (&stream);]])]) + OLIBS=$LIBS + for emacs_cv_libz in '' -lz no; do + test "$emacs_cv_libz" = no && break + LIBS="$emacs_cv_libz $OLIBS" + AC_LINK_IFELSE([], [break]) + done + LIBS=$OLIBS]) + + AS_CASE([$emacs_cv_libz], + [-* | ''], + [# mingw32 doesn't use -lz, since it loads the library dynamically. + AS_CASE([$opsys], + [mingw32], [LIBZ=], + [LIBZ=$emacs_cv_libz]) + HAVE_ZLIB=yes + AC_DEFINE([HAVE_ZLIB], [1], + [Define to 1 if you have the zlib library (-lz).])])]) AC_SUBST([LIBZ]) ### Dynamic library support commit 4021b92403ca184bc0cd52f33ed5c6e27780cede Author: Stefan Kangas Date: Sun Jan 19 18:09:36 2025 +0100 Remove workaround for AIX 3.2 crashes Emacs does not support AIX 3.2 since 2008. This workaround for AIX 3.2.3 and 3.2.4 (released in 1992) was introduced in 1999 and was only active with #ifdef AIX3_2. In 2008, the condition was changed to #ifdef AIX when support for these older AIX versions was dropped. I couldn't find any justification for why this workaround was retained (instead of being removed) in the commit message or mailing list archives. Given that users of AIX 4.0 (released in 1995) or later have not had this workaround for over a decade (1999-2008), it seems safe to assume that it is no longer necessary. Removing it will also prevent the incorrect overriding of the LANG variable on those systems. * src/emacs.c [AIX] (main): Remove workaround for AIX 3.2. (Bug#75153) diff --git a/src/emacs.c b/src/emacs.c index 596dd117a76..6f005c64351 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2195,14 +2195,6 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem init_ntproc (will_dump_p ()); /* must precede init_editfns. */ #endif - /* AIX crashes are reported in system versions 3.2.3 and 3.2.4 - if this is not done. Do it after set_global_environment so that we - don't pollute Vglobal_environment. */ - /* Setting LANG here will defeat the startup locale processing... */ -#ifdef AIX - xputenv ("LANG=C"); -#endif - /* Init buffer storage and default directory of main buffer. */ init_buffer (); commit c37aa3df9d84325924a7a163271154447dfc0cfd Author: Stefan Kangas Date: Sun Jan 19 17:04:12 2025 +0100 Prefer the 'min'/'max' macros where possible * src/composite.c (find_automatic_composition): * src/lisp.h (clip_to_bounds): * src/pgtkfns.c (PATH_MAX_LEN): * src/profiler.c (approximate_median): * src/unexmacosx.c (unexec_write_zero, unexec_copy, unexec_realloc): * src/xdisp.c (get_nearby_bol_pos): Prefer the 'min' and 'max' macros. diff --git a/src/composite.c b/src/composite.c index f857dbf77ee..2ef72a33d2e 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1676,7 +1676,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, ptrdiff_t backlim, } else { - head = backlim < 0 ? 0 : backlim, tail = SCHARS (string), stop = -1; + head = max (backlim, 0), tail = SCHARS (string), stop = -1; cur.pos_byte = string_char_to_byte (string, cur.pos); cur.p = SDATA (string) + cur.pos_byte; } diff --git a/src/lisp.h b/src/lisp.h index c9f9f17e0db..d0354d83629 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1362,7 +1362,7 @@ EQ (Lisp_Object x, Lisp_Object y) INLINE intmax_t clip_to_bounds (intmax_t lower, intmax_t num, intmax_t upper) { - return num < lower ? lower : num <= upper ? num : upper; + return num < lower ? lower : min (num, upper); } /* Construct a Lisp_Object from a value or address. */ diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 9251e137f09..21456f4f489 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -1782,8 +1782,7 @@ Some window managers may refuse to restack windows. */) #define PATH_FOR_CLASS_TYPE "/org/gnu/emacs/defaults-by-class/" #define PATH_PREFIX_FOR_NAME_TYPE "/org/gnu/emacs/defaults-by-name/" #define PATH_MAX_LEN \ - (sizeof PATH_FOR_CLASS_TYPE > sizeof PATH_PREFIX_FOR_NAME_TYPE ? \ - sizeof PATH_FOR_CLASS_TYPE : sizeof PATH_PREFIX_FOR_NAME_TYPE) + (max (sizeof PATH_FOR_CLASS_TYPE, sizeof PATH_PREFIX_FOR_NAME_TYPE)) static inline int pgtk_is_lower_char (int c) diff --git a/src/profiler.c b/src/profiler.c index 4c88f676fbd..03e8d007e9f 100644 --- a/src/profiler.c +++ b/src/profiler.c @@ -238,8 +238,8 @@ approximate_median (log_t *log, int start, int size) EMACS_INT i3 = approximate_median (log, start2 + newsize, size - 2 * newsize); return (i1 < i2 - ? (i2 < i3 ? i2 : (i1 < i3 ? i3 : i1)) - : (i1 < i3 ? i1 : (i2 < i3 ? i3 : i2))); + ? (i2 < i3 ? i2 : max (i1, i3)) + : (i1 < i3 ? i1 : max (i2, i3))); } } diff --git a/src/unexmacosx.c b/src/unexmacosx.c index f453f8ea7bb..10524224711 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -250,7 +250,7 @@ unexec_write_zero (off_t dest, size_t count) while (count > 0) { - bytes = count > UNEXEC_COPY_BUFSZ ? UNEXEC_COPY_BUFSZ : count; + bytes = min (count, UNEXEC_COPY_BUFSZ); if (write (outfd, buf, bytes) != bytes) return 0; count -= bytes; @@ -278,7 +278,7 @@ unexec_copy (off_t dest, off_t src, ssize_t count) while (count > 0) { - bytes_to_read = count > UNEXEC_COPY_BUFSZ ? UNEXEC_COPY_BUFSZ : count; + bytes_to_read = min (count, UNEXEC_COPY_BUFSZ); bytes_read = read (infd, buf, bytes_to_read); if (bytes_read <= 0) return 0; @@ -1355,7 +1355,7 @@ unexec_realloc (void *old_ptr, size_t new_size) if (ptr_in_unexec_regions (old_ptr)) { size_t old_size = ((unexec_malloc_header_t *) old_ptr)[-1].u.size; - size_t size = new_size > old_size ? old_size : new_size; + size_t size = min (new_size, old_size); p = malloc (new_size); if (size) diff --git a/src/xdisp.c b/src/xdisp.c index 4087ff975ee..53364e83eba 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3670,7 +3670,7 @@ get_nearby_bol_pos (ptrdiff_t pos) for (dist = 500; dist <= 500000; dist *= 10) { pos_bytepos = pos == BEGV ? BEGV_BYTE : CHAR_TO_BYTE (pos); - start = pos - dist < BEGV ? BEGV : pos - dist; + start = max (pos - dist, BEGV); for (cur = start; cur < pos; cur = next) { next = find_newline1 (cur, CHAR_TO_BYTE (cur), @@ -3684,7 +3684,7 @@ get_nearby_bol_pos (ptrdiff_t pos) if (bol >= BEGV || start == BEGV) break; else - pos = pos - dist < BEGV ? BEGV : pos - dist; + pos = max (pos - dist, BEGV); } eassert (bol <= init_pos); return bol; commit f3b57fa519797df13f2e0ed9ebb097c37f5d71ce Author: Stefan Kangas Date: Sun Jan 19 17:15:20 2025 +0100 Delete duplicate 'min' macro * src/gmalloc.c (min): Delete duplicate macro. We import lisp.h unconditionally, so it is always defined here. diff --git a/src/gmalloc.c b/src/gmalloc.c index 3cb77b99997..fe6a0412a9b 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c @@ -1277,10 +1277,6 @@ License along with this library. If not, see . The author may be reached (Email) at the address mike@ai.mit.edu, or (US mail) as Mike Haertel c/o Free Software Foundation. */ -#ifndef min -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - /* Debugging hook for realloc. */ static void *(*grealloc_hook) (void *, size_t); commit 4106fd28c7719d363395438400530752fb86f57c Author: Stefan Kangas Date: Sun Jan 19 15:10:45 2025 +0100 Make NSM warn for RSA key exchange on medium severity * lisp/net/nsm.el (network-security-protocol-checks): Bump rsa-kx severity to medium. (nsm-protocol-check--dhe-kx): Update docstring to describe several more recent attacks, and its removal in TLS 1.3. diff --git a/etc/NEWS b/etc/NEWS index 0b849dec450..22cf8c636c2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -95,9 +95,10 @@ instead of its now-obsolete variable. *** NSM warns about TLS 1.1 by default. It has been deprecated by RFC8996, published in 2021. -*** NSM 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. +*** NSM warns about DHE and RSA key exchange by default. +Emacs now warns about ephemeral Diffie-Hellman key exchange, and static +RSA key exchange, also when 'network-security-level' is customized to +its default 'medium' value. ** Etags diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el index 6ca491f9f26..448a2b4aa91 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el @@ -152,7 +152,7 @@ If WARN-UNENCRYPTED, query the user if the connection is unencrypted." (3des-cipher medium) ;; Towards TLS 1.3 (dhe-kx medium) - (rsa-kx high) + (rsa-kx medium) (cbc-cipher high)) "Alist of TLS connection checks to perform. The key is the name of the check, and the value is the minimum security @@ -174,7 +174,7 @@ See also: `nsm-check-tls-connection', `nsm-save-host-names', (const :tag "Low" low) (const :tag "Medium" medium) (const :tag "High" high)))) - :version "30.1") + :version "31.1") (defun nsm-save-fingerprint-maybe (host port status &rest _) "Save the certificate's fingerprint. @@ -349,18 +349,30 @@ private key had been compromised, the attacker will be able to decrypt any past TLS session recorded, as opposed to just one TLS session if the key exchange was conducted via a key exchange method that offers perfect forward secrecy, such as ephemeral -Diffie-Hellman key exchange. +Diffie-Hellman key exchange[1]. -By default, this check is only enabled when -`network-security-level' is set to `high' for compatibility -reasons. +There is a long history of attacks against static RSA key exchange in +TLS, dating back to Bleichenbacher's attack in 1998, and mitigations +that have subsequently themselves been broken. In 2017, it was +discovered that an attacker can decrypt ciphertexts or sign messages +with the server's private key[2]. The poor security of this key +exchange protocol was confirmed by new attacks discovered in 2018[3]. +RSA key exchange has been removed in TLS 1.3 (RFC 8446)[4]. Reference: -Sheffer, Holz, Saint-Andre (May 2015). \"Recommendations for Secure -Use of Transport Layer Security (TLS) and Datagram Transport Layer -Security (DTLS)\", \"(4.1. General Guidelines)\" -`https://tools.ietf.org/html/rfc7525#section-4.1'" +[1]: Sheffer, Holz, Saint-Andre (May 2015). \"Recommendations for +Secure Use of Transport Layer Security (TLS) and Datagram Transport +Layer Security (DTLS)\", \"(4.1. General Guidelines)\" +`https://tools.ietf.org/html/rfc7525#section-4.1' +[2]: Böck, Somorovsky, Young (August 2018). \"Return Of +Bleichenbacher’s Oracle Threat (ROBOT)\", +`https://www.usenix.org/system/files/conference/usenixsecurity18/sec18-bock.pdf' +[3]: Ronen, Gillham, Genkin, Shamir, Wong, and Yarom (2018). \"The 9 +Lives of Bleichenbacher’s CAT: New Cache ATtacks on TLS +Implementations.\", `https://eprint.iacr.org/2018/1173.pdf' +[4]: Rescorla (2018). \"The Transport Layer Security (TLS) Protocol +Version 1.3\", `https://tools.ietf.org/html/rfc8446'" (let ((kx (plist-get status :key-exchange))) (and (string-match "^\\bRSA\\b" kx) (format-message commit 6a0db0d80d538978f4e681b5947d60b7fb93cf9e Author: Stefan Kangas Date: Sun Jan 19 05:29:27 2025 +0100 Delete unused aliases for calln * src/lisp.h (call1, call2, call3, call4) (call5, call6, call7, call8): Delete unused aliases for calln. diff --git a/src/lisp.h b/src/lisp.h index 9038a37e421..c9f9f17e0db 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3513,15 +3513,6 @@ enum maxargs 'Finsert (1, &text);'. */ #define CALLN(f, ...) CALLMANY (f, ((Lisp_Object []) {__VA_ARGS__})) #define calln(...) CALLN (Ffuncall, __VA_ARGS__) -/* Compatibility aliases. */ -#define call1 calln -#define call2 calln -#define call3 calln -#define call4 calln -#define call5 calln -#define call6 calln -#define call7 calln -#define call8 calln /* Define 'call0' as a function rather than a CPP macro because we sometimes want to pass it as a first class function. */ commit 251e3d2654ae8e5fdee4624d9af93fb9c0e1b698 Author: Stefan Kangas Date: Sun Jan 19 04:59:22 2025 +0100 Replace call[1-8] with calln Since the introduction of the 'calln' macro, the 'call1', 'call2', ..., 'call8' macros are just aliases for the former. This is slightly misleading and potentially unhelpful. The number of arguments N can also easily go out-of-synch with the used alias callN. There is no reason not to replace these aliases with using 'calln' directly. To reduce the risk for mistakes, the tool Coccinelle was used to make these changes. See . * src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c: * src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c: * src/chartab.c, src/cmds.c, src/coding.c, src/composite.c: * src/data.c, src/dbusbind.c, src/dired.c, src/doc.c: * src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c: * src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c: * src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c: * src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c: * src/pgtkselect.c, src/print.c, src/process.c, src/sort.c: * src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c: * src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c: * src/xmenu.c, src/xselect.c, src/xterm.c: Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'. diff --git a/src/alloc.c b/src/alloc.c index e7290c55f88..d2d68256139 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -669,7 +669,7 @@ malloc_warning (const char *str) void display_malloc_warning (void) { - call3 (Qdisplay_warning, + calln (Qdisplay_warning, Qalloc, build_string (pending_malloc_warning), QCemergency); @@ -7794,7 +7794,7 @@ respective remote host. */) = Ffind_file_name_handler (BVAR (current_buffer, directory), Qmemory_info); if (!NILP (handler)) - return call1 (handler, Qmemory_info); + return calln (handler, Qmemory_info); #if defined HAVE_LINUX_SYSINFO struct sysinfo si; diff --git a/src/androidfns.c b/src/androidfns.c index ac0f4882f60..f8e3d397008 100644 --- a/src/androidfns.c +++ b/src/androidfns.c @@ -2127,7 +2127,7 @@ android_create_tip_frame (struct android_display_info *dpyinfo, { Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); - call2 (Qface_set_after_frame_default, frame, Qnil); + calln (Qface_set_after_frame_default, frame, Qnil); if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) { @@ -2166,7 +2166,7 @@ android_hide_tip (bool delete) { if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -2350,7 +2350,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, tip_f = XFRAME (tip_frame); if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -2389,11 +2389,11 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, } else tip_last_parms - = call2 (Qassq_delete_all, parm, tip_last_parms); + = calln (Qassq_delete_all, parm, tip_last_parms); } else tip_last_parms - = call2 (Qassq_delete_all, parm, tip_last_parms); + = calln (Qassq_delete_all, parm, tip_last_parms); } /* Now check if every parameter in what is left of @@ -2567,8 +2567,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, start_timer: /* Let the tip disappear after timeout seconds. */ - tip_timer = call3 (Qrun_at_time, timeout, Qnil, - Qx_hide_tip); + tip_timer = calln (Qrun_at_time, timeout, Qnil, Qx_hide_tip); return unbind_to (count, Qnil); #endif diff --git a/src/androidvfs.c b/src/androidvfs.c index d7284a4cc85..656ff7003dd 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -7911,7 +7911,7 @@ files will be removed. */) file = ENCODE_FILE (Fexpand_file_name (file, Qnil)); - if (!NILP (call1 (Qfile_remote_p, file))) + if (!NILP (calln (Qfile_remote_p, file))) signal_error ("Cannot relinquish access to remote file", file); vp = android_name_file (SSDATA (file)); diff --git a/src/buffer.c b/src/buffer.c index 158ebbe0c30..1b9092b107b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -503,7 +503,7 @@ See also `find-buffer-visiting'. */) handler = Ffind_file_name_handler (filename, Qget_file_buffer); if (!NILP (handler)) { - Lisp_Object handled_buf = call2 (handler, Qget_file_buffer, + Lisp_Object handled_buf = calln (handler, Qget_file_buffer, filename); return BUFFERP (handled_buf) ? handled_buf : Qnil; } @@ -558,7 +558,7 @@ run_buffer_list_update_hook (struct buffer *buf) { eassert (buf); if (! (NILP (Vrun_hooks) || buf->inhibit_buffer_hooks)) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + calln (Vrun_hooks, Qbuffer_list_update_hook); } DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 2, 0, @@ -1707,8 +1707,7 @@ This does not change the name of the visited file (if any). */) run_buffer_list_update_hook (current_buffer); - call2 (Quniquify__rename_buffer_advice, - requestedname, unique); + calln (Quniquify__rename_buffer_advice, requestedname, unique); /* Refetch since that last call may have done GC. */ return BVAR (current_buffer, name); @@ -1748,7 +1747,7 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) if (candidate_buffer (buf, buffer) /* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ - && (NILP (pred) || !NILP (call1 (pred, buf)))) + && (NILP (pred) || !NILP (calln (pred, buf)))) { if (!NILP (visible_ok) || NILP (Fget_buffer_window (buf, Qvisible))) @@ -1764,7 +1763,7 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) if (candidate_buffer (buf, buffer) /* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ - && (NILP (pred) || !NILP (call1 (pred, buf)))) + && (NILP (pred) || !NILP (calln (pred, buf)))) { if (!NILP (visible_ok) || NILP (Fget_buffer_window (buf, Qvisible))) @@ -1935,7 +1934,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) { /* Ask whether to kill the buffer, and exit if the user says "no". */ - if (NILP (call1 (Qkill_buffer__possibly_save, buffer))) + if (NILP (calln (Qkill_buffer__possibly_save, buffer))) return unbind_to (count, Qnil); /* Recheck modified. */ modified = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b); @@ -4180,9 +4179,9 @@ call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, while (CONSP (list)) { if (NILP (arg3)) - call4 (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2); + calln (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2); else - call5 (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2, arg3); + calln (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2, arg3); list = XCDR (list); } } diff --git a/src/callint.c b/src/callint.c index 40f3abae00e..9e9bcfd6b02 100644 --- a/src/callint.c +++ b/src/callint.c @@ -305,7 +305,7 @@ invoke it (via an `interactive' spec that contains, for instance, an Lisp_Object up_event = Qnil; /* Set SPECS to the interactive form, or barf if not interactive. */ - Lisp_Object form = call1 (Qinteractive_form, function); + Lisp_Object form = calln (Qinteractive_form, function); if (! CONSP (form)) wrong_type_argument (Qcommandp, function); Lisp_Object specs = Fcar (XCDR (form)); @@ -330,7 +330,7 @@ invoke it (via an `interactive' spec that contains, for instance, an and turn them into things we can eval. */ Lisp_Object values = quotify_args (Fcopy_sequence (specs)); fix_command (function, values); - call4 (Qadd_to_history, Qcommand_history, + calln (Qadd_to_history, Qcommand_history, Fcons (function, values), Qnil, Qt); } @@ -638,7 +638,7 @@ invoke it (via an `interactive' spec that contains, for instance, an goto have_prefix_arg; FALLTHROUGH; case 'n': /* Read number from minibuffer. */ - args[i] = call1 (Qread_number, callint_message); + args[i] = calln (Qread_number, callint_message); visargs[i] = Fnumber_to_string (args[i]); break; @@ -687,12 +687,12 @@ invoke it (via an `interactive' spec that contains, for instance, an break; case 'x': /* Lisp expression read but not evaluated. */ - args[i] = call1 (Qread_minibuffer, callint_message); + args[i] = calln (Qread_minibuffer, callint_message); visargs[i] = last_minibuf_string; break; case 'X': /* Lisp expression read and evaluated. */ - args[i] = call1 (Qeval_minibuffer, callint_message); + args[i] = calln (Qeval_minibuffer, callint_message); visargs[i] = last_minibuf_string; break; @@ -766,7 +766,7 @@ invoke it (via an `interactive' spec that contains, for instance, an visargs[i] = (varies[i] > 0 ? list1 (intern (callint_argfuns[varies[i]])) : quotify_arg (args[i])); - call4 (Qadd_to_history, Qcommand_history, + calln (Qadd_to_history, Qcommand_history, Flist (nargs - 1, visargs + 1), Qnil, Qt); } diff --git a/src/callproc.c b/src/callproc.c index a3d34d55d53..0b2a761cf59 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -914,7 +914,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, /* If the caller required, let the buffer inherit the coding-system used to decode the process output. */ if (inherit_process_coding_system) - call1 (Qafter_insert_file_set_buffer_file_coding_system, + calln (Qafter_insert_file_set_buffer_file_coding_system, make_fixnum (total_read)); } diff --git a/src/casefiddle.c b/src/casefiddle.c index 68b8dc63dbe..faeb16fb8f2 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -583,7 +583,7 @@ casify_pnc_region (enum case_action flag, Lisp_Object beg, Lisp_Object end, { if (!NILP (region_noncontiguous_p)) { - Lisp_Object bounds = call1 (Vregion_extract_function, Qbounds); + Lisp_Object bounds = calln (Vregion_extract_function, Qbounds); FOR_EACH_TAIL (bounds) { CHECK_CONS (XCAR (bounds)); diff --git a/src/charset.c b/src/charset.c index c41a6622f00..797dfde276f 100644 --- a/src/charset.c +++ b/src/charset.c @@ -684,7 +684,7 @@ map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), if (c_function) (*c_function) (arg, range); else - call2 (function, range, arg); + calln (function, range, arg); XSETCAR (range, Qnil); } if (c == stop) @@ -697,7 +697,7 @@ map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), if (c_function) (*c_function) (arg, range); else - call2 (function, range, arg); + calln (function, range, arg); } break; } @@ -739,7 +739,7 @@ map_charset_chars (void (*c_function)(Lisp_Object, Lisp_Object), Lisp_Object fun if (NILP (function)) (*c_function) (arg, range); else - call2 (function, range, arg); + calln (function, range, arg); } else if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP) { diff --git a/src/chartab.c b/src/chartab.c index 76a40ca7cc4..dbb6a717213 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -665,7 +665,7 @@ optimize_sub_char_table (Lisp_Object table, Lisp_Object test) if (optimizable && (NILP (test) ? NILP (Fequal (this, elt)) /* defaults to `equal'. */ : EQ (test, Qeq) ? !EQ (this, elt) /* Optimize `eq' case. */ - : NILP (call2 (test, this, elt)))) + : NILP (calln (test, this, elt)))) optimizable = 0; } @@ -806,7 +806,7 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), { if (decoder) val = decoder (top, val); - call2 (function, XCAR (range), val); + calln (function, XCAR (range), val); } } else @@ -817,7 +817,7 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), { if (decoder) val = decoder (top, val); - call2 (function, range, val); + calln (function, range, val); } } } @@ -882,7 +882,7 @@ map_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), { if (decoder) val = decoder (table, val); - call2 (function, XCAR (range), val); + calln (function, XCAR (range), val); } } else @@ -893,7 +893,7 @@ map_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), { if (decoder) val = decoder (table, val); - call2 (function, range, val); + calln (function, range, val); } } } @@ -941,7 +941,7 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), if (c_function) (*c_function) (arg, range); else - call2 (function, range, arg); + calln (function, range, arg); } XSETCAR (range, Qnil); } @@ -964,7 +964,7 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), if (c_function) (*c_function) (arg, range); else - call2 (function, range, arg); + calln (function, range, arg); XSETCAR (range, Qnil); } } @@ -1025,7 +1025,7 @@ map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), if (c_function) (*c_function) (arg, range); else - call2 (function, range, arg); + calln (function, range, arg); } XSETCAR (range, Qnil); } @@ -1036,7 +1036,7 @@ map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), if (c_function) (*c_function) (arg, range); else - call2 (function, range, arg); + calln (function, range, arg); } } diff --git a/src/cmds.c b/src/cmds.c index 8e99db839b6..7179822c21c 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -255,7 +255,7 @@ because it respects values of `delete-active-region' and `overwrite-mode'. */) } else { - call1 (Qkill_forward_chars, n); + calln (Qkill_forward_chars, n); } return Qnil; } diff --git a/src/coding.c b/src/coding.c index 84cf5c8f34d..6875d4af823 100644 --- a/src/coding.c +++ b/src/coding.c @@ -8034,7 +8034,7 @@ decode_coding_gap (struct coding_system *coding, ptrdiff_t bytes) Fcons (undo_list, Fcurrent_buffer ())); bset_undo_list (current_buffer, Qt); TEMP_SET_PT_BOTH (coding->dst_pos, coding->dst_pos_byte); - val = call1 (CODING_ATTR_POST_READ (attrs), + val = calln (CODING_ATTR_POST_READ (attrs), make_fixnum (coding->produced_char)); CHECK_FIXNAT (val); coding->produced_char += Z - prev_Z; @@ -10871,10 +10871,10 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS...) */) return Fcons (val, val); if (! NILP (Ffboundp (val))) { - /* We use call1 rather than safe_call1 + /* We use calln rather than safe_calln so as to get bug reports about functions called here which don't handle the current interface. */ - val = call1 (val, Flist (nargs, args)); + val = calln (val, Flist (nargs, args)); if (CONSP (val)) return val; if (SYMBOLP (val) && ! NILP (Fcoding_system_p (val))) diff --git a/src/composite.c b/src/composite.c index 373db2813a4..f857dbf77ee 100644 --- a/src/composite.c +++ b/src/composite.c @@ -475,7 +475,7 @@ run_composition_function (ptrdiff_t from, ptrdiff_t to, Lisp_Object prop) && !composition_valid_p (start, end, prop)) to = end; if (!NILP (Ffboundp (func))) - call2 (func, make_fixnum (from), make_fixnum (to)); + calln (func, make_fixnum (from), make_fixnum (to)); } /* Make invalid compositions adjacent to or inside FROM and TO valid. diff --git a/src/data.c b/src/data.c index be85f817014..8236721961f 100644 --- a/src/data.c +++ b/src/data.c @@ -982,7 +982,7 @@ defalias (Lisp_Object symbol, Lisp_Object definition) { /* Handle automatic advice activation. */ Lisp_Object hook = Fget (symbol, Qdefalias_fset_function); if (!NILP (hook)) - call2 (hook, symbol, definition); + calln (hook, symbol, definition); else Ffset (symbol, definition); } @@ -1203,7 +1203,7 @@ Value, if non-nil, is a list (interactive SPEC). */) if (genfun /* Avoid burping during bootstrap. */ && !NILP (Fsymbol_function (Qoclosure_interactive_form))) - return call1 (Qoclosure_interactive_form, fun); + return calln (Qoclosure_interactive_form, fun); else return Qnil; } @@ -1481,7 +1481,7 @@ store_symval_forwarding (lispfwd valcontents, Lisp_Object newval, } else if (FUNCTIONP (predicate)) { - if (NILP (call1 (predicate, newval))) + if (NILP (calln (predicate, newval))) wrong_type_argument (predicate, newval); } } diff --git a/src/dbusbind.c b/src/dbusbind.c index 7c8388cca61..b590a40c4a9 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1478,7 +1478,7 @@ usage: (dbus-message-internal &rest REST) */) bus or an unknown name, we regard it as broadcast message due to backward compatibility. */ if (dbus_bus_name_has_owner (connection, SSDATA (service), NULL)) - uname = call2 (Qdbus_get_name_owner, bus, service); + uname = calln (Qdbus_get_name_owner, bus, service); else uname = Qnil; diff --git a/src/dired.c b/src/dired.c index 2501e7d8ab7..915a2097042 100644 --- a/src/dired.c +++ b/src/dired.c @@ -397,7 +397,7 @@ If COUNT is non-nil and a natural number, the function will return call the corresponding file name handler. */ Lisp_Object handler = Ffind_file_name_handler (directory, Qdirectory_files); if (!NILP (handler)) - return call6 (handler, Qdirectory_files, directory, + return calln (handler, Qdirectory_files, directory, full, match, nosort, count); return directory_files_internal (directory, full, match, nosort, @@ -437,7 +437,7 @@ which see. */) Lisp_Object handler = Ffind_file_name_handler (directory, Qdirectory_files_and_attributes); if (!NILP (handler)) - return call7 (handler, Qdirectory_files_and_attributes, + return calln (handler, Qdirectory_files_and_attributes, directory, full, match, nosort, id_format, count); return directory_files_internal (directory, full, match, nosort, @@ -472,13 +472,13 @@ is matched against file and directory names relative to DIRECTORY. */) call the corresponding file name handler. */ handler = Ffind_file_name_handler (directory, Qfile_name_completion); if (!NILP (handler)) - return call4 (handler, Qfile_name_completion, file, directory, predicate); + return calln (handler, Qfile_name_completion, file, directory, predicate); /* If the file name has special constructs in it, call the corresponding file name handler. */ handler = Ffind_file_name_handler (file, Qfile_name_completion); if (!NILP (handler)) - return call4 (handler, Qfile_name_completion, file, directory, predicate); + return calln (handler, Qfile_name_completion, file, directory, predicate); return file_name_completion (file, directory, 0, predicate); } @@ -500,13 +500,13 @@ is matched against file and directory names relative to DIRECTORY. */) call the corresponding file name handler. */ handler = Ffind_file_name_handler (directory, Qfile_name_all_completions); if (!NILP (handler)) - return call3 (handler, Qfile_name_all_completions, file, directory); + return calln (handler, Qfile_name_all_completions, file, directory); /* If the file name has special constructs in it, call the corresponding file name handler. */ handler = Ffind_file_name_handler (file, Qfile_name_all_completions); if (!NILP (handler)) - return call3 (handler, Qfile_name_all_completions, file, directory); + return calln (handler, Qfile_name_all_completions, file, directory); return file_name_completion (file, directory, 1, Qnil); } @@ -765,7 +765,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, name = Ffile_name_as_directory (name); /* Test the predicate, if any. */ - if (!NILP (predicate) && NILP (call1 (predicate, name))) + if (!NILP (predicate) && NILP (calln (predicate, name))) continue; /* Reject entries where the encoded strings match, but the @@ -1013,9 +1013,9 @@ so last access time will always be midnight of that day. */) compatibility with old file name handlers which do not implement the new arg. --Stef */ if (NILP (id_format)) - return call2 (handler, Qfile_attributes, filename); + return calln (handler, Qfile_attributes, filename); else - return call3 (handler, Qfile_attributes, filename, id_format); + return calln (handler, Qfile_attributes, filename, id_format); } encoded = ENCODE_FILE (filename); diff --git a/src/doc.c b/src/doc.c index 04afe50d3dd..1c5906de9dc 100644 --- a/src/doc.c +++ b/src/doc.c @@ -358,7 +358,7 @@ string is passed through `substitute-command-keys'. */) xsignal1 (Qvoid_function, function); if (CONSP (fun) && EQ (XCAR (fun), Qmacro)) fun = XCDR (fun); - doc = call1 (Qfunction_documentation, fun); + doc = calln (Qfunction_documentation, fun); /* If DOC is 0, it's typically because of a dumped file missing from the DOC file (bug in src/Makefile.in). */ @@ -383,7 +383,7 @@ string is passed through `substitute-command-keys'. */) } if (NILP (raw)) - doc = call1 (Qsubstitute_command_keys, doc); + doc = calln (Qsubstitute_command_keys, doc); return doc; } @@ -459,7 +459,7 @@ aren't strings. */) tem = Feval (tem, Qnil); if (NILP (raw) && STRINGP (tem)) - tem = call1 (Qsubstitute_command_keys, tem); + tem = calln (Qsubstitute_command_keys, tem); return tem; } diff --git a/src/emacs.c b/src/emacs.c index 896f219baab..596dd117a76 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -556,7 +556,7 @@ init_cmdargs (int argc, char **argv, int skip_args, char const *original_pwd) if (NILP (Vpurify_flag)) { if (!NILP (Ffboundp (Qfile_truename))) - dir = call1 (Qfile_truename, dir); + dir = calln (Qfile_truename, dir); } dir = Fexpand_file_name (build_string ("../.."), dir); } @@ -2995,7 +2995,7 @@ killed. */ if (noninteractive) safe_run_hooks (Qkill_emacs_hook); else - call1 (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook); + calln (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook); } #ifdef HAVE_X_WINDOWS diff --git a/src/eval.c b/src/eval.c index 941d121c2fb..cf05d3baea4 100644 --- a/src/eval.c +++ b/src/eval.c @@ -613,7 +613,7 @@ usage: (function ARG) */) return Fmake_interpreted_closure (args, cdr, Vinternal_interpreter_environment, docstring, iform); else - return call5 (Vinternal_make_interpreted_closure_function, + return calln (Vinternal_make_interpreted_closure_function, args, cdr, Vinternal_interpreter_environment, docstring, iform); } @@ -690,7 +690,7 @@ signal a `cyclic-variable-indirection' error. */) " to `%s'"); formatted = CALLN (Fformat_message, message, new_alias, base_variable); - call2 (Qdisplay_warning, + calln (Qdisplay_warning, list3 (Qdefvaralias, Qlosing_value, new_alias), formatted); } @@ -1860,7 +1860,7 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool continuable) /* FIXME: 'handler-bind' makes `signal-hook-function' obsolete? */ /* FIXME: Here we still "split" the error object into its error-symbol and its error-data? */ - call2 (Vsignal_hook_function, error_symbol, data); + calln (Vsignal_hook_function, error_symbol, data); unbind_to (count, Qnil); } @@ -1900,7 +1900,7 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool continuable) max_ensure_room (20); push_handler (make_fixnum (skip + h->bytecode_dest), SKIP_CONDITIONS); - call1 (h->val, error); + calln (h->val, error); unbind_to (count, Qnil); pop_handler (); } @@ -2284,7 +2284,7 @@ then strings and vectors are not accepted. */) a type-specific interactive-form. */ if (genfun) { - Lisp_Object iform = call1 (Qinteractive_form, fun); + Lisp_Object iform = calln (Qinteractive_form, fun); return NILP (iform) ? Qnil : Qt; } else @@ -3890,11 +3890,11 @@ backtrace_frame_apply (Lisp_Object function, union specbinding *pdl) flags = list2 (QCdebug_on_exit, Qt); if (backtrace_nargs (pdl) == UNEVALLED) - return call4 (function, Qnil, backtrace_function (pdl), *backtrace_args (pdl), flags); + return calln (function, Qnil, backtrace_function (pdl), *backtrace_args (pdl), flags); else { Lisp_Object tem = Flist (backtrace_nargs (pdl), backtrace_args (pdl)); - return call4 (function, Qt, backtrace_function (pdl), tem, flags); + return calln (function, Qt, backtrace_function (pdl), tem, flags); } } diff --git a/src/fileio.c b/src/fileio.c index 9ab17497395..d832967bb6b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -446,7 +446,7 @@ Given a Unix syntax file name, returns a string ending in slash. */) handler = Ffind_file_name_handler (filename, Qfile_name_directory); if (!NILP (handler)) { - Lisp_Object handled_name = call2 (handler, Qfile_name_directory, + Lisp_Object handled_name = calln (handler, Qfile_name_directory, filename); return STRINGP (handled_name) ? handled_name : Qnil; } @@ -550,7 +550,7 @@ or the entire name if it contains no slash. */) handler = Ffind_file_name_handler (filename, Qfile_name_nondirectory); if (!NILP (handler)) { - Lisp_Object handled_name = call2 (handler, Qfile_name_nondirectory, + Lisp_Object handled_name = calln (handler, Qfile_name_nondirectory, filename); if (STRINGP (handled_name)) return handled_name; @@ -593,7 +593,7 @@ get a current directory to run processes in. */) handler = Ffind_file_name_handler (filename, Qunhandled_file_name_directory); if (!NILP (handler)) { - Lisp_Object handled_name = call2 (handler, Qunhandled_file_name_directory, + Lisp_Object handled_name = calln (handler, Qunhandled_file_name_directory, filename); return STRINGP (handled_name) ? handled_name : Qnil; } @@ -655,7 +655,7 @@ is already present. */) handler = Ffind_file_name_handler (file, Qfile_name_as_directory); if (!NILP (handler)) { - Lisp_Object handled_name = call2 (handler, Qfile_name_as_directory, + Lisp_Object handled_name = calln (handler, Qfile_name_as_directory, file); if (STRINGP (handled_name)) return handled_name; @@ -746,7 +746,7 @@ In Unix-syntax, this function just removes the final slash. */) handler = Ffind_file_name_handler (directory, Qdirectory_file_name); if (!NILP (handler)) { - Lisp_Object handled_name = call2 (handler, Qdirectory_file_name, + Lisp_Object handled_name = calln (handler, Qdirectory_file_name, directory); if (STRINGP (handled_name)) return handled_name; @@ -1048,7 +1048,7 @@ the root directory. */) handler = Ffind_file_name_handler (name, Qexpand_file_name); if (!NILP (handler)) { - handled_name = call3 (handler, Qexpand_file_name, + handled_name = calln (handler, Qexpand_file_name, name, default_directory); if (STRINGP (handled_name)) return handled_name; @@ -1110,7 +1110,7 @@ the root directory. */) handler = Ffind_file_name_handler (default_directory, Qexpand_file_name); if (!NILP (handler)) { - handled_name = call3 (handler, Qexpand_file_name, + handled_name = calln (handler, Qexpand_file_name, name, default_directory); if (STRINGP (handled_name)) return handled_name; @@ -1165,7 +1165,7 @@ the root directory. */) Qexpand_file_name); if (!NILP (handler)) { - handled_name = call3 (handler, Qexpand_file_name, + handled_name = calln (handler, Qexpand_file_name, name, default_directory); if (STRINGP (handled_name)) return handled_name; @@ -1747,7 +1747,7 @@ the root directory. */) handler = Ffind_file_name_handler (result, Qexpand_file_name); if (!NILP (handler)) { - handled_name = call3 (handler, Qexpand_file_name, + handled_name = calln (handler, Qexpand_file_name, result, default_directory); if (! STRINGP (handled_name)) error ("Invalid handler in `file-name-handler-alist'"); @@ -2068,7 +2068,7 @@ those `/' is discarded. */) handler = Ffind_file_name_handler (filename, Qsubstitute_in_file_name); if (!NILP (handler)) { - Lisp_Object handled_name = call2 (handler, Qsubstitute_in_file_name, + Lisp_Object handled_name = calln (handler, Qsubstitute_in_file_name, filename); if (STRINGP (handled_name)) return handled_name; @@ -2108,7 +2108,7 @@ those `/' is discarded. */) Lisp_Object name = (!substituted ? filename : make_specified_string (nm, -1, endp - nm, multibyte)); - Lisp_Object tmp = call1 (Qsubstitute_env_in_file_name, name); + Lisp_Object tmp = calln (Qsubstitute_env_in_file_name, name); CHECK_STRING (tmp); if (!EQ (tmp, name)) substituted = true; @@ -2205,7 +2205,7 @@ barf_or_query_if_file_exists (Lisp_Object absname, bool known_to_exist, AUTO_STRING (format, "File %s already exists; %s anyway? "); tem = CALLN (Fformat, format, absname, build_string (querystring)); if (quick) - tem = call1 (Qy_or_n_p, tem); + tem = calln (Qy_or_n_p, tem); else tem = do_yes_or_no_p (tem); if (NILP (tem)) @@ -2288,7 +2288,7 @@ permissions. */) if (NILP (handler)) handler = Ffind_file_name_handler (newname, Qcopy_file); if (!NILP (handler)) - return call7 (handler, Qcopy_file, file, newname, + return calln (handler, Qcopy_file, file, newname, ok_if_already_exists, keep_time, preserve_uid_gid, preserve_permissions); @@ -2697,7 +2697,7 @@ is case-insensitive. */) call the corresponding file name handler. */ handler = Ffind_file_name_handler (filename, Qfile_name_case_insensitive_p); if (!NILP (handler)) - return call2 (handler, Qfile_name_case_insensitive_p, filename); + return calln (handler, Qfile_name_case_insensitive_p, filename); /* If the file doesn't exist or there is trouble checking its filesystem, move up the filesystem tree until we reach an @@ -2758,7 +2758,7 @@ This is what happens in interactive use with M-x. */) if (NILP (handler)) handler = Ffind_file_name_handler (newname, Qrename_file); if (!NILP (handler)) - return call4 (handler, Qrename_file, + return calln (handler, Qrename_file, file, newname, ok_if_already_exists); encoded_file = ENCODE_FILE (file); @@ -2819,7 +2819,7 @@ This is what happens in interactive use with M-x. */) dirp = S_ISDIR (file_st.st_mode) != 0; } if (dirp) - call4 (Qcopy_directory, file, newname, Qt, Qnil); + calln (Qcopy_directory, file, newname, Qt, Qnil); else if (S_ISREG (file_st.st_mode)) Fcopy_file (file, newname, ok_if_already_exists, Qt, Qt, Qt); else if (S_ISLNK (file_st.st_mode)) @@ -2837,9 +2837,9 @@ This is what happens in interactive use with M-x. */) specpdl_ref count = SPECPDL_INDEX (); specbind (Qdelete_by_moving_to_trash, Qnil); if (dirp) - call2 (Qdelete_directory, file, Qt); + calln (Qdelete_directory, file, Qt); else - call2 (Qdelete_file, file, Qnil); + calln (Qdelete_file, file, Qnil); return unbind_to (count, Qnil); } @@ -2865,14 +2865,14 @@ This is what happens in interactive use with M-x. */) call the corresponding file name handler. */ handler = Ffind_file_name_handler (file, Qadd_name_to_file); if (!NILP (handler)) - return call4 (handler, Qadd_name_to_file, file, + return calln (handler, Qadd_name_to_file, file, newname, ok_if_already_exists); /* If the new name has special constructs in it, call the corresponding file name handler. */ handler = Ffind_file_name_handler (newname, Qadd_name_to_file); if (!NILP (handler)) - return call4 (handler, Qadd_name_to_file, file, + return calln (handler, Qadd_name_to_file, file, newname, ok_if_already_exists); encoded_file = ENCODE_FILE (file); @@ -2929,7 +2929,7 @@ This happens for interactive use with M-x. */) call the corresponding file name handler. */ handler = Ffind_file_name_handler (linkname, Qmake_symbolic_link); if (!NILP (handler)) - return call4 (handler, Qmake_symbolic_link, target, + return calln (handler, Qmake_symbolic_link, target, linkname, ok_if_already_exists); encoded_target = ENCODE_FILE (target); @@ -2990,7 +2990,7 @@ check_file_access (Lisp_Object file, Lisp_Object operation, int amode) Lisp_Object handler = Ffind_file_name_handler (file, operation); if (!NILP (handler)) { - Lisp_Object ok = call2 (handler, operation, file); + Lisp_Object ok = calln (handler, operation, file); /* This errno value is bogus. Any caller that depends on errno should be rethought anyway, to avoid a race between testing a handled file's accessibility and using the file. */ @@ -3045,7 +3045,7 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, call the corresponding file name handler. */ handler = Ffind_file_name_handler (absname, Qfile_writable_p); if (!NILP (handler)) - return call2 (handler, Qfile_writable_p, absname); + return calln (handler, Qfile_writable_p, absname); encoded = ENCODE_FILE (absname); if (file_access_p (SSDATA (encoded), W_OK)) @@ -3087,7 +3087,7 @@ If there is no error, returns nil. */) call the corresponding file name handler. */ handler = Ffind_file_name_handler (absname, Qaccess_file); if (!NILP (handler)) - return call3 (handler, Qaccess_file, absname, string); + return calln (handler, Qaccess_file, absname, string); encoded_filename = ENCODE_FILE (absname); @@ -3172,7 +3172,7 @@ This function does not check whether the link target exists. */) call the corresponding file name handler. */ handler = Ffind_file_name_handler (filename, Qfile_symlink_p); if (!NILP (handler)) - return call2 (handler, Qfile_symlink_p, filename); + return calln (handler, Qfile_symlink_p, filename); return emacs_readlinkat (AT_FDCWD, SSDATA (ENCODE_FILE (filename))); } @@ -3196,7 +3196,7 @@ See `file-symlink-p' to distinguish symlinks. */) call the corresponding file name handler. */ Lisp_Object handler = Ffind_file_name_handler (absname, Qfile_directory_p); if (!NILP (handler)) - return call2 (handler, Qfile_directory_p, absname); + return calln (handler, Qfile_directory_p, absname); return file_directory_p (ENCODE_FILE (absname)) ? Qt : Qnil; } @@ -3273,7 +3273,7 @@ predicate must return true. */) handler = Ffind_file_name_handler (absname, Qfile_accessible_directory_p); if (!NILP (handler)) { - Lisp_Object r = call2 (handler, Qfile_accessible_directory_p, absname); + Lisp_Object r = calln (handler, Qfile_accessible_directory_p, absname); /* Set errno in case the handler failed. EACCES might be a lie (e.g., the directory might not exist, or be a regular file), @@ -3367,7 +3367,7 @@ See `file-symlink-p' to distinguish symlinks. */) call the corresponding file name handler. */ Lisp_Object handler = Ffind_file_name_handler (absname, Qfile_regular_p); if (!NILP (handler)) - return call2 (handler, Qfile_regular_p, absname); + return calln (handler, Qfile_regular_p, absname); #ifdef WINDOWSNT /* Tell stat to use expensive method to get accurate info. */ @@ -3406,7 +3406,7 @@ or if SELinux is disabled, or if Emacs lacks SELinux support. */) Lisp_Object handler = Ffind_file_name_handler (absname, Qfile_selinux_context); if (!NILP (handler)) - return call2 (handler, Qfile_selinux_context, absname); + return calln (handler, Qfile_selinux_context, absname); #ifdef HAVE_LIBSELINUX file = SSDATA (ENCODE_FILE (absname)); @@ -3471,7 +3471,7 @@ or if Emacs was not compiled with SELinux support. */) call the corresponding file name handler. */ handler = Ffind_file_name_handler (absname, Qset_file_selinux_context); if (!NILP (handler)) - return call3 (handler, Qset_file_selinux_context, absname, context); + return calln (handler, Qset_file_selinux_context, absname, context); #if HAVE_LIBSELINUX encoded_absname = ENCODE_FILE (absname); @@ -3542,7 +3542,7 @@ Return nil if file does not exist. */) call the corresponding file name handler. */ Lisp_Object handler = Ffind_file_name_handler (absname, Qfile_acl); if (!NILP (handler)) - return call2 (handler, Qfile_acl, absname); + return calln (handler, Qfile_acl, absname); # ifdef HAVE_ACL_SET_FILE # ifndef HAVE_ACL_TYPE_EXTENDED @@ -3599,7 +3599,7 @@ support. */) call the corresponding file name handler. */ handler = Ffind_file_name_handler (absname, Qset_file_acl); if (!NILP (handler)) - return call3 (handler, Qset_file_acl, absname, acl_string); + return calln (handler, Qset_file_acl, absname, acl_string); # ifdef HAVE_ACL_SET_FILE if (STRINGP (acl_string)) @@ -3650,7 +3650,7 @@ do not follow FILENAME if it is a symbolic link. */) call the corresponding file name handler. */ Lisp_Object handler = Ffind_file_name_handler (absname, Qfile_modes); if (!NILP (handler)) - return call3 (handler, Qfile_modes, absname, flag); + return calln (handler, Qfile_modes, absname, flag); char *fname = SSDATA (ENCODE_FILE (absname)); if (emacs_fstatat (AT_FDCWD, fname, &st, nofollow) != 0) @@ -3681,7 +3681,7 @@ command from GNU Coreutils. */) call the corresponding file name handler. */ Lisp_Object handler = Ffind_file_name_handler (absname, Qset_file_modes); if (!NILP (handler)) - return call4 (handler, Qset_file_modes, absname, mode, flag); + return calln (handler, Qset_file_modes, absname, mode, flag); encoded = ENCODE_FILE (absname); char *fname = SSDATA (encoded); @@ -3755,7 +3755,7 @@ TIMESTAMP is in the format of `current-time'. */) absname = Fexpand_file_name (filename, BVAR (current_buffer, directory)), handler = Ffind_file_name_handler (absname, Qset_file_times); if (!NILP (handler)) - return call4 (handler, Qset_file_times, absname, timestamp, flag); + return calln (handler, Qset_file_times, absname, timestamp, flag); Lisp_Object encoded_absname = ENCODE_FILE (absname); check_vfs_filename (encoded_absname, "Trying to set access times of" @@ -3808,7 +3808,7 @@ For existing files, this compares their last-modified times. */) if (NILP (handler)) handler = Ffind_file_name_handler (absname2, Qfile_newer_than_file_p); if (!NILP (handler)) - return call3 (handler, Qfile_newer_than_file_p, absname1, absname2); + return calln (handler, Qfile_newer_than_file_p, absname1, absname2); encoded = ENCODE_FILE (absname1); @@ -3971,7 +3971,7 @@ get_window_points_and_markers (void) { Lisp_Object pt_marker = Fpoint_marker (); Lisp_Object windows - = call3 (Qget_buffer_window_list, Fcurrent_buffer (), Qnil, Qt); + = calln (Qget_buffer_window_list, Fcurrent_buffer (), Qnil, Qt); Lisp_Object window_markers = windows; /* Window markers (and point) are handled specially: rather than move to just before or just after the modified text, we try to keep the @@ -4130,7 +4130,7 @@ by calling `format-decode', which see. */) handler = Ffind_file_name_handler (filename, Qinsert_file_contents); if (!NILP (handler)) { - val = call6 (handler, Qinsert_file_contents, filename, + val = calln (handler, Qinsert_file_contents, filename, visit, beg, end, replace); if (CONSP (val) && CONSP (XCDR (val)) && RANGED_FIXNUMP (0, XCAR (XCDR (val)), ZV - PT)) @@ -4333,7 +4333,7 @@ by calling `format-decode', which see. */) insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0); TEMP_SET_PT_BOTH (BEG, BEG_BYTE); - coding_system = call2 (Vset_auto_coding_function, + coding_system = calln (Vset_auto_coding_function, filename, make_fixnum (nread)); set_buffer_internal (prev); @@ -4916,7 +4916,7 @@ by calling `format-decode', which see. */) if (inserted > 0 && ! NILP (Vset_auto_coding_function)) { - coding_system = call2 (Vset_auto_coding_function, + coding_system = calln (Vset_auto_coding_function, filename, make_fixnum (inserted)); } @@ -5047,7 +5047,7 @@ by calling `format-decode', which see. */) if (! NILP (Ffboundp (Qafter_insert_file_set_coding))) { - insval = call2 (Qafter_insert_file_set_coding, make_fixnum (inserted), + insval = calln (Qafter_insert_file_set_coding, make_fixnum (inserted), visit); if (! NILP (insval)) { @@ -5074,7 +5074,7 @@ by calling `format-decode', which see. */) if (NILP (replace)) { - insval = call3 (Qformat_decode, + insval = calln (Qformat_decode, Qnil, make_fixnum (inserted), visit); if (! RANGED_FIXNUMP (0, insval, ZV - PT)) wrong_type_argument (Qinserted_chars, insval); @@ -5097,7 +5097,7 @@ by calling `format-decode', which see. */) modiff_count ochars_modiff = CHARS_MODIFF; TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); - insval = call3 (Qformat_decode, + insval = calln (Qformat_decode, Qnil, make_fixnum (oinserted), visit); if (! RANGED_FIXNUMP (0, insval, ZV - PT)) wrong_type_argument (Qinserted_chars, insval); @@ -5119,7 +5119,7 @@ by calling `format-decode', which see. */) { if (NILP (replace)) { - insval = call1 (XCAR (p), make_fixnum (inserted)); + insval = calln (XCAR (p), make_fixnum (inserted)); if (!NILP (insval)) { if (! RANGED_FIXNUMP (0, insval, ZV - PT)) @@ -5137,7 +5137,7 @@ by calling `format-decode', which see. */) modiff_count ochars_modiff = CHARS_MODIFF; TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); - insval = call1 (XCAR (p), make_fixnum (oinserted)); + insval = calln (XCAR (p), make_fixnum (oinserted)); if (!NILP (insval)) { if (! RANGED_FIXNUMP (0, insval, ZV - PT)) @@ -5239,7 +5239,7 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file if (coding_system_require_warning && !NILP (Ffboundp (Vselect_safe_coding_system_function))) /* Confirm that VAL can surely encode the current region. */ - val = call5 (Vselect_safe_coding_system_function, + val = calln (Vselect_safe_coding_system_function, start, end, list2 (Qt, val), Qnil, filename); } @@ -5299,7 +5299,7 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file && !NILP (Ffboundp (Vselect_safe_coding_system_function))) { /* Confirm that VAL can surely encode the current region. */ - val = call5 (Vselect_safe_coding_system_function, + val = calln (Vselect_safe_coding_system_function, start, end, val, Qnil, filename); /* As the function specified by select-safe-coding-system-function is out of our control, make sure we are not fed by bogus @@ -5440,7 +5440,7 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, if (!NILP (handler)) { Lisp_Object val; - val = call8 (handler, Qwrite_region, start, end, + val = calln (handler, Qwrite_region, start, end, filename, append, visit, lockname, mustbenew); if (visiting) @@ -5784,7 +5784,7 @@ build_annotations (Lisp_Object start, Lisp_Object end) goto loop_over_p; } Vwrite_region_annotations_so_far = annotations; - res = call2 (XCAR (p), start, end); + res = calln (XCAR (p), start, end); /* If the function makes a different buffer current, assume that means this buffer contains altered text to be output. Reset START and END from the buffer bounds @@ -5818,7 +5818,7 @@ build_annotations (Lisp_Object start, Lisp_Object end) /* Value is either a list of annotations or nil if the function has written annotations to a temporary buffer, which is now current. */ - res = call5 (Qformat_annotate_function, XCAR (p), start, end, + res = calln (Qformat_annotate_function, XCAR (p), start, end, original_buffer, make_fixnum (i++)); if (current_buffer != given_buffer) { @@ -6014,7 +6014,7 @@ See Info node `(elisp)Modification Time' for more details. */) handler = Ffind_file_name_handler (BVAR (b, filename), Qverify_visited_file_modtime); if (!NILP (handler)) - return call2 (handler, Qverify_visited_file_modtime, buf); + return calln (handler, Qverify_visited_file_modtime, buf); filename = ENCODE_FILE (BVAR (b, filename)); mtime = (emacs_fstatat (AT_FDCWD, SSDATA (filename), &st, 0) == 0 @@ -6087,7 +6087,7 @@ in `current-time' or an integer flag as returned by `visited-file-modtime'. */) handler = Ffind_file_name_handler (filename, Qset_visited_file_modtime); if (!NILP (handler)) /* The handler can find the file name the same way we did. */ - return call2 (handler, Qset_visited_file_modtime, Qnil); + return calln (handler, Qset_visited_file_modtime, Qnil); encoded = ENCODE_FILE (filename); @@ -6114,8 +6114,7 @@ auto_save_error (Lisp_Object error_val) AUTO_STRING (format, "Auto-saving %s: %s"); Lisp_Object msg = CALLN (Fformat, format, BVAR (current_buffer, name), Ferror_message_string (error_val)); - call3 (Qdisplay_warning, - Qauto_save, msg, QCerror); + calln (Qdisplay_warning, Qauto_save, msg, QCerror); return Qnil; } @@ -6175,7 +6174,7 @@ do_auto_save_make_dir (Lisp_Object dir) Lisp_Object result; auto_saving_dir_umask = 077; - result = call2 (Qmake_directory, dir, Qt); + result = calln (Qmake_directory, dir, Qt); auto_saving_dir_umask = 0; return result; } @@ -6526,7 +6525,7 @@ If the underlying system call fails, value is nil. */) Lisp_Object handler = Ffind_file_name_handler (filename, Qfile_system_info); if (!NILP (handler)) { - Lisp_Object result = call2 (handler, Qfile_system_info, filename); + Lisp_Object result = calln (handler, Qfile_system_info, filename); if (CONSP (result) || NILP (result)) return result; error ("Invalid handler in `file-name-handler-alist'"); diff --git a/src/filelock.c b/src/filelock.c index c276f19dcd1..e61c6776e3e 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -555,7 +555,7 @@ make_lock_file_name (Lisp_Object fn) return Qnil; #endif /* defined HAVE_ANDROID && !defined ANDROID_STUBIFY */ - lock_file_name = call1 (Qmake_lock_file_name, fn); + lock_file_name = calln (Qmake_lock_file_name, fn); return !NILP (lock_file_name) ? ENCODE_FILE (lock_file_name) : Qnil; } @@ -605,7 +605,7 @@ lock_file (Lisp_Object fn) && NILP (Fverify_visited_file_modtime (subject_buf)) && !NILP (Ffile_exists_p (fn)) && !(!NILP (lfname) && current_lock_owner (NULL, lfname) == I_OWN_IT)) - call1 (intern ("userlock--ask-user-about-supersession-threat"), fn); + calln (intern ("userlock--ask-user-about-supersession-threat"), fn); /* Don't do locking if the user has opted out. */ if (!NILP (lfname)) @@ -623,7 +623,7 @@ lock_file (Lisp_Object fn) memmove (dot + replacementlen, dot + 1, pidlen); strcpy (dot + replacementlen + pidlen, ")"); memcpy (dot, replacement, replacementlen); - attack = call2 (intern ("ask-user-about-lock"), fn, + attack = calln (intern ("ask-user-about-lock"), fn, build_string (lock_info.user)); /* Take the lock if the user said so. */ if (!NILP (attack)) @@ -653,7 +653,7 @@ unlock_file (Lisp_Object fn) static Lisp_Object unlock_file_handle_error (Lisp_Object err) { - call1 (intern ("userlock--handle-unlock-error"), err); + calln (intern ("userlock--handle-unlock-error"), err); return Qnil; } @@ -690,7 +690,7 @@ whether to modify FILE. */) Lisp_Object handler; handler = Ffind_file_name_handler (file, Qlock_file); if (!NILP (handler)) - return call2 (handler, Qlock_file, file); + return calln (handler, Qlock_file, file); lock_file (file); #endif /* MSDOS */ @@ -710,7 +710,7 @@ DEFUN ("unlock-file", Funlock_file, Sunlock_file, 1, 1, 0, handler = Ffind_file_name_handler (file, Qunlock_file); if (!NILP (handler)) { - call2 (handler, Qunlock_file, file); + calln (handler, Qunlock_file, file); return Qnil; } @@ -786,7 +786,7 @@ t if it is locked by you, else a string saying which user has locked it. */) handler = Ffind_file_name_handler (filename, Qfile_locked_p); if (!NILP (handler)) { - return call2 (handler, Qfile_locked_p, filename); + return calln (handler, Qfile_locked_p, filename); } Lisp_Object lfname = make_lock_file_name (filename); diff --git a/src/fns.c b/src/fns.c index 07df2a5e90e..7c2d571589c 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2025,7 +2025,7 @@ TESTFN is called with 2 arguments: a car of an alist element and KEY. */) if ((NILP (testfn) ? (EQ (XCAR (car), key) || !NILP (Fequal (XCAR (car), key))) - : !NILP (call2 (testfn, XCAR (car), key)))) + : !NILP (calln (testfn, XCAR (car), key)))) return car; } CHECK_LIST_END (tail, alist); @@ -2515,7 +2515,7 @@ merge (Lisp_Object org_l1, Lisp_Object org_l2, Lisp_Object pred) } Lisp_Object tem; - if (!NILP (call2 (pred, Fcar (l1), Fcar (l2)))) + if (!NILP (calln (pred, Fcar (l1), Fcar (l2)))) { tem = l1; l1 = Fcdr (l1); @@ -2604,7 +2604,7 @@ This function doesn't signal an error if PLIST is invalid. */) { if (! CONSP (XCDR (tail))) break; - if (!NILP (call2 (predicate, XCAR (tail), prop))) + if (!NILP (calln (predicate, XCAR (tail), prop))) return XCAR (XCDR (tail)); tail = XCDR (tail); } @@ -2663,7 +2663,7 @@ The PLIST is modified by side effects. */) if (! CONSP (XCDR (tail))) break; - if (!NILP (call2 (predicate, XCAR (tail), prop))) + if (!NILP (calln (predicate, XCAR (tail), prop))) { Fsetcar (XCDR (tail), val); return plist; @@ -2738,7 +2738,7 @@ The value is actually the tail of PLIST whose car is PROP. */) Lisp_Object tail = plist; FOR_EACH_TAIL (tail) { - if (!NILP (call2 (predicate, XCAR (tail), prop))) + if (!NILP (calln (predicate, XCAR (tail), prop))) return tail; tail = XCDR (tail); if (! CONSP (tail)) @@ -3385,7 +3385,7 @@ mapcar1 (EMACS_INT leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) { if (! CONSP (tail)) return i; - Lisp_Object dummy = call1 (fn, XCAR (tail)); + Lisp_Object dummy = calln (fn, XCAR (tail)); if (vals) vals[i] = dummy; tail = XCDR (tail); @@ -3395,7 +3395,7 @@ mapcar1 (EMACS_INT leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) { for (ptrdiff_t i = 0; i < leni; i++) { - Lisp_Object dummy = call1 (fn, AREF (seq, i)); + Lisp_Object dummy = calln (fn, AREF (seq, i)); if (vals) vals[i] = dummy; } @@ -3408,7 +3408,7 @@ mapcar1 (EMACS_INT leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) { ptrdiff_t i_before = i; int c = fetch_string_char_advance (seq, &i, &i_byte); - Lisp_Object dummy = call1 (fn, make_fixnum (c)); + Lisp_Object dummy = calln (fn, make_fixnum (c)); if (vals) vals[i_before] = dummy; } @@ -3418,7 +3418,7 @@ mapcar1 (EMACS_INT leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) eassert (BOOL_VECTOR_P (seq)); for (EMACS_INT i = 0; i < leni; i++) { - Lisp_Object dummy = call1 (fn, bool_vector_ref (seq, i)); + Lisp_Object dummy = calln (fn, bool_vector_ref (seq, i)); if (vals) vals[i] = dummy; } @@ -3551,7 +3551,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */) Lisp_Object do_yes_or_no_p (Lisp_Object prompt) { - return call1 (Qyes_or_no_p, prompt); + return calln (Qyes_or_no_p, prompt); } DEFUN ("yes-or-no-p", Fyes_or_no_p, Syes_or_no_p, 1, 1, 0, @@ -3596,7 +3596,7 @@ by a mouse, or by some window-system gesture, or via a menu. */) } if (use_short_answers) - return call1 (Qy_or_n_p, prompt); + return calln (Qy_or_n_p, prompt); ptrdiff_t promptlen = SCHARS (prompt); bool prompt_ends_in_nonspace @@ -5989,7 +5989,7 @@ set a new value for KEY, or `remhash' to remove KEY. we shouldn't crash as a result (although the effects are unpredictable). */ DOHASH_SAFE (h, i) - call2 (function, HASH_KEY (h, i), HASH_VALUE (h, i)); + calln (function, HASH_KEY (h, i), HASH_VALUE (h, i)); return Qnil; } @@ -6237,7 +6237,7 @@ extract_data_from_object (Lisp_Object spec, if (!force_raw_text && !NILP (Ffboundp (Vselect_safe_coding_system_function))) /* Confirm that VAL can surely encode the current region. */ - coding_system = call4 (Vselect_safe_coding_system_function, + coding_system = calln (Vselect_safe_coding_system_function, make_fixnum (b), make_fixnum (e), coding_system, Qnil); diff --git a/src/frame.c b/src/frame.c index 4559bc41ab8..c4afbe6bbb6 100644 --- a/src/frame.c +++ b/src/frame.c @@ -401,7 +401,7 @@ frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, : FRAME_COLUMN_WIDTH (f))); } else - retval = XFIXNUM (call4 (Qframe_windows_min_size, frame, horizontal, + retval = XFIXNUM (calln (Qframe_windows_min_size, frame, horizontal, ignore, pixelwise)); /* Don't allow too small height of text-mode frames, or else cm.c @@ -890,7 +890,7 @@ adjust_frame_size (struct frame *f, int new_text_width, int new_text_height, #endif } else if (new_text_cols != old_text_cols) - call2 (Qwindow__pixel_to_total, frame, Qt); + calln (Qwindow__pixel_to_total, frame, Qt); if (new_inner_height != old_inner_height /* When the top margin has changed we have to recalculate the top @@ -907,7 +907,7 @@ adjust_frame_size (struct frame *f, int new_text_width, int new_text_height, FrameRows (FRAME_TTY (f)) = new_text_lines + FRAME_TOP_MARGIN (f); } else if (new_text_lines != old_text_lines) - call2 (Qwindow__pixel_to_total, frame, Qnil); + calln (Qwindow__pixel_to_total, frame, Qnil); /* Assign new sizes. */ FRAME_COLS (f) = new_text_cols; @@ -1153,7 +1153,7 @@ make_frame_without_minibuffer (Lisp_Object mini_window, KBOARD *kb, Lisp_Object initial_frame; /* If there's no minibuffer frame to use, create one. */ - initial_frame = call1 (Qmake_initial_minibuffer_frame, + initial_frame = calln (Qmake_initial_minibuffer_frame, display); kset_default_minibuffer_frame (kb, initial_frame); } @@ -1818,7 +1818,7 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor non-active minibuffer. */ && NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt))) { - Lisp_Object w = call1 (Qget_mru_window, frame); + Lisp_Object w = calln (Qget_mru_window, frame); if (WINDOW_LIVE_P (w)) /* W can be nil in minibuffer-only frames. */ Fset_frame_selected_window (frame, w, Qnil); } @@ -2980,7 +2980,7 @@ mouse_position (bool call_mouse_position_function) lispy_dummy = Qnil; retval = Fcons (lispy_dummy, Fcons (x, y)); if (call_mouse_position_function && !NILP (Vmouse_position_function)) - retval = call1 (Vmouse_position_function, retval); + retval = calln (Vmouse_position_function, retval); return retval; } @@ -3022,7 +3022,7 @@ Y. */) retval = Fcons (lispy_dummy, Fcons (x, y)); if (!NILP (Vmouse_position_function)) - retval = call1 (Vmouse_position_function, retval); + retval = calln (Vmouse_position_function, retval); return retval; } @@ -4482,7 +4482,7 @@ frame_float (struct frame *f, Lisp_Object val, enum frame_float_type what, Lisp_Object frame; XSETFRAME (frame, f); - monitor_attributes = call1 (Qframe_monitor_attributes, frame); + monitor_attributes = calln (Qframe_monitor_attributes, frame); if (NILP (monitor_attributes)) { /* No monitor attributes available. */ @@ -4527,7 +4527,7 @@ frame_float (struct frame *f, Lisp_Object val, enum frame_float_type what, Lisp_Object frame, outer_edges; XSETFRAME (frame, f); - outer_edges = call2 (Qframe_edges, frame, Qouter_edges); + outer_edges = calln (Qframe_edges, frame, Qouter_edges); if (!NILP (outer_edges)) { @@ -6127,7 +6127,7 @@ On Nextstep, this just calls `ns-parse-geometry'. */) #ifdef HAVE_NS if (strchr (SSDATA (string), ' ') != NULL) - return call1 (Qns_parse_geometry, string); + return calln (Qns_parse_geometry, string); #endif int geometry = XParseGeometry (SSDATA (string), &x, &y, &width, &height); @@ -6539,7 +6539,7 @@ have changed. */) /* Now call this to apply the existing value(s) of the `default' face. */ - call2 (Qface_set_after_frame_default, frame, params); + calln (Qface_set_after_frame_default, frame, params); /* Restore the value of the `font-parameter' parameter, as `face-set-after-frame-default' will have changed it through its diff --git a/src/gtkutil.c b/src/gtkutil.c index 54d2bc63077..60899bd90e4 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -5505,7 +5505,7 @@ find_rtl_image (struct frame *f, Lisp_Object image, Lisp_Object rtl) Lisp_Object rtl_image = PROP (TOOL_BAR_ITEM_IMAGES); if (!NILP (file = file_for_image (rtl_image))) { - file = call1 (Qfile_name_sans_extension, + file = calln (Qfile_name_sans_extension, Ffile_name_nondirectory (file)); if (! NILP (Fequal (file, rtl_name))) { @@ -5919,7 +5919,7 @@ update_frame_tool_bar (struct frame *f) specified_file = file_for_image (image); if (!NILP (specified_file) && !NILP (Ffboundp (Qx_gtk_map_stock))) - stock = call1 (Qx_gtk_map_stock, specified_file); + stock = calln (Qx_gtk_map_stock, specified_file); if (CONSP (stock)) { diff --git a/src/haikufns.c b/src/haikufns.c index 29e4d6283e1..22e82048fc4 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -1196,7 +1196,7 @@ haiku_create_tip_frame (Lisp_Object parms) { Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); - call2 (Qface_set_after_frame_default, frame, Qnil); + calln (Qface_set_after_frame_default, frame, Qnil); if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) { @@ -1309,7 +1309,7 @@ haiku_hide_tip (bool delete) if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -2467,7 +2467,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, tip_f = XFRAME (tip_frame); if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -2505,11 +2505,11 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, } else tip_last_parms = - call2 (Qassq_delete_all, parm, tip_last_parms); + calln (Qassq_delete_all, parm, tip_last_parms); } else tip_last_parms = - call2 (Qassq_delete_all, parm, tip_last_parms); + calln (Qassq_delete_all, parm, tip_last_parms); } /* Now check if every parameter in what is left of @@ -2680,7 +2680,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, start_timer: /* Let the tip disappear after timeout seconds. */ - tip_timer = call3 (Qrun_at_time, timeout, Qnil, Qx_hide_tip); + tip_timer = calln (Qrun_at_time, timeout, Qnil, Qx_hide_tip); return unbind_to (count, Qnil); } diff --git a/src/haikumenu.c b/src/haikumenu.c index acee8effe31..a7976cc1bed 100644 --- a/src/haikumenu.c +++ b/src/haikumenu.c @@ -786,7 +786,7 @@ the position of the last non-menu event instead. */) popup_activated_p += 1; } else - return call2 (Qpopup_menu, call0 (Qmouse_menu_bar_map), + return calln (Qpopup_menu, calln (Qmouse_menu_bar_map), last_nonmenu_event); return Qnil; diff --git a/src/image.c b/src/image.c index bae7c13ac82..b8405d81111 100644 --- a/src/image.c +++ b/src/image.c @@ -12660,7 +12660,7 @@ gs_load (struct frame *f, struct image *img) if (NILP (loader)) loader = Qgs_load_image; - img->lisp_data = call6 (loader, frame, img->spec, + img->lisp_data = calln (loader, frame, img->spec, make_fixnum (img->width), make_fixnum (img->height), window_and_pixmap_id, diff --git a/src/insdel.c b/src/insdel.c index 27d0d5d628c..57e98018872 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -2067,7 +2067,7 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t end, : (!NILP (Vselect_active_regions) && !NILP (Vtransient_mark_mode)))) Vsaved_region_selection - = call1 (Vregion_extract_function, Qnil); + = calln (Vregion_extract_function, Qnil); signal_before_change (start, end, preserve_ptr); Fset (Qdeactivate_mark, Qt); diff --git a/src/intervals.c b/src/intervals.c index e81fa9e3a2c..b937c947ab0 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -2052,17 +2052,17 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) enter_after = Qnil; if (! EQ (leave_before, enter_before) && !NILP (leave_before)) - call2 (leave_before, make_fixnum (old_position), + calln (leave_before, make_fixnum (old_position), make_fixnum (charpos)); if (! EQ (leave_after, enter_after) && !NILP (leave_after)) - call2 (leave_after, make_fixnum (old_position), + calln (leave_after, make_fixnum (old_position), make_fixnum (charpos)); if (! EQ (enter_before, leave_before) && !NILP (enter_before)) - call2 (enter_before, make_fixnum (old_position), + calln (enter_before, make_fixnum (old_position), make_fixnum (charpos)); if (! EQ (enter_after, leave_after) && !NILP (enter_after)) - call2 (enter_after, make_fixnum (old_position), + calln (enter_after, make_fixnum (old_position), make_fixnum (charpos)); } } diff --git a/src/keyboard.c b/src/keyboard.c index 621e6c1cafb..6208b333e9c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1039,7 +1039,7 @@ cmd_error_internal (Lisp_Object data, const char *context) /* Use user's specified output function if any. */ if (!NILP (Vcommand_error_function)) - call3 (Vcommand_error_function, data, + calln (Vcommand_error_function, data, context ? build_string (context) : empty_unibyte_string, Vsignaling_function); @@ -1542,7 +1542,7 @@ command_loop_1 (void) update_redisplay_ticks (0, NULL); display_working_on_window_p = false; - call1 (Qcommand_execute, Vthis_command); + calln (Qcommand_execute, Vthis_command); display_working_on_window_p = false; #ifdef HAVE_WINDOW_SYSTEM @@ -1631,11 +1631,11 @@ command_loop_1 (void) Vselection_inhibit_update_commands))) { Lisp_Object txt - = call1 (Vregion_extract_function, Qnil); + = calln (Vregion_extract_function, Qnil); if (XFIXNUM (Flength (txt)) > 0) /* Don't set empty selections. */ - call2 (Qgui_set_selection, QPRIMARY, txt); + calln (Qgui_set_selection, QPRIMARY, txt); CALLN (Frun_hook_with_args, Qpost_select_region_hook, txt); } @@ -2205,7 +2205,7 @@ help_echo_substitute_command_keys (Lisp_Object help) help))) return help; - return call1 (Qsubstitute_command_keys, help); + return calln (Qsubstitute_command_keys, help); } /* Display the help-echo property of the character after the mouse pointer. @@ -2259,7 +2259,7 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object, restore the mouse_moved flag. */ struct frame *f = some_mouse_moved (); - help = call1 (Qmouse_fixup_help_message, help); + help = calln (Qmouse_fixup_help_message, help); if (f) f->mouse_moved = true; } @@ -2267,7 +2267,7 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object, if (STRINGP (help) || NILP (help)) { if (!NILP (Vshow_help_function)) - call1 (Vshow_help_function, help_echo_substitute_command_keys (help)); + calln (Vshow_help_function, help_echo_substitute_command_keys (help)); help_echo_showing_p = STRINGP (help); } } @@ -3072,7 +3072,7 @@ read_char (int commandflag, Lisp_Object map, struct buffer *prev_buffer = current_buffer; last_input_event = c; - call4 (Qcommand_execute, tem, Qnil, Fvector (1, &last_input_event), Qt); + calln (Qcommand_execute, tem, Qnil, Fvector (1, &last_input_event), Qt); if (CONSP (c) && !NILP (Fmemq (XCAR (c), Vwhile_no_input_ignore_events)) && !end_time) @@ -3258,7 +3258,7 @@ read_char (int commandflag, Lisp_Object map, } /* Call the input method. */ - tem = call1 (Vinput_method_function, c); + tem = calln (Vinput_method_function, c); tem = unbind_to (count, tem); @@ -4801,7 +4801,7 @@ timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) specbind (Qinhibit_quit, Qt); - call1 (Qtimer_event_handler, chosen_timer); + calln (Qtimer_event_handler, chosen_timer); Vdeactivate_mark = old_deactivate_mark; timers_run++; unbind_to (count, Qnil); @@ -6511,7 +6511,7 @@ make_lispy_event (struct input_event *event) being generated. */ { Lisp_Object edges - = call4 (Qwindow_edges, Fcar (start_pos), Qt, Qnil, Qt); + = calln (Qwindow_edges, Fcar (start_pos), Qt, Qnil, Qt); int new_x = XFIXNUM (Fcar (frame_relative_event_pos)); int new_y = XFIXNUM (Fcdr (frame_relative_event_pos)); @@ -8902,7 +8902,7 @@ parse_menu_item (Lisp_Object item, int inmenubar) /* The previous code preferred :key-sequence to :keys, so we preserve this behavior. */ if (STRINGP (keyeq) && !CONSP (keyhint)) - keyeq = concat2 (space_space, call1 (Qsubstitute_command_keys, keyeq)); + keyeq = concat2 (space_space, calln (Qsubstitute_command_keys, keyeq)); else { Lisp_Object prefix = keyeq; @@ -10261,7 +10261,7 @@ access_keymap_keyremap (Lisp_Object map, Lisp_Object key, Lisp_Object prompt, remapped. */ count = SPECPDL_INDEX (); specbind (Qcurrent_key_remap_sequence, remap); - next = unbind_to (count, call1 (next, prompt)); + next = unbind_to (count, calln (next, prompt)); /* If the function returned something invalid, barf--don't ignore it. */ diff --git a/src/keymap.c b/src/keymap.c index 9ff0b52df72..99291e72b3f 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -579,7 +579,7 @@ map_keymap_internal (Lisp_Object map, static void map_keymap_call (Lisp_Object key, Lisp_Object val, Lisp_Object fun, void *dummy) { - call2 (fun, key, val); + calln (fun, key, val); } /* Same as map_keymap_internal, but traverses parent keymaps as well. @@ -642,7 +642,7 @@ usage: (map-keymap FUNCTION KEYMAP) */) (Lisp_Object function, Lisp_Object keymap, Lisp_Object sort_first) { if (! NILP (sort_first)) - return call2 (Qmap_keymap_sorted, function, keymap); + return calln (Qmap_keymap_sorted, function, keymap); map_keymap (keymap, map_keymap_call, function, NULL, 1); return Qnil; @@ -1069,9 +1069,9 @@ possibly_translate_key_sequence (Lisp_Object key, ptrdiff_t *length) This happens when menu items define as bindings strings that should be inserted into the buffer, not commands. See bug#64927, for example. */ - if (NILP (call1 (Qkey_valid_p, AREF (key, 0)))) + if (NILP (calln (Qkey_valid_p, AREF (key, 0)))) return key; - key = call1 (Qkey_parse, AREF (key, 0)); + key = calln (Qkey_parse, AREF (key, 0)); *length = CHECK_VECTOR_OR_STRING (key); if (*length == 0) xsignal2 (Qerror, build_string ("Invalid `key-parse' syntax: %S"), key); @@ -3035,14 +3035,14 @@ static void describe_vector_princ (Lisp_Object elt, Lisp_Object fun) { Findent_to (make_fixnum (16), make_fixnum (1)); - call1 (fun, elt); + calln (fun, elt); Fterpri (Qnil, Qnil); } static void describe_vector_basic (Lisp_Object elt, Lisp_Object fun) { - call1 (fun, elt); + calln (fun, elt); } DEFUN ("describe-vector", Fdescribe_vector, Sdescribe_vector, 1, 2, 0, diff --git a/src/lisp.h b/src/lisp.h index bc0bc682498..9038a37e421 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4850,7 +4850,7 @@ extern bool signal_quit_p (Lisp_Object); The calling convention: if (!NILP (Vrun_hooks)) - call1 (Vrun_hooks, Qmy_funny_hook); + calln (Vrun_hooks, Qmy_funny_hook); should no longer be used. */ extern void run_hook (Lisp_Object); diff --git a/src/lread.c b/src/lread.c index ab900b3bee6..e5d1ba0e6bb 100644 --- a/src/lread.c +++ b/src/lread.c @@ -524,7 +524,7 @@ unreadchar (Lisp_Object readcharfun, int c) unread_char = c; } else - call1 (readcharfun, make_fixnum (c)); + calln (readcharfun, make_fixnum (c)); } static int @@ -1342,7 +1342,7 @@ Return t if the file exists and loads successfully. */) handler = Ffind_file_name_handler (file, Qload); if (!NILP (handler)) return - call6 (handler, Qload, file, noerror, nomessage, nosuffix, must_suffix); + calln (handler, Qload, file, noerror, nomessage, nosuffix, must_suffix); /* The presence of this call is the result of a historical accident: it used to be in every file-operation and when it got removed @@ -1446,7 +1446,7 @@ Return t if the file exists and loads successfully. */) else handler = Ffind_file_name_handler (found, Qload); if (! NILP (handler)) - return call5 (handler, Qload, found, noerror, nomessage, Qt); + return calln (handler, Qload, found, noerror, nomessage, Qt); #ifdef DOS_NT /* Tramp has to deal with semi-broken packages that prepend drive letters to remote files. For that reason, Tramp @@ -1612,7 +1612,7 @@ Return t if the file exists and loads successfully. */) lread_close (fd); clear_unwind_protect (fd_index); } - val = call4 (Vload_source_file_function, found, hist_file_name, + val = calln (Vload_source_file_function, found, hist_file_name, NILP (noerror) ? Qnil : Qt, (NILP (nomessage) || force_load_messages) ? Qnil : Qt); return unbind_to (count, val); @@ -1739,7 +1739,7 @@ Return t if the file exists and loads successfully. */) /* Run any eval-after-load forms for this file. */ if (!NILP (Ffboundp (Qdo_after_load_evaluation))) - call1 (Qdo_after_load_evaluation, hist_file_name) ; + calln (Qdo_after_load_evaluation, hist_file_name); for (int i = 0; i < ARRAYELTS (saved_strings); i++) { @@ -2079,7 +2079,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, exists = !NILP (Ffile_readable_p (string)); else { - Lisp_Object tmp = call1 (predicate, string); + Lisp_Object tmp = calln (predicate, string); if (NILP (tmp)) exists = false; else if (EQ (tmp, Qdir_ok) @@ -2343,7 +2343,7 @@ readevalloop_eager_expand_eval (Lisp_Object val, Lisp_Object macroexpand) form in the progn as a top-level form. This way, if one form in the progn defines a macro, that macro is in effect when we expand the remaining forms. See similar code in bytecomp.el. */ - val = call2 (macroexpand, val, Qnil); + val = calln (macroexpand, val, Qnil); if (EQ (CAR_SAFE (val), Qprogn)) { Lisp_Object subforms = XCDR (val); @@ -2352,7 +2352,7 @@ readevalloop_eager_expand_eval (Lisp_Object val, Lisp_Object macroexpand) val = readevalloop_eager_expand_eval (XCAR (subforms), macroexpand); } else - val = eval_sub (call2 (macroexpand, val, Qt)); + val = eval_sub (calln (macroexpand, val, Qt)); return val; } @@ -2501,7 +2501,7 @@ readevalloop (Lisp_Object readcharfun, { if (!NILP (readfun)) { - val = call1 (readfun, readcharfun); + val = calln (readfun, readcharfun); /* If READCHARFUN has set point to ZV, we should stop reading, even if the form read sets point @@ -2514,7 +2514,7 @@ readevalloop (Lisp_Object readcharfun, } } else if (! NILP (Vload_read_function)) - val = call1 (Vload_read_function, readcharfun); + val = calln (Vload_read_function, readcharfun); else val = read_internal_start (readcharfun, Qnil, Qnil, false); } @@ -2673,8 +2673,7 @@ STREAM or the value of `standard-input' may be: minibuffer without a stream, as in (read). But is this feature ever used, and if so, why? IOW, will anything break if this feature is removed !? */ - return call1 (Qread_minibuffer, - build_string ("Lisp expression: ")); + return calln (Qread_minibuffer, build_string ("Lisp expression: ")); return read_internal_start (stream, Qnil, Qnil, false); } @@ -2701,8 +2700,7 @@ STREAM or the value of `standard-input' may be: stream = Qread_char; if (EQ (stream, Qread_char)) /* FIXME: ?! When is this used !? */ - return call1 (Qread_minibuffer, - build_string ("Lisp expression: ")); + return calln (Qread_minibuffer, build_string ("Lisp expression: ")); return read_internal_start (stream, Qnil, Qnil, true); } @@ -2811,7 +2809,7 @@ character_name_to_code (char const *name, ptrdiff_t name_len, Lisp_Object code = (name[0] == 'U' && name[1] == '+' ? string_to_number (name + 1, 16, &len) - : call2 (Qchar_from_name, make_unibyte_string (name, name_len), Qt)); + : calln (Qchar_from_name, make_unibyte_string (name, name_len), Qt)); if (! RANGED_FIXNUMP (0, code, MAX_UNICODE_CHAR) || len != name_len - 1 @@ -5400,7 +5398,7 @@ map_obarray (Lisp_Object obarray, static void mapatoms_1 (Lisp_Object sym, Lisp_Object function) { - call1 (function, sym); + calln (function, sym); } DEFUN ("mapatoms", Fmapatoms, Smapatoms, 1, 2, 0, diff --git a/src/minibuf.c b/src/minibuf.c index b74e5221420..455d2f2b62d 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -166,8 +166,8 @@ zip_minibuffer_stacks (Lisp_Object dest_window, Lisp_Object source_window) return; } - call1 (Qrecord_window_buffer, dest_window); - call1 (Qrecord_window_buffer, source_window); + calln (Qrecord_window_buffer, dest_window); + calln (Qrecord_window_buffer, source_window); acc = merge_c (dw->prev_buffers, sw->prev_buffers, minibuffer_ent_greater); @@ -494,7 +494,7 @@ confirm the aborting of the current minibuffer and all contained ones. */) to abort any extra non-minibuffer recursive edits. Thus, the number of recursive edits we have to abort equals the number of minibuffers we have to abort. */ - call1 (Qminibuffer_quit_recursive_edit, array[1]); + calln (Qminibuffer_quit_recursive_edit, array[1]); } } else @@ -689,7 +689,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, } MB_frame = XWINDOW (XFRAME (selected_frame)->minibuffer_window)->frame; - call1 (Qrecord_window_buffer, minibuf_window); + calln (Qrecord_window_buffer, minibuf_window); record_unwind_protect_void (minibuffer_unwind); if (read_minibuffer_restore_windows) @@ -895,7 +895,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, /* Turn on an input method stored in INPUT_METHOD if any. */ if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method))) - call1 (Qactivate_input_method, input_method); + calln (Qactivate_input_method, input_method); run_hook (Qminibuffer_setup_hook); @@ -964,13 +964,13 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, && !EQ (XWINDOW (XFRAME (calling_frame)->minibuffer_window) ->frame, calling_frame)))) - call2 (Qselect_frame_set_input_focus, calling_frame, Qnil); + calln (Qselect_frame_set_input_focus, calling_frame, Qnil); /* Add the value to the appropriate history list, if any. This is done after the previous buffer has been made current again, in case the history variable is buffer-local. */ if (! (NILP (Vhistory_add_new_input) || NILP (histstring))) - call2 (Qadd_to_history, histvar, histstring); + calln (Qadd_to_history, histvar, histstring); /* If Lisp form desired instead of string, parse it. */ if (expflag) @@ -1565,8 +1565,8 @@ function, instead of the usual behavior. */) result = (NILP (predicate) /* Partial backward compatibility for older read_buffer_functions which don't expect a `predicate' argument. */ - ? call3 (Vread_buffer_function, prompt, def, require_match) - : call4 (Vread_buffer_function, prompt, def, require_match, + ? calln (Vread_buffer_function, prompt, def, require_match) + : calln (Vread_buffer_function, prompt, def, require_match, predicate)); return unbind_to (count, result); } @@ -1656,7 +1656,7 @@ or from one of the possible completions. */) CHECK_STRING (string); if (type == function_table) - return call3 (collection, string, predicate, Qnil); + return calln (collection, string, predicate, Qnil); bestmatch = bucket = Qnil; zero = make_fixnum (0); @@ -1729,11 +1729,11 @@ or from one of the possible completions. */) else { if (type == hash_table) - tem = call2 (predicate, elt, + tem = calln (predicate, elt, HASH_VALUE (XHASH_TABLE (collection), idx - 1)); else - tem = call1 (predicate, elt); + tem = calln (predicate, elt); } if (NILP (tem)) continue; } @@ -1880,7 +1880,7 @@ which case that function should itself handle `completion-regexp-list'). */) CHECK_STRING (string); if (type == 0) - return call3 (collection, string, predicate, Qt); + return calln (collection, string, predicate, Qt); allmatches = bucket = Qnil; zero = make_fixnum (0); @@ -1953,11 +1953,11 @@ which case that function should itself handle `completion-regexp-list'). */) else { if (type == 3) - tem = call2 (predicate, elt, + tem = calln (predicate, elt, HASH_VALUE (XHASH_TABLE (collection), idx - 1)); else - tem = call1 (predicate, elt); + tem = calln (predicate, elt); } if (NILP (tem)) continue; } @@ -2121,7 +2121,7 @@ the values STRING, PREDICATE and `lambda'. */) found_matching_key: ; } else - return call3 (collection, string, predicate, Qlambda); + return calln (collection, string, predicate, Qlambda); /* Reject this element if it fails to match all the regexps. */ if (!match_regexps (string, Vcompletion_regexp_list, @@ -2132,8 +2132,8 @@ the values STRING, PREDICATE and `lambda'. */) if (!NILP (predicate)) { return HASH_TABLE_P (collection) - ? call2 (predicate, tem, arg) - : call1 (predicate, tem); + ? calln (predicate, tem, arg) + : calln (predicate, tem); } else return Qt; diff --git a/src/nsfns.m b/src/nsfns.m index 721dc4995c0..a2c50468cd1 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2517,7 +2517,7 @@ Frames are listed from topmost (first) to bottommost (last). */) handler = Ffind_file_name_handler (filename, operation); if (!NILP (handler)) - return call2 (handler, operation, filename); + return calln (handler, operation, filename); else { NSFileManager *fm = [NSFileManager defaultManager]; @@ -3144,7 +3144,7 @@ internalBorderWidth or internalBorder (which is what xterm calls { Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); - call2 (Qface_set_after_frame_default, frame, Qnil); + calln (Qface_set_after_frame_default, frame, Qnil); if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) { @@ -3183,7 +3183,7 @@ internalBorderWidth or internalBorder (which is what xterm calls { if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -3334,7 +3334,7 @@ internalBorderWidth or internalBorder (which is what xterm calls tip_f = XFRAME (tip_frame); if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -3382,11 +3382,11 @@ internalBorderWidth or internalBorder (which is what xterm calls } else tip_last_parms - = call2 (Qassq_delete_all, parm, tip_last_parms); + = calln (Qassq_delete_all, parm, tip_last_parms); } else tip_last_parms - = call2 (Qassq_delete_all, parm, tip_last_parms); + = calln (Qassq_delete_all, parm, tip_last_parms); } /* Now check if every parameter in what is left of @@ -3548,8 +3548,7 @@ internalBorderWidth or internalBorder (which is what xterm calls start_timer: /* Let the tip disappear after timeout seconds. */ - tip_timer = call3 (Qrun_at_time, timeout, Qnil, - Qx_hide_tip); + tip_timer = calln (Qrun_at_time, timeout, Qnil, Qx_hide_tip); } return unbind_to (count, Qnil); diff --git a/src/nsselect.m b/src/nsselect.m index 4b5fe6770c2..8220ccd9566 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -439,7 +439,7 @@ Updated by Christian Limpach (chris@nice.ch) { /* FIXME: Use run-hook-with-args! */ for (rest = Vns_sent_selection_hooks; CONSP (rest); rest = Fcdr (rest)) - call3 (Fcar (rest), selection, target_symbol, successful_p); + calln (Fcar (rest), selection, target_symbol, successful_p); } return value; diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 4becb5492ac..9251e137f09 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -2849,7 +2849,7 @@ x_create_tip_frame (struct pgtk_display_info *dpyinfo, Lisp_Object parms, struct { Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); - call2 (Qface_set_after_frame_default, frame, Qnil); + calln (Qface_set_after_frame_default, frame, Qnil); if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) { @@ -2996,7 +2996,7 @@ pgtk_hide_tip (bool delete) { if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -3175,7 +3175,7 @@ Text larger than the specified size is clipped. */) tip_f = XFRAME (tip_frame); if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -3213,11 +3213,11 @@ Text larger than the specified size is clipped. */) } else tip_last_parms = - call2 (Qassq_delete_all, parm, tip_last_parms); + calln (Qassq_delete_all, parm, tip_last_parms); } else tip_last_parms = - call2 (Qassq_delete_all, parm, tip_last_parms); + calln (Qassq_delete_all, parm, tip_last_parms); } /* Now check if every parameter in what is left of @@ -3376,7 +3376,7 @@ Text larger than the specified size is clipped. */) start_timer: /* Let the tip disappear after timeout seconds. */ - tip_timer = call3 (Qrun_at_time, timeout, Qnil, Qx_hide_tip); + tip_timer = calln (Qrun_at_time, timeout, Qnil, Qx_hide_tip); return unbind_to (count, Qnil); } diff --git a/src/pgtkselect.c b/src/pgtkselect.c index f1a9214a6b4..c05594d7366 100644 --- a/src/pgtkselect.c +++ b/src/pgtkselect.c @@ -266,10 +266,8 @@ pgtk_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, } if (!NILP (handler_fn)) - value = call3 (handler_fn, selection_symbol, - (local_request - ? Qnil - : target_type), + value = calln (handler_fn, selection_symbol, + (local_request ? Qnil : target_type), tem); else value = Qnil; diff --git a/src/print.c b/src/print.c index f3814859cb3..f990d6a5dc1 100644 --- a/src/print.c +++ b/src/print.c @@ -306,7 +306,7 @@ static void printchar (unsigned int ch, Lisp_Object fun) { if (!NILP (fun) && !EQ (fun, Qt)) - call1 (fun, make_fixnum (ch)); + calln (fun, make_fixnum (ch)); else { unsigned char str[MAX_MULTIBYTE_LENGTH]; diff --git a/src/process.c b/src/process.c index e25228b3d6a..cd1149ae8b0 100644 --- a/src/process.c +++ b/src/process.c @@ -3367,7 +3367,7 @@ finish_after_tls_connection (Lisp_Object proc) Lisp_Object result = Qt; if (!NILP (Ffboundp (Qnsm_verify_connection))) - result = call3 (Qnsm_verify_connection, + result = calln (Qnsm_verify_connection, proc, plist_get (contact, QChost), plist_get (contact, QCservice)); @@ -4963,7 +4963,7 @@ server_accept_connection (Lisp_Object server, int channel) { int code = errno; if (!would_block (code) && !NILP (ps->log)) - call3 (ps->log, server, Qnil, + calln (ps->log, server, Qnil, concat3 (build_string ("accept failed with code"), Fnumber_to_string (make_fixnum (code)), build_string ("\n"))); @@ -5125,7 +5125,7 @@ server_accept_connection (Lisp_Object server, int channel) if (!NILP (ps->log)) { AUTO_STRING (accept_from, "accept from "); - call3 (ps->log, server, proc, concat3 (accept_from, host_string, nl)); + calln (ps->log, server, proc, concat3 (accept_from, host_string, nl)); } AUTO_STRING (open_from, "open from "); @@ -8462,7 +8462,7 @@ See `process-attributes' for getting attributes of a process given its ID. */) = Ffind_file_name_handler (BVAR (current_buffer, directory), Qlist_system_processes); if (!NILP (handler)) - return call1 (handler, Qlist_system_processes); + return calln (handler, Qlist_system_processes); return list_system_processes (); } @@ -8526,7 +8526,7 @@ integer or floating point values. = Ffind_file_name_handler (BVAR (current_buffer, directory), Qprocess_attributes); if (!NILP (handler)) - return call2 (handler, Qprocess_attributes, pid); + return calln (handler, Qprocess_attributes, pid); return system_process_attributes (pid); } diff --git a/src/sort.c b/src/sort.c index 7f079cecd45..fb00f5cc8ea 100644 --- a/src/sort.c +++ b/src/sort.c @@ -198,7 +198,7 @@ typedef struct merge_state static bool order_pred_lisp (merge_state *ms, Lisp_Object a, Lisp_Object b) { - return !NILP (call2 (ms->predicate, a, b)); + return !NILP (calln (ms->predicate, a, b)); } static bool @@ -1127,7 +1127,7 @@ tim_sort (Lisp_Object predicate, Lisp_Object keyfunc, (any call to keyfunc might trigger a GC). */ if (!NILP (keyfunc)) for (ptrdiff_t i = 0; i < length; i++) - keys[i] = call1 (keyfunc, seq[i]); + keys[i] = calln (keyfunc, seq[i]); /* FIXME: This is where we would check the keys for interesting properties for more optimized comparison (such as all being fixnums diff --git a/src/syntax.c b/src/syntax.c index 0b68fed648a..6ffa8a94c7f 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -585,7 +585,7 @@ find_defun_start (ptrdiff_t pos, ptrdiff_t pos_byte) if (!NILP (Vcomment_use_syntax_ppss)) { modiff_count modiffs = CHARS_MODIFF; - Lisp_Object ppss = call1 (Qsyntax_ppss, make_fixnum (pos)); + Lisp_Object ppss = calln (Qsyntax_ppss, make_fixnum (pos)); if (modiffs != CHARS_MODIFF) error ("syntax-ppss modified the buffer!"); TEMP_SET_PT_BOTH (opoint, opoint_byte); @@ -1430,7 +1430,7 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value, { AUTO_STRING (prefixdoc, ",\n\t is a prefix character for `backward-prefix-chars'"); - insert1 (call1 (Qsubstitute_command_keys, prefixdoc)); + insert1 (calln (Qsubstitute_command_keys, prefixdoc)); } return syntax; @@ -1474,7 +1474,7 @@ scan_words (ptrdiff_t from, EMACS_INT count) func = CHAR_TABLE_REF (Vfind_word_boundary_function_table, ch0); if (! NILP (Ffboundp (func))) { - pos = call2 (func, make_fixnum (from - 1), make_fixnum (end)); + pos = calln (func, make_fixnum (from - 1), make_fixnum (end)); if (FIXNUMP (pos) && from < XFIXNUM (pos) && XFIXNUM (pos) <= ZV) { from = XFIXNUM (pos); @@ -1523,7 +1523,7 @@ scan_words (ptrdiff_t from, EMACS_INT count) func = CHAR_TABLE_REF (Vfind_word_boundary_function_table, ch1); if (! NILP (Ffboundp (func))) { - pos = call2 (func, make_fixnum (from), make_fixnum (beg)); + pos = calln (func, make_fixnum (from), make_fixnum (beg)); if (FIXNUMP (pos) && BEGV <= XFIXNUM (pos) && XFIXNUM (pos) < from) { from = XFIXNUM (pos); diff --git a/src/textconv.c b/src/textconv.c index 80b1a37f0fd..105a8077072 100644 --- a/src/textconv.c +++ b/src/textconv.c @@ -1308,7 +1308,7 @@ really_set_point_and_mark (struct frame *f, ptrdiff_t point, && !NILP (BVAR (current_buffer, mark_active))) call0 (Qdeactivate_mark); else - call1 (Qpush_mark, make_fixnum (mark)); + calln (Qpush_mark, make_fixnum (mark)); /* Update the ephemeral last point. */ w = XWINDOW (selected_window); diff --git a/src/textprop.c b/src/textprop.c index 1803f2d1cb0..30c26ce4809 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -2167,7 +2167,7 @@ call_mod_hooks (Lisp_Object list, Lisp_Object start, Lisp_Object end) { while (!NILP (list)) { - call2 (Fcar (list), start, end); + calln (Fcar (list), start, end); list = Fcdr (list); } } diff --git a/src/undo.c b/src/undo.c index e460c5de212..87d3fc2602d 100644 --- a/src/undo.c +++ b/src/undo.c @@ -358,7 +358,7 @@ truncate_undo_list (struct buffer *b) Lisp_Object tem; /* Normally the function this calls is undo-outer-limit-truncate. */ - tem = call1 (Vundo_outer_limit_function, make_int (size_so_far)); + tem = calln (Vundo_outer_limit_function, make_int (size_so_far)); if (! NILP (tem)) { /* The function is responsible for making diff --git a/src/w32fns.c b/src/w32fns.c index 452740f46ca..c2551ea2378 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7574,7 +7574,7 @@ w32_create_tip_frame (struct w32_display_info *dpyinfo, Lisp_Object parms) Lisp_Object fg = Fframe_parameter (frame, Qforeground_color); Lisp_Object colors = Qnil; - call2 (Qface_set_after_frame_default, frame, Qnil); + calln (Qface_set_after_frame_default, frame, Qnil); if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) colors = Fcons (Fcons (Qbackground_color, bg), colors); @@ -7723,7 +7723,7 @@ w32_hide_tip (bool delete) { if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -7816,7 +7816,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, Lisp_Object timer = tip_timer; tip_timer = Qnil; - call1 (Qcancel_timer, timer); + calln (Qcancel_timer, timer); } block_input (); @@ -7867,11 +7867,11 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, } else tip_last_parms = - call2 (Qassq_delete_all, parm, tip_last_parms); + calln (Qassq_delete_all, parm, tip_last_parms); } else tip_last_parms = - call2 (Qassq_delete_all, parm, tip_last_parms); + calln (Qassq_delete_all, parm, tip_last_parms); } /* Now check if there's a parameter left in tip_last_parms with a @@ -8053,8 +8053,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, start_timer: /* Let the tip disappear after timeout seconds. */ - tip_timer = call3 (Qrun_at_time, timeout, Qnil, - Qx_hide_tip); + tip_timer = calln (Qrun_at_time, timeout, Qnil, Qx_hide_tip); return unbind_to (count, Qnil); } @@ -8539,7 +8538,7 @@ DEFUN ("system-move-file-to-trash", Fsystem_move_file_to_trash, handler = Ffind_file_name_handler (filename, operation); if (!NILP (handler)) - return call2 (handler, operation, filename); + return calln (handler, operation, filename); else { const char * path; @@ -9727,7 +9726,7 @@ DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0, Lisp_Object handler = Ffind_file_name_handler (encoded, Qfile_system_info); if (!NILP (handler)) { - value = call2 (handler, Qfile_system_info, encoded); + value = calln (handler, Qfile_system_info, encoded); if (CONSP (value) || NILP (value)) return value; error ("Invalid handler in `file-name-handler-alist'"); diff --git a/src/window.c b/src/window.c index 38f5307cb68..0ed1b53d866 100644 --- a/src/window.c +++ b/src/window.c @@ -2665,8 +2665,8 @@ recombine_windows (Lisp_Object window) static void delete_deletable_window (Lisp_Object window) { - if (!NILP (call1 (Qwindow_deletable_p, window))) - call1 (Qdelete_window, window); + if (!NILP (calln (Qwindow_deletable_p, window))) + calln (Qdelete_window, window); } /*********************************************************************** @@ -3331,7 +3331,7 @@ resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal, Lisp_Object ignore, Lisp_Object pixelwise) { - return call5 (Qwindow__resize_root_window, window, delta, + return calln (Qwindow__resize_root_window, window, delta, horizontal, ignore, pixelwise); } @@ -3339,7 +3339,7 @@ resize_root_window (Lisp_Object window, Lisp_Object delta, static Lisp_Object window_pixel_to_total (Lisp_Object frame, Lisp_Object horizontal) { - return call2 (Qwindow__pixel_to_total, frame, horizontal); + return calln (Qwindow__pixel_to_total, frame, horizontal); } @@ -3710,7 +3710,7 @@ replace_buffer_in_windows (Lisp_Object buffer) /* When kill-buffer is called early during loadup, this function is undefined. */ if (!NILP (Ffboundp (Qreplace_buffer_in_windows))) - call1 (Qreplace_buffer_in_windows, buffer); + calln (Qreplace_buffer_in_windows, buffer); } /** If BUFFER is shown in any window, safely replace it with some other @@ -4435,7 +4435,7 @@ This function runs `window-scroll-functions' before running dedication. */ wset_dedicated (w, Qnil); - call1 (Qrecord_window_buffer, window); + calln (Qrecord_window_buffer, window); } unshow_buffer (w); @@ -4449,7 +4449,7 @@ This function runs `window-scroll-functions' before running static Lisp_Object display_buffer (Lisp_Object buffer, Lisp_Object not_this_window_p, Lisp_Object override_frame) { - return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame); + return calln (Qdisplay_buffer, buffer, not_this_window_p, override_frame); } DEFUN ("force-window-update", Fforce_window_update, Sforce_window_update, @@ -4513,7 +4513,7 @@ temp_output_buffer_show (register Lisp_Object buf) set_buffer_internal (old); if (!NILP (Vtemp_buffer_show_function)) - call1 (Vtemp_buffer_show_function, buf); + calln (Vtemp_buffer_show_function, buf); else if (WINDOW_LIVE_P (window = display_buffer (buf, Qnil, Qnil))) { if (!EQ (XWINDOW (window)->frame, selected_frame)) @@ -5644,7 +5644,7 @@ grow_mini_window (struct window *w, int delta) struct window *r = XWINDOW (root); Lisp_Object grow; - grow = call3 (Qwindow__resize_root_window_vertically, + grow = calln (Qwindow__resize_root_window_vertically, root, make_fixnum (- delta), Qt); if (FIXNUMP (grow) @@ -5682,7 +5682,7 @@ shrink_mini_window (struct window *w) struct window *r = XWINDOW (root); Lisp_Object grow; - grow = call3 (Qwindow__resize_root_window_vertically, + grow = calln (Qwindow__resize_root_window_vertically, root, make_fixnum (delta), Qt); if (FIXNUMP (grow) && window_resize_check (r, false)) @@ -7493,7 +7493,7 @@ the return value is nil. Otherwise the value is t. */) && (NILP (Fminibufferp (p->buffer, Qnil)))) /* If a window we restore gets another buffer, record the window's old buffer. */ - call1 (Qrecord_window_buffer, window); + calln (Qrecord_window_buffer, window); } /* Disallow set_window_size_hook, temporarily. */ diff --git a/src/xfaces.c b/src/xfaces.c index 5c1300309dd..5e76e598d84 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1087,7 +1087,7 @@ tty_lookup_color (struct frame *f, Lisp_Object color, Emacs_Color *tty_color, XSETFRAME (frame, f); - color_desc = call2 (Qtty_color_desc, color, frame); + color_desc = calln (Qtty_color_desc, color, frame); if (CONSP (color_desc) && CONSP (XCDR (color_desc))) { Lisp_Object rgb; @@ -1116,7 +1116,7 @@ tty_lookup_color (struct frame *f, Lisp_Object color, Emacs_Color *tty_color, && !NILP (Ffboundp (Qtty_color_standard_values))) { /* Look up STD_COLOR separately. */ - rgb = call1 (Qtty_color_standard_values, color); + rgb = calln (Qtty_color_standard_values, color); if (! parse_rgb_list (rgb, std_color)) return false; } @@ -1178,7 +1178,7 @@ tty_color_name (struct frame *f, int idx) Lisp_Object coldesc; XSETFRAME (frame, f); - coldesc = call2 (Qtty_color_by_index, make_fixnum (idx), frame); + coldesc = calln (Qtty_color_by_index, make_fixnum (idx), frame); if (!NILP (coldesc)) return XCAR (coldesc); @@ -3827,7 +3827,7 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param, mode, so that we have to load new defface specs. Call frame-set-background-mode to do that. */ XSETFRAME (frame, f); - call1 (Qframe_set_background_mode, frame); + calln (Qframe_set_background_mode, frame); face = Qdefault; lface = lface_from_face_name (f, face, true); @@ -4750,7 +4750,7 @@ the triangle inequality. */) if (NILP (metric)) return make_fixnum (color_distance (&cdef1, &cdef2)); else - return call2 (metric, + return calln (metric, list3i (cdef1.red, cdef1.green, cdef1.blue), list3i (cdef2.red, cdef2.green, cdef2.blue)); } @@ -6561,7 +6561,7 @@ map_tty_color (struct frame *f, struct face *face, Lisp_Object color, if (STRINGP (color) && SCHARS (color) && CONSP (Vtty_defined_color_alist) - && (def = assoc_no_quit (color, call1 (Qtty_color_alist, frame)), + && (def = assoc_no_quit (color, calln (Qtty_color_alist, frame)), CONSP (def))) { /* Associations in tty-defined-color-alist are of the form diff --git a/src/xfns.c b/src/xfns.c index b4d08bfc202..f0207ebbcee 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -8672,7 +8672,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms) { Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); - call2 (Qface_set_after_frame_default, frame, Qnil); + calln (Qface_set_after_frame_default, frame, Qnil); if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) { @@ -8844,7 +8844,7 @@ x_hide_tip (bool delete) { if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -9071,7 +9071,7 @@ Text larger than the specified size is clipped. */) tip_f = XFRAME (tip_frame); if (!NILP (tip_timer)) { - call1 (Qcancel_timer, tip_timer); + calln (Qcancel_timer, tip_timer); tip_timer = Qnil; } @@ -9110,11 +9110,11 @@ Text larger than the specified size is clipped. */) } else tip_last_parms = - call2 (Qassq_delete_all, parm, tip_last_parms); + calln (Qassq_delete_all, parm, tip_last_parms); } else tip_last_parms = - call2 (Qassq_delete_all, parm, tip_last_parms); + calln (Qassq_delete_all, parm, tip_last_parms); } /* Now check if every parameter in what is left of @@ -9296,8 +9296,7 @@ Text larger than the specified size is clipped. */) start_timer: /* Let the tip disappear after timeout seconds. */ - tip_timer = call3 (Qrun_at_time, timeout, Qnil, - Qx_hide_tip); + tip_timer = calln (Qrun_at_time, timeout, Qnil, Qx_hide_tip); return unbind_to (count, Qnil); } diff --git a/src/xmenu.c b/src/xmenu.c index 848ff6e21cf..ce5cdbcfc0b 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1431,7 +1431,7 @@ menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer #endif /* TODO: Get the monitor workarea directly without calculating other items in x-display-monitor-attributes-list. */ - workarea = call3 (Qframe_monitor_workarea, + workarea = calln (Qframe_monitor_workarea, Qnil, make_fixnum (data->x), make_fixnum (data->y)); diff --git a/src/xselect.c b/src/xselect.c index c830a6df6c1..5e494a2ca22 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -396,7 +396,7 @@ x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, } if (!NILP (handler_fn)) - value = call3 (handler_fn, selection_symbol, + value = calln (handler_fn, selection_symbol, ((local_request && NILP (Vx_treat_local_requests_remotely)) ? Qnil diff --git a/src/xterm.c b/src/xterm.c index 43788af59d0..b16f4ddfccf 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -13095,7 +13095,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, ref = SPECPDL_INDEX (); record_unwind_protect_ptr (x_dnd_cleanup_drag_and_drop, f); - call2 (Vx_dnd_movement_function, frame_object, + calln (Vx_dnd_movement_function, frame_object, Fposn_at_x_y (x, y, frame_object, Qnil)); x_dnd_unwind_flag = false; unbind_to (ref, Qnil); @@ -13129,7 +13129,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, ref = SPECPDL_INDEX (); record_unwind_protect_ptr (x_dnd_cleanup_drag_and_drop, f); - call4 (Vx_dnd_wheel_function, + calln (Vx_dnd_wheel_function, Fposn_at_x_y (x, y, frame_object, Qnil), make_fixnum (x_dnd_wheel_button), make_uint (x_dnd_wheel_state), @@ -13198,7 +13198,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, record_unwind_protect_ptr (x_dnd_cleanup_drag_and_drop, f); if (!NILP (Vx_dnd_unsupported_drop_function)) - val = call8 (Vx_dnd_unsupported_drop_function, + val = calln (Vx_dnd_unsupported_drop_function, XCAR (XCDR (x_dnd_unsupported_drop_data)), Fnth (make_fixnum (3), x_dnd_unsupported_drop_data), Fnth (make_fixnum (4), x_dnd_unsupported_drop_data), commit 7362f9f75d5aca1c97f920531dd62763918ba5fe Author: Stefan Kangas Date: Sun Jan 19 12:44:05 2025 +0100 Document use of calln in C code in internals.texi * doc/lispref/internals.texi (Writing Emacs Primitives): Don't recommend `call0`, `call1`, etc. Instead recommend `calln`, which covers all of those use cases. diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 3703c6087f7..ff09e0aca1c 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -1154,9 +1154,9 @@ one-dimensional array containing their values. The first Lisp-level argument is the Lisp function to call, and the rest are the arguments to pass to it. - The C functions @code{call0}, @code{call1}, @code{call2}, and so on, -provide handy ways to call a Lisp function conveniently with a fixed -number of arguments. They work by calling @code{Ffuncall}. + The C macro @code{calln} is a convenient way to call a Lisp function +without having to specify the number of arguments. It works by calling +@code{Ffuncall}. @file{eval.c} is a very good file to look through for examples; @file{lisp.h} contains the definitions for some important macros and commit 2fd72a6ed3f6ea2937b38a4d74d93e8cfa1a54fb Author: Peter Seibel Date: Sat Jan 18 07:54:51 2025 -0800 Improved git-add completion * lisp/pcmpl-git.el (pcomplete/git)): Complete untracked files. (Bug#75336) Copyright-paperwork-exempt: yes diff --git a/lisp/pcmpl-git.el b/lisp/pcmpl-git.el index f57c2d5470a..f23002df28b 100644 --- a/lisp/pcmpl-git.el +++ b/lisp/pcmpl-git.el @@ -82,8 +82,18 @@ Files listed by `git ls-files ARGS' satisfy the predicate." (pcomplete-from-help `(,vc-git-program "help" ,subcmd) :argument "-+\\(?:\\[no-\\]\\)?[a-z-]+=?")))) + ;; Complete modified tracked files and untracked files and + ;; ignored files if -f or --force is specified. + ("add" + (pcomplete-here + (pcomplete-entries + nil + (let ((flags (list "-o" "-m"))) + (unless (or (member "-f" pcomplete-args) (member "--force" pcomplete-args)) + (push "--exclude-standard" flags)) + (apply #'pcmpl-git--tracked-file-predicate flags))))) ;; Complete modified tracked files - ((or "add" "commit" "restore") + ((or "commit" "restore") (pcomplete-here (pcomplete-entries nil (pcmpl-git--tracked-file-predicate "-m")))) commit ba5360f700b1cbdd16e13a83f622e5c2d29c9439 Author: Manuel Giraud Date: Sat Jan 11 18:34:49 2025 +0100 Fix keybinding alignment in `tmm-menubar' * lisp/tmm.el (tmm--shorten-space-width): New function that reduces the space between the text menu entry and its keybinding to avoid a misalignement. (tmm-add-one-shortcut): Use it. (Bug#75500) diff --git a/lisp/tmm.el b/lisp/tmm.el index c46c477010f..9dcbf90b657 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -282,6 +282,17 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'." (let ((tmm-next-shortcut-digit ?0)) (mapcar #'tmm-add-one-shortcut (reverse list)))) +(defun tmm--shorten-space-width (str) + "Shorten the width between the menu entry and the keybinding by 2 spaces." + (let* ((start (next-single-property-change 0 'display str)) + (n (length str)) + (end (previous-single-property-change n 'display str)) + (curr-width (and start + (plist-get (get-display-property start 'space str) :width)))) + (when curr-width + (put-text-property start end 'display (cons 'space (list :width (- curr-width 2))) str)) + str)) + (defsubst tmm-add-one-shortcut (elt) ;; uses the free vars tmm-next-shortcut-digit and tmm-short-cuts (cond @@ -327,9 +338,14 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'." (add-text-properties pos (1+ pos) '(face highlight) res) res) ;; A fallback digit character: place it in front of the - ;; menu entry. - (concat (propertize (char-to-string char) 'face 'highlight) - " " str)) + ;; menu entry. We need to shorten the spaces between + ;; the menu entry and the keybinding by two spaces + ;; because we added two characters at the front (one + ;; digit and one space) and this would cause a + ;; misalignement otherwise. + (tmm--shorten-space-width + (concat (propertize (char-to-string char) 'face 'highlight) + " " str))) (make-string 2 ?\s)) (concat (if char (concat (char-to-string char) tmm-mid-prompt) ;; Keep them lined up in columns. commit be786ab3bb263cb88e548f439562cbdf93587a3f Author: Eli Zaretskii Date: Sun Jan 19 14:42:46 2025 +0200 ; Fix autorevert-tests on MS-Windows * test/lisp/autorevert-tests.el (auto-revert-test04-auto-revert-mode-dired): Fix test on MS-Windows. diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index 8133b5812a7..5e46216cc42 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -390,11 +390,17 @@ This expects `auto-revert--messages' to be bound by (should auto-revert-mode) (should (string-match name (substring-no-properties (buffer-string)))) + ;; If we don't sleep for a while, this test fails on + ;; MS-Windows. + (if (eq system-type 'windows-nt) + (sleep-for 0.5)) (ert-with-message-capture auto-revert--messages ;; Delete file. (delete-file tmpfile) (auto-revert--wait-for-revert buf)) + (if (eq system-type 'windows-nt) + (sleep-for 1)) ;; Check, that the buffer has been reverted. (should-not (string-match name (substring-no-properties (buffer-string)))) commit f367b01f128223d3fc7c34985eccce744333fa8f Author: Eli Zaretskii Date: Sun Jan 19 14:20:18 2025 +0200 * src/fileio.c (Finsert_file_contents): Fix last change. diff --git a/src/fileio.c b/src/fileio.c index bf80d71ab59..9ab17497395 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4754,6 +4754,11 @@ by calling `format-decode', which see. */) /* For a special file that is not seekable, all we can do is guess. */ total = READ_BUF_SIZE; + /* From here on, treat a file with zero size as not seekable. This + causes us to read until we actually hit EOF. */ + if (regular && st.st_size == 0) + seekable = false; + if (NILP (visit) && total > 0) { if (!NILP (BVAR (current_buffer, file_truename)) commit 26c9fbc94dae34fc119828661c71242d80bb33c5 Author: Eli Zaretskii Date: Sun Jan 19 12:51:18 2025 +0200 Fix visiting files in /proc/ directory * src/fileio.c (Finsert_file_contents): Treat regular files whose size is reported as zero as if they were special files. (Bug#75569) diff --git a/src/fileio.c b/src/fileio.c index db7c491e1a1..bf80d71ab59 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4747,10 +4747,11 @@ by calling `format-decode', which see. */) goto handled; } - if (seekable || !NILP (end)) + /* Don't believe st.st_size if it is zero. */ + if ((regular && st.st_size > 0) || (!regular && seekable) || !NILP (end)) total = end_offset - beg_offset; else - /* For a special file, all we can do is guess. */ + /* For a special file that is not seekable, all we can do is guess. */ total = READ_BUF_SIZE; if (NILP (visit) && total > 0) commit 40a8d0ebf0ca6199697c95a308201e739dd9540d Author: Michael Albinus Date: Sun Jan 19 11:30:10 2025 +0100 Fix Tramp error handling process buffer * lisp/net/tramp-cache.el (tramp-list-connections): * lisp/net/tramp-cmds.el (tramp-cleanup-connection): Use connection property " connected" for a check of active connections. * lisp/net/tramp.el (tramp-get-buffer): Set connection property " connected". diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 95fff9db0b4..d432deee5d1 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -554,7 +554,7 @@ PROPERTIES is a list of file properties (strings)." (lambda (key) (and (tramp-file-name-p key) (null (tramp-file-name-localname key)) - (tramp-connection-property-p key " process-buffer") + (tramp-connection-property-p key " connected") key)) (hash-table-keys tramp-cache-data)))) diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index a469df1b872..71829e81093 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -173,7 +173,7 @@ interactively, a Tramp connection has to be selected." (get-buffer (tramp-debug-buffer-name vec))) (unless keep-debug (get-buffer (tramp-trace-buffer-name vec))) - (tramp-get-connection-property vec " process-buffer"))) + (tramp-get-connection-property vec " connected"))) (when (bufferp buf) (kill-buffer buf))) ;; Flush file cache. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 1241d321b9b..d87cecb9ec6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2002,10 +2002,11 @@ Unless DONT-CREATE, the buffer is created when it doesn't exist yet." (or (get-buffer (tramp-buffer-name vec)) (unless dont-create (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) - ;; We use the existence of connection property " process-buffer" - ;; as indication, whether a connection is active. + ;; We use the existence of connection property " connected" + ;; as indication, whether a connection is active. It keeps + ;; the connection buffer, for cleanup. (tramp-set-connection-property - vec " process-buffer" + vec " connected" (tramp-get-connection-property vec " process-buffer")) (setq buffer-undo-list t default-directory commit cce6a57af7cff36936340a6a43be73ccfcadea5f Author: Jakub Ječmínek Date: Sun Dec 22 21:53:53 2024 +0100 Align files after dired revert (Bug#17219) * lisp/dired.el (dired-revert): Add 'dired--align-all-files' function call, to re-align files after reverting. diff --git a/lisp/dired.el b/lisp/dired.el index bab5e833a76..2087a6f6f21 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2159,7 +2159,8 @@ ARG and NOCONFIRM, passed from `revert-buffer', are ignored." (if (dired-goto-subdir dir) (dired-hide-subdir 1)))) (unless modflag (restore-buffer-modified-p nil)) - (hack-dir-local-variables-non-file-buffer)) + (hack-dir-local-variables-non-file-buffer) + (dired--align-all-files)) ;; outside of the let scope ;;; Might as well not override the user if the user changed this. ;;; (setq buffer-read-only t) commit 7809086b3bd4f7e7257b42955e3e9eccefb289c3 Author: Paul Eggert Date: Sun Jan 19 00:19:50 2025 -0800 Prefer EMACS_INT_MAX to TYPE_MAXIMUM (EMACS_INT) * src/dispextern.h (GLYPH_CODE_P): Use EMACS_INT_MAX instead of TYPE_MAXIMUM (EMACS_INT), as it’s shorter and is what all the other code uses in this situation. diff --git a/src/dispextern.h b/src/dispextern.h index 1d90022a9bc..9284d3a99ee 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -2018,9 +2018,9 @@ GLYPH_CODE_P (Lisp_Object gc) && RANGED_FIXNUMP (0, XCDR (gc), MAX_FACE_ID)) : (RANGED_FIXNUMP (0, gc, - (MAX_FACE_ID < TYPE_MAXIMUM (EMACS_INT) >> CHARACTERBITS + (MAX_FACE_ID < EMACS_INT_MAX >> CHARACTERBITS ? ((EMACS_INT) MAX_FACE_ID << CHARACTERBITS) | MAX_CHAR - : TYPE_MAXIMUM (EMACS_INT))))); + : EMACS_INT_MAX)))); } /* True means face attributes have been changed since the last commit f9be225501ce1ae53ec78136679de14ff093f46d Author: Paul Eggert Date: Sun Jan 19 00:16:28 2025 -0800 Port recently-added bitfields back to GCC * src/lisp.h (hash_table_std_test_t, hash_table_weakness_t): Name these as enum tags as well as typedefs, so that ENUM_BF works for them. diff --git a/src/lisp.h b/src/lisp.h index dc365e1d46f..bc0bc682498 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2552,7 +2552,7 @@ struct Lisp_Hash_Table; It's unsigned and a subtype of EMACS_UINT. */ typedef unsigned int hash_hash_t; -typedef enum { +typedef enum hash_table_std_test_t { Test_eql, Test_eq, Test_equal, @@ -2576,7 +2576,7 @@ struct hash_table_test Lisp_Object name; }; -typedef enum { +typedef enum hash_table_weakness_t { Weak_None, /* No weak references. */ Weak_Key, /* Reference to key is weak. */ Weak_Value, /* Reference to value is weak. */ commit fb434b85167d28e6739c8fc6fa80970011b79a0d Author: Paul Eggert Date: Sat Jan 18 23:26:02 2025 -0800 Always define image_compute_scale * src/image.c (image_compute_scale): Define even if ! (defined HAVE_IMAGEMAGICK || defined HAVE_NATIVE_TRANSFORMS), because it is always used. Needed in platforms that lack all those image libraries. diff --git a/src/image.c b/src/image.c index 640e2a99904..bae7c13ac82 100644 --- a/src/image.c +++ b/src/image.c @@ -2672,6 +2672,7 @@ image_get_dimension (struct image *img, Lisp_Object symbol) } return -1; } +#endif /* Calculate the scale of the image. IMG may be null as it is only required when creating an image, and this function is called from @@ -2727,6 +2728,7 @@ image_compute_scale (struct frame *f, Lisp_Object spec, struct image *img) return scale; } +#if defined HAVE_IMAGEMAGICK || defined HAVE_NATIVE_TRANSFORMS /* Compute the desired size of an image with native size WIDTH x HEIGHT, which is to be displayed on F. Use IMG to deduce the size. Store the desired size into *D_WIDTH x *D_HEIGHT. Store -1 x -1 if the commit abf2e097b281c92a7bc2776a967893b248a68384 Author: Paul Eggert Date: Sat Jan 18 23:10:53 2025 -0800 Port recently-added bitfields to IBM XL C 16.1 * src/lisp.h (struct Lisp_Hash_Table): Use ENUM_BF for members weakness and frozen_test, since they are enum bitfields. diff --git a/src/lisp.h b/src/lisp.h index a8fe2e9f6bc..dc365e1d46f 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2662,10 +2662,10 @@ struct Lisp_Hash_Table unsigned char index_bits; /* log2 (size of the index vector). */ /* Weakness of the table. */ - hash_table_weakness_t weakness : 3; + ENUM_BF (hash_table_weakness_t) weakness : 3; /* Hash table test (only used when frozen in dump) */ - hash_table_std_test_t frozen_test : 2; + ENUM_BF (hash_table_std_test_t) frozen_test : 2; /* True if the table can be purecopied. The table cannot be changed afterwards. */ commit 866cb87185d9096b248f42c11ee03c19ed7c7598 Author: Paul Eggert Date: Sat Jan 18 22:33:25 2025 -0800 Update from Gnulib by running admin/merge-gnulib diff --git a/m4/stdalign.m4 b/m4/stdalign.m4 index bb2d1555373..885feafdd8b 100644 --- a/m4/stdalign.m4 +++ b/m4/stdalign.m4 @@ -1,5 +1,5 @@ # stdalign.m4 -# serial 1 +# serial 3 dnl Copyright 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, @@ -104,11 +104,13 @@ AC_DEFUN([gl_ALIGNASOF], /* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 . - clang versions < 8.0.0 have the same bug. */ + clang versions < 8.0.0 have the same bug. + IBM XL C V16.1.0 cc (non-clang) has the same bug. */ # if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \ && !defined __clang__) \ - || (defined __clang__ && __clang_major__ < 8)) + || (defined __clang__ && __clang_major__ < 8) \ + || defined __xlC__) # undef/**/_Alignof # ifdef __cplusplus # if (201103 <= __cplusplus || defined _MSC_VER) @@ -179,7 +181,8 @@ AC_DEFUN([gl_ALIGNASOF], # if ((defined _Alignas \ && !(defined __cplusplus \ && (201103 <= __cplusplus || defined _MSC_VER))) \ - || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__ \ + && !defined __xlC__)) # define alignas _Alignas # endif # endif commit d65f727ab401a8dfe11de7837ecee6661a113fea Author: Paul Eggert Date: Sat Jan 18 20:01:16 2025 -0800 Port to AIX 7.3 ‘find’ * configure.ac (FIND_DELETE): Port to AIX 7.3 ‘find’, which exits with nonzero status if ‘-exec rm -f {} +’ is never invoked. diff --git a/configure.ac b/configure.ac index 936afc0e7df..debdaadfc7b 100644 --- a/configure.ac +++ b/configure.ac @@ -2078,8 +2078,10 @@ AC_CACHE_CHECK([for 'find' args to delete a file], [emacs_cv_find_delete], [if touch conftest.tmp && find conftest.tmp -delete 2>/dev/null && test ! -f conftest.tmp - then emacs_cv_find_delete="-delete" - else emacs_cv_find_delete="-exec rm -f {} +" + then emacs_cv_find_delete="-delete" # GNU 'find' + elif find . -prune -name x -exec echo {} + 2>/dev/null + then emacs_cv_find_delete="-exec rm -f {} +" # POSIX 'find' + else emacs_cv_find_delete="-exec rm -f {} + -o -exec true {} +" # AIX 7.3 fi]) FIND_DELETE=$emacs_cv_find_delete AC_SUBST([FIND_DELETE]) commit 421d30773372b650a00fe250442f6db2bcc71270 Author: Paul Eggert Date: Sat Jan 18 20:01:16 2025 -0800 Simplify cross cleaning * cross/Makefile.in (clean, maintainer-clean): Prefer a single ‘find’ to doing ‘find’ in a shell loop. diff --git a/cross/Makefile.in b/cross/Makefile.in index a10d0f5421d..94a28a755bc 100644 --- a/cross/Makefile.in +++ b/cross/Makefile.in @@ -182,9 +182,7 @@ $(LIBSRC_BINARIES) &: src/verbose.mk $(top_builddir)/$@ lib/libgnu.a \ .PHONY: clean maintainer-clean distclean clean: - for dir in $(CLEAN_SUBDIRS); do \ - find $$dir -type f $(FIND_DELETE); \ - done + find $(CLEAN_SUBDIRS) -type f $(FIND_DELETE) rm -rf lib/config.h lib-src/config.h # ndk-build won't have been generated in a non-Android build. if test -f ndk-build/Makefile; then \ @@ -193,8 +191,6 @@ clean: maintainer-clean distclean bootstrap-clean: clean # Remove links created by configure. - for dir in $(CLEAN_SUBDIRS); do \ - find $$dir -type l $(FIND_DELETE); \ - done + find $(CLEAN_SUBDIRS) -type l $(FIND_DELETE) rm -rf lib/Makefile lib/gnulib.mk ndk-build/Makefile rm -rf ndk-build/ndk-build.mk Makefile commit 0f75a01acd3fe880da6884018565870ba800f30e Author: Eli Zaretskii Date: Sun Jan 19 08:23:23 2025 +0200 ; Fix cross-references in Texinfo manuals diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 6b660bdf5ba..39514145a1e 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -184,7 +184,7 @@ occurs within the body, the form simply returns @code{nil} without even evaluating its argument. The @var{modes} list allows specifying which modes the command is -meant to be used in. @xref{Command Modes} for more details about +meant to be used in. @xref{Command Modes}, for more details about the effect of specifying @var{modes}, and when to use it. By convention, you should put the @code{interactive} form in the diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 95fa77c73a3..d257bb3a462 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -1222,7 +1222,7 @@ Specify how to decide whether an inline value matches the type. The corresponding value, @var{function}, should be a function that accepts two arguments, a widget and an inline value; it should return non-@code{nil} if the value is acceptable. @xref{Splicing into -Lists} for more information about inline values. +Lists}, for more information about inline values. @item :validate @var{function} Specify a validation function for input. @var{function} takes a diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index da89a46d7bc..7470716a587 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -774,7 +774,7 @@ As a rule, the inner frame is subdivided into the frame's root window rule: A @dfn{minibuffer-less frame} contains a root window only and does not contain a minibuffer window. A @dfn{minibuffer-only frame} contains only a minibuffer window which also serves as that frame's root window. -@xref{Initial Parameters} for how to create such frame configurations. +@xref{Initial Parameters}, for how to create such frame configurations. @item Text Area @cindex text area diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 0e7fd17e7ed..91ebd6cf233 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -6020,7 +6020,7 @@ subclass, see @ref{Inheritance,Inheritance,,eieio}.). Users of the application-building interface can then instantiate objects of this concrete class (using the @code{make-instance} function) and connect to JSONRPC endpoints using that strategy. @xref{Process-based -JSONRPC connections} for a built-in transport implementation. +JSONRPC connections}, for a built-in transport implementation. This API has mandatory and optional parts. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 5fd3c6351de..d4fbcabc1f1 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -30811,7 +30811,7 @@ embedded in a @TeX{} or @LaTeX{} document its plain version will be invisible in the final printed copy. Certain major modes have different delimiters to ensure that the ``plain'' version will be in a comment for those modes, also. -@xref{Customizing Embedded Mode} to see how to change the ``plain'' +@xref{Customizing Embedded Mode}, to see how to change the ``plain'' formula delimiters. There are several notations which Calc's parser for ``big'' @@ -35323,8 +35323,8 @@ also be reset by putting the appropriate lines in your .emacs file; Some of the customizable variables are regular expressions. A regular expression is basically a pattern that Calc can search for. -@xref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual} -to see how regular expressions work. +@xref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs +Manual}, to see how regular expressions work. @defvar calc-settings-file The variable @code{calc-settings-file} holds the file name in diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 176087e20ca..f98a21743ac 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -1485,8 +1485,8 @@ Sometimes @ccmode{} inserts an auto-newline where you don't want one, such as after a @samp{@}} when you're about to type a @samp{;}. Hungry deletion can help here (@pxref{Hungry WS Deletion}), or you can activate an appropriate @dfn{clean-up}, which will remove the excess -whitespace after you've typed the @samp{;}. @xref{Clean-ups} for a -full description. See also @ref{Electric Keys} for a summary of +whitespace after you've typed the @samp{;}. @xref{Clean-ups}, for a +full description. See also @ref{Electric Keys}, for a summary of clean-ups listed by key. @@ -2420,7 +2420,7 @@ Mode and Java Mode buffers, you could do it like this: @end group @end example -@xref{CC Hooks} for more details on the use of @ccmode{} hooks. +@xref{CC Hooks}, for more details on the use of @ccmode{} hooks. @item Styles A @ccmode{} @dfn{style} is a coherent collection of customizations @@ -2438,7 +2438,7 @@ in your @file{.emacs} file: (other . "free-group-style"))) @end example -@xref{Styles} for fuller details on using @ccmode{} styles and how +@xref{Styles}, for fuller details on using @ccmode{} styles and how to create them. @item File Local Variable setting @@ -3312,7 +3312,7 @@ different ways, depending on the character just typed: an alist. This element specifies where to put newlines: this is any combination of before and after the brace or colon. If no alist element is found, newlines are inserted both before and after a brace, -but none are inserted around a colon. @xref{Hanging Braces} and +but none are inserted around a colon. @xref{Hanging Braces}, and @ref{Hanging Colons}. @item Semicolons and Commas diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index db477d90d70..8a497ebb228 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -18252,7 +18252,8 @@ inherited. This section describes a special mail back end called @code{nndiary}, and its companion library @code{gnus-diary}. It is ``special'' in the sense that it is not meant to be one of the standard alternatives for -reading mail with Gnus. @xref{Choosing a Mail Back End} for that. +reading mail with Gnus. (@xref{Choosing a Mail Back End}, for +description of the standard mail back ends.) Instead, it is used to treat @emph{some} of your mails in a special way, namely, as event reminders. diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi index d8c1534edec..5d51c2dd518 100644 --- a/doc/misc/htmlfontify.texi +++ b/doc/misc/htmlfontify.texi @@ -828,7 +828,7 @@ If @var{class} is @code{nil}, then you just get whatever @code{face-attr-construct} returns; i.e., the current specification in effect for @var{face}. -@xref{hfy-display-class} for details of valid values for @var{class}. +@xref{hfy-display-class}, for details of valid values for @var{class}. @item hfy-face-at @findex hfy-face-at diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index bc3dcf70db6..0e10e2078a4 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -2546,8 +2546,8 @@ commands: In addition to these standard @file{comint} commands, @code{idlwave-shell-mode} provides many of the same commands which simplify writing IDL code available in IDLWAVE buffers. This includes -abbreviations, online help, and completion. @xref{Routine Info} and -@ref{Online Help} and @ref{Completion} for more information on these +abbreviations, online help, and completion. @xref{Routine Info}, and +@ref{Online Help}, and @ref{Completion}, for more information on these commands. @cindex Completion, in the shell diff --git a/doc/misc/srecode.texi b/doc/misc/srecode.texi index 68c03d5ed6a..8e075da8c07 100644 --- a/doc/misc/srecode.texi +++ b/doc/misc/srecode.texi @@ -121,7 +121,7 @@ or add into a language hook function to force it on (which is the default) or pass in @code{-1} to force it off. -@xref{SRecode Minor Mode} for more on using the minor mode. +@xref{SRecode Minor Mode}, for more on using the minor mode. Use the menu to insert templates into the current file. @@ -238,7 +238,7 @@ template such as a function to be made specific, such as a function named foo. The value of a variable can be one of three things; a string, a list of more dictionaries, or a special @code{srecode-dictionary-compound-value} object subclass. -@xref{Variables} for more. +@xref{Variables}, for more about this. @section Template Insertion The template insertion layer involves extensions to the basic template @@ -590,7 +590,7 @@ the variable is an @EIEIO{} object, which is a subclass of @code{srecode-dictionary-compound-value}. New compound variables can only be setup from Lisp code. -@xref{Compound Dictionary Values} for details on setting up compound +@xref{Compound Dictionary Values}, for details on setting up compound variables from Lisp. @node Templates diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 31c7ad9c677..3fef196219d 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -854,7 +854,7 @@ as the @option{rsh} method. Instead of connecting to a remote host, @command{su} program allows editing as another user. The host can be either @samp{localhost} or the host returned by the function @command{(system-name)}. -@xref{Multi-hops} for an exception to this behavior. +@xref{Multi-hops}, for an exception to this behavior. @cindex method @option{androidsu} @cindex @option{androidsu} method @@ -907,7 +907,7 @@ This is an optional method, @pxref{Optional methods}. The @command{sg} program allows editing as different group. The host can be either @samp{localhost} or the host returned by the function @command{(system-name)}. The user name must be specified, but it -denotes a group name. @xref{Multi-hops} for an exception to this +denotes a group name. @xref{Multi-hops}, for an exception to this behavior. @cindex method @option{sshx} @@ -1566,7 +1566,7 @@ remote file name, it is ignored. Access via @option{rclone} is slow. If you have an alternative method for accessing the system storage, you should use it. -@xref{GVFS-based methods} for example, methods @option{gdrive} and +For example, see @ref{GVFS-based methods}, methods @option{gdrive} and @option{nextcloud}. @cindex method @option{sshfs} @@ -2536,7 +2536,7 @@ connection information}. If you want, for example, use This works only for connection methods which allow overriding the remote login shell, like @option{sshx} or @option{plink}. -@xref{Inline methods} and @ref{External methods} for connection methods +@xref{Inline methods}, and @ref{External methods}, for connection methods which support this. @vindex tramp-sh-extra-args @@ -5446,7 +5446,7 @@ another value for @env{TERM}, change @code{tramp-terminal-type} and this line accordingly. Alternatively, you can set the remote login shell explicitly. -@xref{Remote shell setup} for discussion of this technique, +@xref{Remote shell setup}, for discussion of this technique, When using fish shell on remote hosts, disable fancy formatting by adding the following to @file{~/.config/fish/config.fish}: commit 2a314666e4800639a81ff6562395c3d38cb97e7b Author: Eli Zaretskii Date: Sun Jan 19 08:06:48 2025 +0200 Revert "Revert "Use @xref more consistently; "See @ref" -> "@xref""" This reverts commit 59167e2de8a93341cd235d83e034c00be32403f6. TRT to use reference in Texinfo is to place some punctuation character after a reference. This is common both to @ref and to @xref. So this is what should be done to fix the changeset, not to revert it. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 9fe8b4b9e21..6b660bdf5ba 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -184,7 +184,7 @@ occurs within the body, the form simply returns @code{nil} without even evaluating its argument. The @var{modes} list allows specifying which modes the command is -meant to be used in. See @ref{Command Modes} for more details about +meant to be used in. @xref{Command Modes} for more details about the effect of specifying @var{modes}, and when to use it. By convention, you should put the @code{interactive} form in the diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 09c05fa18c6..95fa77c73a3 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -1221,7 +1221,7 @@ the value is acceptable. Specify how to decide whether an inline value matches the type. The corresponding value, @var{function}, should be a function that accepts two arguments, a widget and an inline value; it should return -non-@code{nil} if the value is acceptable. See @ref{Splicing into +non-@code{nil} if the value is acceptable. @xref{Splicing into Lists} for more information about inline values. @item :validate @var{function} diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 0effe48e9a3..e234db6fce5 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -85,8 +85,8 @@ start using it. To debug a Lisp program with Edebug, you must first @dfn{instrument} the Lisp code that you want to debug. A simple way to do this is to first move point into the definition of a function or macro and then do -@kbd{C-u C-M-x} (@code{eval-defun} with a prefix argument). See -@ref{Instrumenting}, for alternative ways to instrument code. +@kbd{C-u C-M-x} (@code{eval-defun} with a prefix argument). +@xref{Instrumenting}, for alternative ways to instrument code. Once a function is instrumented, any call to the function activates Edebug. Depending on which Edebug execution mode you have selected, @@ -1369,8 +1369,8 @@ specifications and the backquote example. @cindex preventing backtracking No argument is matched but backtracking through the gate is disabled while matching the remainder of the specifications at this level. This -is primarily used to generate more specific syntax error messages. See -@ref{Backtracking}, for more details. Also see the @code{let} example. +is primarily used to generate more specific syntax error messages. +@xref{Backtracking}, for more details. Also see the @code{let} example. @item &error @code{&error} should be followed by a string, an error message, in the diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index a0d0e489ad0..da89a46d7bc 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -774,8 +774,7 @@ As a rule, the inner frame is subdivided into the frame's root window rule: A @dfn{minibuffer-less frame} contains a root window only and does not contain a minibuffer window. A @dfn{minibuffer-only frame} contains only a minibuffer window which also serves as that frame's root window. -See @ref{Initial Parameters} for how to create such frame -configurations. +@xref{Initial Parameters} for how to create such frame configurations. @item Text Area @cindex text area diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 2b5847d2f64..7f881bae7f5 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -90,7 +90,7 @@ fundamental part of Lisp (e.g., @code{car}), or because it provides a low-level interface to operating system services, or because it needs to run fast. Unlike functions defined in Lisp, primitives can be modified or added only by changing the C sources and recompiling -Emacs. See @ref{Writing Emacs Primitives}. +Emacs. @xref{Writing Emacs Primitives}. @item special form A primitive that is like a function but does not evaluate all of its @@ -2976,56 +2976,56 @@ elsewhere, but we provide cross references here. @table @code @item apply -See @ref{Calling Functions}. +@xref{Calling Functions}. @item autoload -See @ref{Autoload}. +@xref{Autoload}. @item call-interactively -See @ref{Interactive Call}. +@xref{Interactive Call}. @item called-interactively-p -See @ref{Distinguish Interactive}. +@xref{Distinguish Interactive}. @item commandp -See @ref{Interactive Call}. +@xref{Interactive Call}. @item documentation -See @ref{Accessing Documentation}. +@xref{Accessing Documentation}. @item eval -See @ref{Eval}. +@xref{Eval}. @item funcall -See @ref{Calling Functions}. +@xref{Calling Functions}. @item function -See @ref{Anonymous Functions}. +@xref{Anonymous Functions}. @item ignore -See @ref{Calling Functions}. +@xref{Calling Functions}. @item indirect-function -See @ref{Function Indirection}. +@xref{Function Indirection}. @item interactive -See @ref{Using Interactive}. +@xref{Using Interactive}. @item interactive-p -See @ref{Distinguish Interactive}. +@xref{Distinguish Interactive}. @item mapatoms -See @ref{Creating Symbols}. +@xref{Creating Symbols}. @item mapcar -See @ref{Mapping Functions}. +@xref{Mapping Functions}. @item map-char-table -See @ref{Char-Tables}. +@xref{Char-Tables}. @item mapconcat -See @ref{Mapping Functions}. +@xref{Mapping Functions}. @item undefined -See @ref{Functions for Key Lookup}. +@xref{Functions for Key Lookup}. @end table diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 7095942d7b2..eaba29a33e3 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -1046,8 +1046,8 @@ When more than one minor mode keymap is active, the earlier one in minor modes so that they don't interfere with each other. If you do this properly, the order will not matter. -See @ref{Keymaps and Minor Modes}, for more information about minor -modes. See also @code{minor-mode-key-binding} (@pxref{Functions for Key +@xref{Keymaps and Minor Modes}, for more information about minor modes. +See also @code{minor-mode-key-binding} (@pxref{Functions for Key Lookup}). @end defvar @@ -1204,7 +1204,7 @@ and @var{command} is its binding. @xref{What Is a Function}. @cindex string in keymap The array (either a string or a vector) is a keyboard macro. The events used so far in the lookup form a complete key, and the array is its -binding. See @ref{Keyboard Macros}, for more information. +binding. @xref{Keyboard Macros}, for more information. @item @var{keymap} @cindex keymap in keymap diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index d8e7e6c2e76..ecd34b95294 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1890,7 +1890,7 @@ The function to add prefixes and suffixes to completions. @end table @noindent -See @ref{Programmed Completion}, for a complete list of metadata entries. +@xref{Programmed Completion}, for a complete list of metadata entries. @end defopt @defvar completion-extra-properties diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 31ae373f6f3..9b92093f629 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2518,8 +2518,7 @@ idleness. Here's an example: @cindex terminal input This section describes functions and variables for recording or -manipulating terminal input. See @ref{Display}, for related -functions. +manipulating terminal input. @xref{Display}, for related functions. @menu * Input Modes:: Options for how input is processed. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 2d24436d214..0e7fd17e7ed 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -6019,7 +6019,7 @@ a different underlying transport strategy (for details on how to subclass, see @ref{Inheritance,Inheritance,,eieio}.). Users of the application-building interface can then instantiate objects of this concrete class (using the @code{make-instance} function) and connect -to JSONRPC endpoints using that strategy. See @ref{Process-based +to JSONRPC endpoints using that strategy. @xref{Process-based JSONRPC connections} for a built-in transport implementation. This API has mandatory and optional parts. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 0635ab7ac05..5fd3c6351de 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -30811,7 +30811,7 @@ embedded in a @TeX{} or @LaTeX{} document its plain version will be invisible in the final printed copy. Certain major modes have different delimiters to ensure that the ``plain'' version will be in a comment for those modes, also. -See @ref{Customizing Embedded Mode} to see how to change the ``plain'' +@xref{Customizing Embedded Mode} to see how to change the ``plain'' formula delimiters. There are several notations which Calc's parser for ``big'' @@ -35323,7 +35323,7 @@ also be reset by putting the appropriate lines in your .emacs file; Some of the customizable variables are regular expressions. A regular expression is basically a pattern that Calc can search for. -See @ref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual} +@xref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual} to see how regular expressions work. @defvar calc-settings-file @@ -35341,7 +35341,7 @@ value will be @code{"~/.calc.el"}. @end defvar @defvar calc-gnuplot-name -See @ref{Graphics}.@* +@xref{Graphics}.@* The variable @code{calc-gnuplot-name} should be the name of the GNUPLOT program (a string). If you have GNUPLOT installed on your system but Calc is unable to find it, you may need to set this @@ -35352,7 +35352,7 @@ The default value of @code{calc-gnuplot-name} is @code{"gnuplot"}. @defvar calc-gnuplot-plot-command @defvarx calc-gnuplot-print-command -See @ref{Devices, ,Graphical Devices}.@* +@xref{Devices, ,Graphical Devices}.@* The variables @code{calc-gnuplot-plot-command} and @code{calc-gnuplot-print-command} represent system commands to display and print the output of GNUPLOT, respectively. These may be @@ -35367,7 +35367,7 @@ and the default value of @code{calc-gnuplot-print-command} is @end defvar @defvar calc-language-alist -See @ref{Basic Embedded Mode}.@* +@xref{Basic Embedded Mode}.@* The variable @code{calc-language-alist} controls the languages that Calc will associate with major modes. When Calc embedded mode is enabled, it will try to use the current major mode to @@ -35396,7 +35396,7 @@ The default value of @code{calc-language-alist} is @defvar calc-embedded-announce-formula @defvarx calc-embedded-announce-formula-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variable @code{calc-embedded-announce-formula} helps determine what formulas @kbd{C-x * a} will activate in a buffer. It is a regular expression, and when activating embedded formulas with @@ -35434,7 +35434,7 @@ and @code{calc-embedded-open-close-mode-alist}. @defvar calc-embedded-open-formula @defvarx calc-embedded-close-formula @defvarx calc-embedded-open-close-formula-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-formula} and @code{calc-embedded-close-formula} control the region that Calc will activate as a formula when Embedded mode is entered with @kbd{C-x * e}. @@ -35471,7 +35471,7 @@ It consists of a list of lists of the form @defvar calc-embedded-word-regexp @defvarx calc-embedded-word-regexp-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variable @code{calc-embedded-word-regexp} determines the expression that Calc will activate when Embedded mode is entered with @kbd{C-x * w}. It is a regular expressions. @@ -35490,7 +35490,7 @@ It consists of a list of lists of the form @defvar calc-embedded-open-plain @defvarx calc-embedded-close-plain @defvarx calc-embedded-open-close-plain-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-plain} and @code{calc-embedded-open-plain} are used to delimit ``plain'' formulas. Note that these are actual strings, not regular @@ -35531,7 +35531,7 @@ and @code{calc-embedded-open-close-mode-alist}. @defvar calc-embedded-open-new-formula @defvarx calc-embedded-close-new-formula @defvarx calc-embedded-open-close-new-formula-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-new-formula} and @code{calc-embedded-close-new-formula} are strings which are inserted before and after a new formula when you type @kbd{C-x * f}. @@ -35559,7 +35559,7 @@ It consists of a list of lists of the form @defvar calc-embedded-open-mode @defvarx calc-embedded-close-mode @defvarx calc-embedded-open-close-mode-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-mode} and @code{calc-embedded-close-mode} are strings which Calc will place before and after any mode annotations that it inserts. Calc never scans for @@ -35600,7 +35600,7 @@ and @code{calc-embedded-open-close-plain-alist}. @defvar calc-lu-power-reference @defvarx calc-lu-field-reference -See @ref{Logarithmic Units}.@* +@xref{Logarithmic Units}.@* The variables @code{calc-lu-power-reference} and @code{calc-lu-field-reference} are unit expressions (written as strings) which Calc will use as reference quantities for logarithmic @@ -35612,7 +35612,7 @@ and the default value of @code{calc-lu-field-reference} is @end defvar @defvar calc-note-threshold -See @ref{Musical Notes}.@* +@xref{Musical Notes}.@* The variable @code{calc-note-threshold} is a number (written as a string) which determines how close (in cents) a frequency needs to be to a note to be recognized as that note. @@ -35623,7 +35623,7 @@ The default value of @code{calc-note-threshold} is 1. @defvar calc-highlight-selections-with-faces @defvarx calc-selected-face @defvarx calc-nonselected-face -See @ref{Displaying Selections}.@* +@xref{Displaying Selections}.@* The variable @code{calc-highlight-selections-with-faces} determines how selected sub-formulas are distinguished. If @code{calc-highlight-selections-with-faces} is @code{nil}, then @@ -35671,7 +35671,7 @@ be preserved. The default value of @code{calc-undo-length} is @expr{100}. @end defvar @defvar calc-gregorian-switch -See @ref{Date Forms}.@* +@xref{Date Forms}.@* The variable @code{calc-gregorian-switch} is either a list of integers @code{(@var{YEAR} @var{MONTH} @var{DAY})} or @code{nil}. If it is @code{nil}, then Calc's date forms always represent Gregorian dates. diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index b46eb80055a..176087e20ca 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -925,7 +925,7 @@ behavior prior to version 5.32.}, set @code{c-defun-tactic} to These functions are analogous to the Emacs built-in commands @code{beginning-of-defun} and @code{end-of-defun}, except they eliminate the constraint that the top-level opening brace of the defun -must be in column zero. See @ref{Defuns,,,@emacsman{}, +must be in column zero. @xref{Defuns,,,@emacsman{}, @emacsmantitle{}}, for more information. @item @kbd{C-M-a} (AWK Mode) (@code{c-awk-beginning-of-defun}) @@ -1485,7 +1485,7 @@ Sometimes @ccmode{} inserts an auto-newline where you don't want one, such as after a @samp{@}} when you're about to type a @samp{;}. Hungry deletion can help here (@pxref{Hungry WS Deletion}), or you can activate an appropriate @dfn{clean-up}, which will remove the excess -whitespace after you've typed the @samp{;}. See @ref{Clean-ups} for a +whitespace after you've typed the @samp{;}. @xref{Clean-ups} for a full description. See also @ref{Electric Keys} for a summary of clean-ups listed by key. @@ -2420,7 +2420,7 @@ Mode and Java Mode buffers, you could do it like this: @end group @end example -See @ref{CC Hooks} for more details on the use of @ccmode{} hooks. +@xref{CC Hooks} for more details on the use of @ccmode{} hooks. @item Styles A @ccmode{} @dfn{style} is a coherent collection of customizations @@ -2438,7 +2438,7 @@ in your @file{.emacs} file: (other . "free-group-style"))) @end example -See @ref{Styles} for fuller details on using @ccmode{} styles and how +@xref{Styles} for fuller details on using @ccmode{} styles and how to create them. @item File Local Variable setting @@ -3312,7 +3312,7 @@ different ways, depending on the character just typed: an alist. This element specifies where to put newlines: this is any combination of before and after the brace or colon. If no alist element is found, newlines are inserted both before and after a brace, -but none are inserted around a colon. See @ref{Hanging Braces} and +but none are inserted around a colon. @xref{Hanging Braces} and @ref{Hanging Colons}. @item Semicolons and Commas diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 41ec75a5ed2..db477d90d70 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -18252,7 +18252,7 @@ inherited. This section describes a special mail back end called @code{nndiary}, and its companion library @code{gnus-diary}. It is ``special'' in the sense that it is not meant to be one of the standard alternatives for -reading mail with Gnus. See @ref{Choosing a Mail Back End} for that. +reading mail with Gnus. @xref{Choosing a Mail Back End} for that. Instead, it is used to treat @emph{some} of your mails in a special way, namely, as event reminders. diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi index fd9b9435123..d8c1534edec 100644 --- a/doc/misc/htmlfontify.texi +++ b/doc/misc/htmlfontify.texi @@ -141,7 +141,7 @@ and hyperlinks as appropriate. (htmlfontify-run-etags @var{srcdir}) @end lisp -Load the etags cache for @var{srcdir}. See @ref{hfy-load-tags-cache}. +Load the etags cache for @var{srcdir}. @xref{hfy-load-tags-cache}. @item htmlfontify-copy-and-link-dir @findex htmlfontify-copy-and-link-dir @@ -828,7 +828,7 @@ If @var{class} is @code{nil}, then you just get whatever @code{face-attr-construct} returns; i.e., the current specification in effect for @var{face}. -See @ref{hfy-display-class} for details of valid values for @var{class}. +@xref{hfy-display-class} for details of valid values for @var{class}. @item hfy-face-at @findex hfy-face-at @@ -1069,7 +1069,7 @@ Each tag hash entry then contains entries of the form: i.e., an alist mapping (relative) file paths to line and character offsets. -See @ref{hfy-load-tags-cache}. +@xref{hfy-load-tags-cache}. @item hfy-tags-rmap @vindex hfy-tags-rmap diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 0db01faf3d1..bc3dcf70db6 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -2546,7 +2546,7 @@ commands: In addition to these standard @file{comint} commands, @code{idlwave-shell-mode} provides many of the same commands which simplify writing IDL code available in IDLWAVE buffers. This includes -abbreviations, online help, and completion. See @ref{Routine Info} and +abbreviations, online help, and completion. @xref{Routine Info} and @ref{Online Help} and @ref{Completion} for more information on these commands. diff --git a/doc/misc/srecode.texi b/doc/misc/srecode.texi index e8c0958c252..68c03d5ed6a 100644 --- a/doc/misc/srecode.texi +++ b/doc/misc/srecode.texi @@ -121,7 +121,7 @@ or add into a language hook function to force it on (which is the default) or pass in @code{-1} to force it off. -See @ref{SRecode Minor Mode} for more on using the minor mode. +@xref{SRecode Minor Mode} for more on using the minor mode. Use the menu to insert templates into the current file. @@ -169,7 +169,7 @@ Each template file you write is dedicated to a single major mode. In it, you can write templates within the same context and with the same name as core templates. You can force your templates to override the core templates for a particular major mode by setting the -priority. See @ref{Special Variables}. +priority. @xref{Special Variables}. To get going quickly, open a new @file{.srt} file. It will start in the @srecode{} template writing mode. Use the @srecode{} minor mode @@ -237,8 +237,8 @@ used in macros in a template. Variables are what allows a generic template such as a function to be made specific, such as a function named foo. The value of a variable can be one of three things; a string, a list of more dictionaries, or a special -@code{srecode-dictionary-compound-value} object subclass. See -@ref{Variables} for more. +@code{srecode-dictionary-compound-value} object subclass. +@xref{Variables} for more. @section Template Insertion The template insertion layer involves extensions to the basic template @@ -589,8 +589,8 @@ A variable can also have a compound value. This means the value of the variable is an @EIEIO{} object, which is a subclass of @code{srecode-dictionary-compound-value}. -New compound variables can only be setup from Lisp code. See -@ref{Compound Dictionary Values} for details on setting up compound +New compound variables can only be setup from Lisp code. +@xref{Compound Dictionary Values} for details on setting up compound variables from Lisp. @node Templates @@ -707,7 +707,7 @@ major mode. Template macros occur in the template text. The default escape characters are ``@{@{`` and ``@}@}'', though they can be changed -in the top-level variables. See @ref{Variables}. +in the top-level variables. @xref{Variables}. Thus, if you have the template code that looks like this: diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 45ecf18b06e..31c7ad9c677 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -853,8 +853,8 @@ as the @option{rsh} method. Instead of connecting to a remote host, @command{su} program allows editing as another user. The host can be either @samp{localhost} or -the host returned by the function @command{(system-name)}. See -@ref{Multi-hops} for an exception to this behavior. +the host returned by the function @command{(system-name)}. +@xref{Multi-hops} for an exception to this behavior. @cindex method @option{androidsu} @cindex @option{androidsu} method @@ -907,7 +907,7 @@ This is an optional method, @pxref{Optional methods}. The @command{sg} program allows editing as different group. The host can be either @samp{localhost} or the host returned by the function @command{(system-name)}. The user name must be specified, but it -denotes a group name. See @ref{Multi-hops} for an exception to this +denotes a group name. @xref{Multi-hops} for an exception to this behavior. @cindex method @option{sshx} @@ -1566,7 +1566,7 @@ remote file name, it is ignored. Access via @option{rclone} is slow. If you have an alternative method for accessing the system storage, you should use it. -@ref{GVFS-based methods} for example, methods @option{gdrive} and +@xref{GVFS-based methods} for example, methods @option{gdrive} and @option{nextcloud}. @cindex method @option{sshfs} @@ -2390,7 +2390,7 @@ to a remote home directory, like @option{adb}, @option{rclone} and The temporary directory on the remote host. If not specified, the default value is @t{"/data/local/tmp"} for the @option{adb} method, @t{"/C$/Temp"} for the @option{smb} method, and @t{"/tmp"} otherwise. -@ref{Temporary directory}. +@xref{Temporary directory}. @item @t{"posix"} @@ -2535,8 +2535,8 @@ connection information}. If you want, for example, use @end lisp This works only for connection methods which allow overriding the -remote login shell, like @option{sshx} or @option{plink}. See -@ref{Inline methods} and @ref{External methods} for connection methods +remote login shell, like @option{sshx} or @option{plink}. +@xref{Inline methods} and @ref{External methods} for connection methods which support this. @vindex tramp-sh-extra-args @@ -5445,8 +5445,8 @@ as value of the @env{TERM} environment variable. If you want to use another value for @env{TERM}, change @code{tramp-terminal-type} and this line accordingly. -Alternatively, you can set the remote login shell explicitly. See -@ref{Remote shell setup} for discussion of this technique, +Alternatively, you can set the remote login shell explicitly. +@xref{Remote shell setup} for discussion of this technique, When using fish shell on remote hosts, disable fancy formatting by adding the following to @file{~/.config/fish/config.fish}: diff --git a/doc/misc/transient.texi b/doc/misc/transient.texi index 2f2e4cf7edd..fb8b6da145c 100644 --- a/doc/misc/transient.texi +++ b/doc/misc/transient.texi @@ -789,7 +789,7 @@ used to draw the line. This user option may be overridden if @code{:mode-line-format} is passed when creating a new prefix with @code{transient-define-prefix}. -Otherwise this can be any mode-line format. See @ref{Mode Line Format,,,elisp,}, for details. +Otherwise this can be any mode-line format. @xref{Mode Line Format,,,elisp,}, for details. @end defopt @defopt transient-semantic-coloring @@ -1089,14 +1089,14 @@ enabled. One benefit of the Transient interface is that it remembers history not only on a global level (``this command was invoked using these arguments, and previously it was invoked using those other arguments''), but also remembers the values of individual arguments -independently. See @ref{Using History}. +independently. @xref{Using History}. After a transient prefix command is invoked, @kbd{C-h @var{KEY}} can be used to show the documentation for the infix or suffix command that @kbd{@var{KEY}} is bound to (see @ref{Getting Help for Suffix Commands}), and infixes and suffixes can be removed from the transient using @kbd{C-x l @var{KEY}}. Infixes and suffixes that are disabled by default can be enabled the same way. -See @ref{Enabling and Disabling Suffixes}. +@xref{Enabling and Disabling Suffixes}. Transient ships with support for a few different types of specialized infix commands. A command that sets a command line option, for example, @@ -1444,7 +1444,7 @@ guessed based on the long argument. If the argument ends with @samp{=} Finally, details can be specified using optional @var{KEYWORD}-@var{VALUE} pairs. Each keyword has to be a keyword symbol, either @code{:class} or a keyword -argument supported by the constructor of that class. See @ref{Suffix Slots}. +argument supported by the constructor of that class. @xref{Suffix Slots}. @node Defining Suffix and Infix Commands @section Defining Suffix and Infix Commands @@ -1726,8 +1726,8 @@ means that all outer prefixes are exited at once. @item The behavior for non-suffixes can be set for a particular prefix, by the prefix's @code{transient-non-suffix} slot to a boolean, a suitable -pre-command function, or a shorthand for such a function. See -@ref{Pre-commands for Non-Suffixes}. +pre-command function, or a shorthand for such a function. +@xref{Pre-commands for Non-Suffixes}. @item The common behavior for the suffixes of a particular prefix can be @@ -2424,7 +2424,7 @@ secondary value, called a ``scope''. See @code{transient-define-prefix}. @code{transient-suffix}, @code{transient-non-suffix} and @code{transient-switch-frame} play a part when determining whether the currently active transient prefix command remains active/transient when a suffix or arbitrary -non-suffix command is invoked. See @ref{Transient State}. +non-suffix command is invoked. @xref{Transient State}. @item @code{refresh-suffixes} Normally suffix objects and keymaps are only setup @@ -2760,7 +2760,7 @@ currently cannot be invoked. By default these predicates run when the prefix command is invoked, but this can be changes, using the @code{refresh-suffixes} prefix slot. -See @ref{Prefix Slots}. +@xref{Prefix Slots}. One more slot is shared between group and suffix classes, @code{level}. Like the slots documented above, it is a predicate, but it is used for a diff --git a/doc/misc/wisent.texi b/doc/misc/wisent.texi index a92f61fd6c7..6c700779ba7 100644 --- a/doc/misc/wisent.texi +++ b/doc/misc/wisent.texi @@ -446,8 +446,8 @@ matching the empty string, for which the default action is to return @section Example @cindex grammar example -Here is an example to parse simple infix arithmetic expressions. See -@ref{Infix Calc, , , bison}, in the Bison manual for details. +Here is an example to parse simple infix arithmetic expressions. +@xref{Infix Calc, , , bison}, in the Bison manual for details. @lisp @group @@ -570,7 +570,7 @@ must be @dfn{LALR(1)}. @cindex look-ahead token A grammar is @acronym{LALR(1)} if it is possible to tell how to parse any portion of an input string with just a single token of look-ahead: -the @dfn{look-ahead token}. See @ref{Language and Grammar, , , +the @dfn{look-ahead token}. @xref{Language and Grammar, , , bison}, in the Bison manual for more information. @cindex grammar compilation @@ -643,7 +643,7 @@ When either a shift or a reduction would be valid at the same state. Such conflicts are resolved by choosing to shift, unless otherwise directed by operator precedence declarations. -See @ref{Shift/Reduce , , , bison}, in the Bison manual for more +@xref{Shift/Reduce , , , bison}, in the Bison manual for more information. @cindex reduce/reduce conflicts @@ -654,8 +654,8 @@ grammar. Such conflicts are resolved by choosing to use the rule that appears first in the grammar, but it is very risky to rely on this. Every -reduce/reduce conflict must be studied and usually eliminated. See -@ref{Reduce/Reduce , , , bison}, in the Bison manual for more +reduce/reduce conflict must be studied and usually eliminated. +@xref{Reduce/Reduce , , , bison}, in the Bison manual for more information. @end table @@ -701,7 +701,7 @@ reports are separated from each other by a line like this: @end example where @var{source-file} is the name of the Emacs Lisp file from which -the grammar was read. See @ref{Understanding the automaton}, for +the grammar was read. @xref{Understanding the automaton}, for details on the verbose report. @table @strong @@ -1312,7 +1312,7 @@ value of the variable @code{wisent-recovering} is non-@code{nil}. @cindex error recovery The error recovery mechanism of the Wisent's parser conforms to the -one Bison uses. See @ref{Error Recovery, , , bison}, in the Bison +one Bison uses. @xref{Error Recovery, , , bison}, in the Bison manual for details. @cindex error token commit 20c282ae331a5b71d7bae258ccdaa1e54490c3ef Author: Stefan Kangas Date: Sun Jan 19 04:25:52 2025 +0100 Prefer 'list (...)' to 'listn (N, ...)' * src/androidfns.c (Fandroid_query_battery): * src/buffer.c (make_lispy_itree_node): * src/keyboard.c (init_while_no_input_ignore_events): * src/window.c (Fset_window_configuration): * src/xterm.c (x_dnd_send_unsupported_drop): Prefer 'list (...)' to 'listn (N, ...)'. * admin/coccinelle/listn.cocci: New file. diff --git a/admin/coccinelle/listn.cocci b/admin/coccinelle/listn.cocci new file mode 100644 index 00000000000..df1d6dafdf2 --- /dev/null +++ b/admin/coccinelle/listn.cocci @@ -0,0 +1,7 @@ +// Prefer 'list (...)' to 'listn (N, ...)' +@@ +constant n; +@@ +- listn (n, ++ list ( + ...) diff --git a/src/androidfns.c b/src/androidfns.c index 9eb313faaf6..ac0f4882f60 100644 --- a/src/androidfns.c +++ b/src/androidfns.c @@ -3219,14 +3219,14 @@ for more details about these values. */) if (android_query_battery (&state)) return Qnil; - return listn (8, make_int (state.capacity), - make_fixnum (state.charge_counter), - make_int (state.current_average), - make_int (state.current_now), - make_fixnum (state.status), - make_int (state.remaining), - make_fixnum (state.plugged), - make_fixnum (state.temperature)); + return list (make_int (state.capacity), + make_fixnum (state.charge_counter), + make_int (state.current_average), + make_int (state.current_now), + make_fixnum (state.status), + make_int (state.remaining), + make_fixnum (state.plugged), + make_fixnum (state.temperature)); } diff --git a/src/buffer.c b/src/buffer.c index 224d56e33dd..158ebbe0c30 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5024,19 +5024,18 @@ defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, static Lisp_Object make_lispy_itree_node (const struct itree_node *node) { - return listn (12, - intern (":begin"), - make_fixnum (node->begin), - intern (":end"), - make_fixnum (node->end), - intern (":limit"), - make_fixnum (node->limit), - intern (":offset"), - make_fixnum (node->offset), - intern (":rear-advance"), - node->rear_advance ? Qt : Qnil, - intern (":front-advance"), - node->front_advance ? Qt : Qnil); + return list (intern (":begin"), + make_fixnum (node->begin), + intern (":end"), + make_fixnum (node->end), + intern (":limit"), + make_fixnum (node->limit), + intern (":offset"), + make_fixnum (node->offset), + intern (":rear-advance"), + node->rear_advance ? Qt : Qnil, + intern (":front-advance"), + node->front_advance ? Qt : Qnil); } static Lisp_Object diff --git a/src/keyboard.c b/src/keyboard.c index fa19c9f8ad3..621e6c1cafb 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -12789,10 +12789,10 @@ static const struct event_head head_table[] = { static Lisp_Object init_while_no_input_ignore_events (void) { - Lisp_Object events = listn (9, Qselect_window, Qhelp_echo, Qmove_frame, - Qiconify_frame, Qmake_frame_visible, - Qfocus_in, Qfocus_out, Qconfig_changed_event, - Qselection_request); + Lisp_Object events = list (Qselect_window, Qhelp_echo, Qmove_frame, + Qiconify_frame, Qmake_frame_visible, + Qfocus_in, Qfocus_out, Qconfig_changed_event, + Qselection_request); #ifdef HAVE_DBUS events = Fcons (Qdbus_event, events); diff --git a/src/window.c b/src/window.c index d7e6cd00c99..38f5307cb68 100644 --- a/src/window.c +++ b/src/window.c @@ -7664,10 +7664,10 @@ the return value is nil. Otherwise the value is t. */) w->start_at_line_beg = true; if (FUNCTIONP (window_restore_killed_buffer_windows) && !MINI_WINDOW_P (w)) - kept_windows = Fcons (listn (6, window, p->buffer, - Fmarker_last_position (p->start), - Fmarker_last_position (p->pointm), - p->dedicated, Qt), + kept_windows = Fcons (list (window, p->buffer, + Fmarker_last_position (p->start), + Fmarker_last_position (p->pointm), + p->dedicated, Qt), kept_windows); } else if (!NILP (w->start)) @@ -7689,10 +7689,10 @@ the return value is nil. Otherwise the value is t. */) { if (FUNCTIONP (window_restore_killed_buffer_windows)) kept_windows - = Fcons (listn (6, window, p->buffer, - Fmarker_last_position (p->start), - Fmarker_last_position (p->pointm), - p->dedicated, Qnil), + = Fcons (list (window, p->buffer, + Fmarker_last_position (p->start), + Fmarker_last_position (p->pointm), + p->dedicated, Qnil), kept_windows); else if (EQ (window_restore_killed_buffer_windows, Qdelete) || (!NILP (p->dedicated) diff --git a/src/xterm.c b/src/xterm.c index 0692abbbb0b..43788af59d0 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4121,10 +4121,10 @@ x_dnd_send_unsupported_drop (struct x_display_info *dpyinfo, Window target_windo x_dnd_unsupported_drop_time = before; x_dnd_unsupported_drop_window = target_window; x_dnd_unsupported_drop_data - = listn (5, assq_no_quit (QXdndSelection, - dpyinfo->terminal->Vselection_alist), - targets, arg, make_fixnum (root_x), - make_fixnum (root_y)); + = list (assq_no_quit (QXdndSelection, + dpyinfo->terminal->Vselection_alist), + targets, arg, make_fixnum (root_x), + make_fixnum (root_y)); x_dnd_waiting_for_finish = true; x_dnd_finish_display = dpyinfo->display; commit d5f99f4431551865ff547ff2ecb7f10844ce881a Author: Pip Cet Date: Sun Jan 19 03:27:34 2025 +0000 Fix a GTK memory leak (Bug#75636) * src/gtkutil.c (xg_create_frame_widgets): Don't call g_object_ref. diff --git a/src/gtkutil.c b/src/gtkutil.c index 0e9dd4dfe11..54d2bc63077 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1735,7 +1735,6 @@ xg_create_frame_widgets (struct frame *f) g_signal_connect (wtop, "query-tooltip", G_CALLBACK (qttip_cb), f); imc = gtk_im_multicontext_new (); - g_object_ref (imc); gtk_im_context_set_use_preedit (imc, TRUE); g_signal_connect (G_OBJECT (imc), "commit", commit 59167e2de8a93341cd235d83e034c00be32403f6 Author: Po Lu Date: Sun Jan 19 08:58:45 2025 +0800 Revert "Use @xref more consistently; "See @ref" -> "@xref"" This reverts commit e54b94c28cdf9699009e7691f7c8ffa5b2c7b741, which prevented building Emacs on a number of my machine(s). diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 6b660bdf5ba..9fe8b4b9e21 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -184,7 +184,7 @@ occurs within the body, the form simply returns @code{nil} without even evaluating its argument. The @var{modes} list allows specifying which modes the command is -meant to be used in. @xref{Command Modes} for more details about +meant to be used in. See @ref{Command Modes} for more details about the effect of specifying @var{modes}, and when to use it. By convention, you should put the @code{interactive} form in the diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 95fa77c73a3..09c05fa18c6 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -1221,7 +1221,7 @@ the value is acceptable. Specify how to decide whether an inline value matches the type. The corresponding value, @var{function}, should be a function that accepts two arguments, a widget and an inline value; it should return -non-@code{nil} if the value is acceptable. @xref{Splicing into +non-@code{nil} if the value is acceptable. See @ref{Splicing into Lists} for more information about inline values. @item :validate @var{function} diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index e234db6fce5..0effe48e9a3 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -85,8 +85,8 @@ start using it. To debug a Lisp program with Edebug, you must first @dfn{instrument} the Lisp code that you want to debug. A simple way to do this is to first move point into the definition of a function or macro and then do -@kbd{C-u C-M-x} (@code{eval-defun} with a prefix argument). -@xref{Instrumenting}, for alternative ways to instrument code. +@kbd{C-u C-M-x} (@code{eval-defun} with a prefix argument). See +@ref{Instrumenting}, for alternative ways to instrument code. Once a function is instrumented, any call to the function activates Edebug. Depending on which Edebug execution mode you have selected, @@ -1369,8 +1369,8 @@ specifications and the backquote example. @cindex preventing backtracking No argument is matched but backtracking through the gate is disabled while matching the remainder of the specifications at this level. This -is primarily used to generate more specific syntax error messages. -@xref{Backtracking}, for more details. Also see the @code{let} example. +is primarily used to generate more specific syntax error messages. See +@ref{Backtracking}, for more details. Also see the @code{let} example. @item &error @code{&error} should be followed by a string, an error message, in the diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index da89a46d7bc..a0d0e489ad0 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -774,7 +774,8 @@ As a rule, the inner frame is subdivided into the frame's root window rule: A @dfn{minibuffer-less frame} contains a root window only and does not contain a minibuffer window. A @dfn{minibuffer-only frame} contains only a minibuffer window which also serves as that frame's root window. -@xref{Initial Parameters} for how to create such frame configurations. +See @ref{Initial Parameters} for how to create such frame +configurations. @item Text Area @cindex text area diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 7f881bae7f5..2b5847d2f64 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -90,7 +90,7 @@ fundamental part of Lisp (e.g., @code{car}), or because it provides a low-level interface to operating system services, or because it needs to run fast. Unlike functions defined in Lisp, primitives can be modified or added only by changing the C sources and recompiling -Emacs. @xref{Writing Emacs Primitives}. +Emacs. See @ref{Writing Emacs Primitives}. @item special form A primitive that is like a function but does not evaluate all of its @@ -2976,56 +2976,56 @@ elsewhere, but we provide cross references here. @table @code @item apply -@xref{Calling Functions}. +See @ref{Calling Functions}. @item autoload -@xref{Autoload}. +See @ref{Autoload}. @item call-interactively -@xref{Interactive Call}. +See @ref{Interactive Call}. @item called-interactively-p -@xref{Distinguish Interactive}. +See @ref{Distinguish Interactive}. @item commandp -@xref{Interactive Call}. +See @ref{Interactive Call}. @item documentation -@xref{Accessing Documentation}. +See @ref{Accessing Documentation}. @item eval -@xref{Eval}. +See @ref{Eval}. @item funcall -@xref{Calling Functions}. +See @ref{Calling Functions}. @item function -@xref{Anonymous Functions}. +See @ref{Anonymous Functions}. @item ignore -@xref{Calling Functions}. +See @ref{Calling Functions}. @item indirect-function -@xref{Function Indirection}. +See @ref{Function Indirection}. @item interactive -@xref{Using Interactive}. +See @ref{Using Interactive}. @item interactive-p -@xref{Distinguish Interactive}. +See @ref{Distinguish Interactive}. @item mapatoms -@xref{Creating Symbols}. +See @ref{Creating Symbols}. @item mapcar -@xref{Mapping Functions}. +See @ref{Mapping Functions}. @item map-char-table -@xref{Char-Tables}. +See @ref{Char-Tables}. @item mapconcat -@xref{Mapping Functions}. +See @ref{Mapping Functions}. @item undefined -@xref{Functions for Key Lookup}. +See @ref{Functions for Key Lookup}. @end table diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index eaba29a33e3..7095942d7b2 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -1046,8 +1046,8 @@ When more than one minor mode keymap is active, the earlier one in minor modes so that they don't interfere with each other. If you do this properly, the order will not matter. -@xref{Keymaps and Minor Modes}, for more information about minor modes. -See also @code{minor-mode-key-binding} (@pxref{Functions for Key +See @ref{Keymaps and Minor Modes}, for more information about minor +modes. See also @code{minor-mode-key-binding} (@pxref{Functions for Key Lookup}). @end defvar @@ -1204,7 +1204,7 @@ and @var{command} is its binding. @xref{What Is a Function}. @cindex string in keymap The array (either a string or a vector) is a keyboard macro. The events used so far in the lookup form a complete key, and the array is its -binding. @xref{Keyboard Macros}, for more information. +binding. See @ref{Keyboard Macros}, for more information. @item @var{keymap} @cindex keymap in keymap diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index ecd34b95294..d8e7e6c2e76 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1890,7 +1890,7 @@ The function to add prefixes and suffixes to completions. @end table @noindent -@xref{Programmed Completion}, for a complete list of metadata entries. +See @ref{Programmed Completion}, for a complete list of metadata entries. @end defopt @defvar completion-extra-properties diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 9b92093f629..31ae373f6f3 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2518,7 +2518,8 @@ idleness. Here's an example: @cindex terminal input This section describes functions and variables for recording or -manipulating terminal input. @xref{Display}, for related functions. +manipulating terminal input. See @ref{Display}, for related +functions. @menu * Input Modes:: Options for how input is processed. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 0e7fd17e7ed..2d24436d214 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -6019,7 +6019,7 @@ a different underlying transport strategy (for details on how to subclass, see @ref{Inheritance,Inheritance,,eieio}.). Users of the application-building interface can then instantiate objects of this concrete class (using the @code{make-instance} function) and connect -to JSONRPC endpoints using that strategy. @xref{Process-based +to JSONRPC endpoints using that strategy. See @ref{Process-based JSONRPC connections} for a built-in transport implementation. This API has mandatory and optional parts. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 5fd3c6351de..0635ab7ac05 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -30811,7 +30811,7 @@ embedded in a @TeX{} or @LaTeX{} document its plain version will be invisible in the final printed copy. Certain major modes have different delimiters to ensure that the ``plain'' version will be in a comment for those modes, also. -@xref{Customizing Embedded Mode} to see how to change the ``plain'' +See @ref{Customizing Embedded Mode} to see how to change the ``plain'' formula delimiters. There are several notations which Calc's parser for ``big'' @@ -35323,7 +35323,7 @@ also be reset by putting the appropriate lines in your .emacs file; Some of the customizable variables are regular expressions. A regular expression is basically a pattern that Calc can search for. -@xref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual} +See @ref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual} to see how regular expressions work. @defvar calc-settings-file @@ -35341,7 +35341,7 @@ value will be @code{"~/.calc.el"}. @end defvar @defvar calc-gnuplot-name -@xref{Graphics}.@* +See @ref{Graphics}.@* The variable @code{calc-gnuplot-name} should be the name of the GNUPLOT program (a string). If you have GNUPLOT installed on your system but Calc is unable to find it, you may need to set this @@ -35352,7 +35352,7 @@ The default value of @code{calc-gnuplot-name} is @code{"gnuplot"}. @defvar calc-gnuplot-plot-command @defvarx calc-gnuplot-print-command -@xref{Devices, ,Graphical Devices}.@* +See @ref{Devices, ,Graphical Devices}.@* The variables @code{calc-gnuplot-plot-command} and @code{calc-gnuplot-print-command} represent system commands to display and print the output of GNUPLOT, respectively. These may be @@ -35367,7 +35367,7 @@ and the default value of @code{calc-gnuplot-print-command} is @end defvar @defvar calc-language-alist -@xref{Basic Embedded Mode}.@* +See @ref{Basic Embedded Mode}.@* The variable @code{calc-language-alist} controls the languages that Calc will associate with major modes. When Calc embedded mode is enabled, it will try to use the current major mode to @@ -35396,7 +35396,7 @@ The default value of @code{calc-language-alist} is @defvar calc-embedded-announce-formula @defvarx calc-embedded-announce-formula-alist -@xref{Customizing Embedded Mode}.@* +See @ref{Customizing Embedded Mode}.@* The variable @code{calc-embedded-announce-formula} helps determine what formulas @kbd{C-x * a} will activate in a buffer. It is a regular expression, and when activating embedded formulas with @@ -35434,7 +35434,7 @@ and @code{calc-embedded-open-close-mode-alist}. @defvar calc-embedded-open-formula @defvarx calc-embedded-close-formula @defvarx calc-embedded-open-close-formula-alist -@xref{Customizing Embedded Mode}.@* +See @ref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-formula} and @code{calc-embedded-close-formula} control the region that Calc will activate as a formula when Embedded mode is entered with @kbd{C-x * e}. @@ -35471,7 +35471,7 @@ It consists of a list of lists of the form @defvar calc-embedded-word-regexp @defvarx calc-embedded-word-regexp-alist -@xref{Customizing Embedded Mode}.@* +See @ref{Customizing Embedded Mode}.@* The variable @code{calc-embedded-word-regexp} determines the expression that Calc will activate when Embedded mode is entered with @kbd{C-x * w}. It is a regular expressions. @@ -35490,7 +35490,7 @@ It consists of a list of lists of the form @defvar calc-embedded-open-plain @defvarx calc-embedded-close-plain @defvarx calc-embedded-open-close-plain-alist -@xref{Customizing Embedded Mode}.@* +See @ref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-plain} and @code{calc-embedded-open-plain} are used to delimit ``plain'' formulas. Note that these are actual strings, not regular @@ -35531,7 +35531,7 @@ and @code{calc-embedded-open-close-mode-alist}. @defvar calc-embedded-open-new-formula @defvarx calc-embedded-close-new-formula @defvarx calc-embedded-open-close-new-formula-alist -@xref{Customizing Embedded Mode}.@* +See @ref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-new-formula} and @code{calc-embedded-close-new-formula} are strings which are inserted before and after a new formula when you type @kbd{C-x * f}. @@ -35559,7 +35559,7 @@ It consists of a list of lists of the form @defvar calc-embedded-open-mode @defvarx calc-embedded-close-mode @defvarx calc-embedded-open-close-mode-alist -@xref{Customizing Embedded Mode}.@* +See @ref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-mode} and @code{calc-embedded-close-mode} are strings which Calc will place before and after any mode annotations that it inserts. Calc never scans for @@ -35600,7 +35600,7 @@ and @code{calc-embedded-open-close-plain-alist}. @defvar calc-lu-power-reference @defvarx calc-lu-field-reference -@xref{Logarithmic Units}.@* +See @ref{Logarithmic Units}.@* The variables @code{calc-lu-power-reference} and @code{calc-lu-field-reference} are unit expressions (written as strings) which Calc will use as reference quantities for logarithmic @@ -35612,7 +35612,7 @@ and the default value of @code{calc-lu-field-reference} is @end defvar @defvar calc-note-threshold -@xref{Musical Notes}.@* +See @ref{Musical Notes}.@* The variable @code{calc-note-threshold} is a number (written as a string) which determines how close (in cents) a frequency needs to be to a note to be recognized as that note. @@ -35623,7 +35623,7 @@ The default value of @code{calc-note-threshold} is 1. @defvar calc-highlight-selections-with-faces @defvarx calc-selected-face @defvarx calc-nonselected-face -@xref{Displaying Selections}.@* +See @ref{Displaying Selections}.@* The variable @code{calc-highlight-selections-with-faces} determines how selected sub-formulas are distinguished. If @code{calc-highlight-selections-with-faces} is @code{nil}, then @@ -35671,7 +35671,7 @@ be preserved. The default value of @code{calc-undo-length} is @expr{100}. @end defvar @defvar calc-gregorian-switch -@xref{Date Forms}.@* +See @ref{Date Forms}.@* The variable @code{calc-gregorian-switch} is either a list of integers @code{(@var{YEAR} @var{MONTH} @var{DAY})} or @code{nil}. If it is @code{nil}, then Calc's date forms always represent Gregorian dates. diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 176087e20ca..b46eb80055a 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -925,7 +925,7 @@ behavior prior to version 5.32.}, set @code{c-defun-tactic} to These functions are analogous to the Emacs built-in commands @code{beginning-of-defun} and @code{end-of-defun}, except they eliminate the constraint that the top-level opening brace of the defun -must be in column zero. @xref{Defuns,,,@emacsman{}, +must be in column zero. See @ref{Defuns,,,@emacsman{}, @emacsmantitle{}}, for more information. @item @kbd{C-M-a} (AWK Mode) (@code{c-awk-beginning-of-defun}) @@ -1485,7 +1485,7 @@ Sometimes @ccmode{} inserts an auto-newline where you don't want one, such as after a @samp{@}} when you're about to type a @samp{;}. Hungry deletion can help here (@pxref{Hungry WS Deletion}), or you can activate an appropriate @dfn{clean-up}, which will remove the excess -whitespace after you've typed the @samp{;}. @xref{Clean-ups} for a +whitespace after you've typed the @samp{;}. See @ref{Clean-ups} for a full description. See also @ref{Electric Keys} for a summary of clean-ups listed by key. @@ -2420,7 +2420,7 @@ Mode and Java Mode buffers, you could do it like this: @end group @end example -@xref{CC Hooks} for more details on the use of @ccmode{} hooks. +See @ref{CC Hooks} for more details on the use of @ccmode{} hooks. @item Styles A @ccmode{} @dfn{style} is a coherent collection of customizations @@ -2438,7 +2438,7 @@ in your @file{.emacs} file: (other . "free-group-style"))) @end example -@xref{Styles} for fuller details on using @ccmode{} styles and how +See @ref{Styles} for fuller details on using @ccmode{} styles and how to create them. @item File Local Variable setting @@ -3312,7 +3312,7 @@ different ways, depending on the character just typed: an alist. This element specifies where to put newlines: this is any combination of before and after the brace or colon. If no alist element is found, newlines are inserted both before and after a brace, -but none are inserted around a colon. @xref{Hanging Braces} and +but none are inserted around a colon. See @ref{Hanging Braces} and @ref{Hanging Colons}. @item Semicolons and Commas diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index db477d90d70..41ec75a5ed2 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -18252,7 +18252,7 @@ inherited. This section describes a special mail back end called @code{nndiary}, and its companion library @code{gnus-diary}. It is ``special'' in the sense that it is not meant to be one of the standard alternatives for -reading mail with Gnus. @xref{Choosing a Mail Back End} for that. +reading mail with Gnus. See @ref{Choosing a Mail Back End} for that. Instead, it is used to treat @emph{some} of your mails in a special way, namely, as event reminders. diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi index d8c1534edec..fd9b9435123 100644 --- a/doc/misc/htmlfontify.texi +++ b/doc/misc/htmlfontify.texi @@ -141,7 +141,7 @@ and hyperlinks as appropriate. (htmlfontify-run-etags @var{srcdir}) @end lisp -Load the etags cache for @var{srcdir}. @xref{hfy-load-tags-cache}. +Load the etags cache for @var{srcdir}. See @ref{hfy-load-tags-cache}. @item htmlfontify-copy-and-link-dir @findex htmlfontify-copy-and-link-dir @@ -828,7 +828,7 @@ If @var{class} is @code{nil}, then you just get whatever @code{face-attr-construct} returns; i.e., the current specification in effect for @var{face}. -@xref{hfy-display-class} for details of valid values for @var{class}. +See @ref{hfy-display-class} for details of valid values for @var{class}. @item hfy-face-at @findex hfy-face-at @@ -1069,7 +1069,7 @@ Each tag hash entry then contains entries of the form: i.e., an alist mapping (relative) file paths to line and character offsets. -@xref{hfy-load-tags-cache}. +See @ref{hfy-load-tags-cache}. @item hfy-tags-rmap @vindex hfy-tags-rmap diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index bc3dcf70db6..0db01faf3d1 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -2546,7 +2546,7 @@ commands: In addition to these standard @file{comint} commands, @code{idlwave-shell-mode} provides many of the same commands which simplify writing IDL code available in IDLWAVE buffers. This includes -abbreviations, online help, and completion. @xref{Routine Info} and +abbreviations, online help, and completion. See @ref{Routine Info} and @ref{Online Help} and @ref{Completion} for more information on these commands. diff --git a/doc/misc/srecode.texi b/doc/misc/srecode.texi index 68c03d5ed6a..e8c0958c252 100644 --- a/doc/misc/srecode.texi +++ b/doc/misc/srecode.texi @@ -121,7 +121,7 @@ or add into a language hook function to force it on (which is the default) or pass in @code{-1} to force it off. -@xref{SRecode Minor Mode} for more on using the minor mode. +See @ref{SRecode Minor Mode} for more on using the minor mode. Use the menu to insert templates into the current file. @@ -169,7 +169,7 @@ Each template file you write is dedicated to a single major mode. In it, you can write templates within the same context and with the same name as core templates. You can force your templates to override the core templates for a particular major mode by setting the -priority. @xref{Special Variables}. +priority. See @ref{Special Variables}. To get going quickly, open a new @file{.srt} file. It will start in the @srecode{} template writing mode. Use the @srecode{} minor mode @@ -237,8 +237,8 @@ used in macros in a template. Variables are what allows a generic template such as a function to be made specific, such as a function named foo. The value of a variable can be one of three things; a string, a list of more dictionaries, or a special -@code{srecode-dictionary-compound-value} object subclass. -@xref{Variables} for more. +@code{srecode-dictionary-compound-value} object subclass. See +@ref{Variables} for more. @section Template Insertion The template insertion layer involves extensions to the basic template @@ -589,8 +589,8 @@ A variable can also have a compound value. This means the value of the variable is an @EIEIO{} object, which is a subclass of @code{srecode-dictionary-compound-value}. -New compound variables can only be setup from Lisp code. -@xref{Compound Dictionary Values} for details on setting up compound +New compound variables can only be setup from Lisp code. See +@ref{Compound Dictionary Values} for details on setting up compound variables from Lisp. @node Templates @@ -707,7 +707,7 @@ major mode. Template macros occur in the template text. The default escape characters are ``@{@{`` and ``@}@}'', though they can be changed -in the top-level variables. @xref{Variables}. +in the top-level variables. See @ref{Variables}. Thus, if you have the template code that looks like this: diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 31c7ad9c677..45ecf18b06e 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -853,8 +853,8 @@ as the @option{rsh} method. Instead of connecting to a remote host, @command{su} program allows editing as another user. The host can be either @samp{localhost} or -the host returned by the function @command{(system-name)}. -@xref{Multi-hops} for an exception to this behavior. +the host returned by the function @command{(system-name)}. See +@ref{Multi-hops} for an exception to this behavior. @cindex method @option{androidsu} @cindex @option{androidsu} method @@ -907,7 +907,7 @@ This is an optional method, @pxref{Optional methods}. The @command{sg} program allows editing as different group. The host can be either @samp{localhost} or the host returned by the function @command{(system-name)}. The user name must be specified, but it -denotes a group name. @xref{Multi-hops} for an exception to this +denotes a group name. See @ref{Multi-hops} for an exception to this behavior. @cindex method @option{sshx} @@ -1566,7 +1566,7 @@ remote file name, it is ignored. Access via @option{rclone} is slow. If you have an alternative method for accessing the system storage, you should use it. -@xref{GVFS-based methods} for example, methods @option{gdrive} and +@ref{GVFS-based methods} for example, methods @option{gdrive} and @option{nextcloud}. @cindex method @option{sshfs} @@ -2390,7 +2390,7 @@ to a remote home directory, like @option{adb}, @option{rclone} and The temporary directory on the remote host. If not specified, the default value is @t{"/data/local/tmp"} for the @option{adb} method, @t{"/C$/Temp"} for the @option{smb} method, and @t{"/tmp"} otherwise. -@xref{Temporary directory}. +@ref{Temporary directory}. @item @t{"posix"} @@ -2535,8 +2535,8 @@ connection information}. If you want, for example, use @end lisp This works only for connection methods which allow overriding the -remote login shell, like @option{sshx} or @option{plink}. -@xref{Inline methods} and @ref{External methods} for connection methods +remote login shell, like @option{sshx} or @option{plink}. See +@ref{Inline methods} and @ref{External methods} for connection methods which support this. @vindex tramp-sh-extra-args @@ -5445,8 +5445,8 @@ as value of the @env{TERM} environment variable. If you want to use another value for @env{TERM}, change @code{tramp-terminal-type} and this line accordingly. -Alternatively, you can set the remote login shell explicitly. -@xref{Remote shell setup} for discussion of this technique, +Alternatively, you can set the remote login shell explicitly. See +@ref{Remote shell setup} for discussion of this technique, When using fish shell on remote hosts, disable fancy formatting by adding the following to @file{~/.config/fish/config.fish}: diff --git a/doc/misc/transient.texi b/doc/misc/transient.texi index fb8b6da145c..2f2e4cf7edd 100644 --- a/doc/misc/transient.texi +++ b/doc/misc/transient.texi @@ -789,7 +789,7 @@ used to draw the line. This user option may be overridden if @code{:mode-line-format} is passed when creating a new prefix with @code{transient-define-prefix}. -Otherwise this can be any mode-line format. @xref{Mode Line Format,,,elisp,}, for details. +Otherwise this can be any mode-line format. See @ref{Mode Line Format,,,elisp,}, for details. @end defopt @defopt transient-semantic-coloring @@ -1089,14 +1089,14 @@ enabled. One benefit of the Transient interface is that it remembers history not only on a global level (``this command was invoked using these arguments, and previously it was invoked using those other arguments''), but also remembers the values of individual arguments -independently. @xref{Using History}. +independently. See @ref{Using History}. After a transient prefix command is invoked, @kbd{C-h @var{KEY}} can be used to show the documentation for the infix or suffix command that @kbd{@var{KEY}} is bound to (see @ref{Getting Help for Suffix Commands}), and infixes and suffixes can be removed from the transient using @kbd{C-x l @var{KEY}}. Infixes and suffixes that are disabled by default can be enabled the same way. -@xref{Enabling and Disabling Suffixes}. +See @ref{Enabling and Disabling Suffixes}. Transient ships with support for a few different types of specialized infix commands. A command that sets a command line option, for example, @@ -1444,7 +1444,7 @@ guessed based on the long argument. If the argument ends with @samp{=} Finally, details can be specified using optional @var{KEYWORD}-@var{VALUE} pairs. Each keyword has to be a keyword symbol, either @code{:class} or a keyword -argument supported by the constructor of that class. @xref{Suffix Slots}. +argument supported by the constructor of that class. See @ref{Suffix Slots}. @node Defining Suffix and Infix Commands @section Defining Suffix and Infix Commands @@ -1726,8 +1726,8 @@ means that all outer prefixes are exited at once. @item The behavior for non-suffixes can be set for a particular prefix, by the prefix's @code{transient-non-suffix} slot to a boolean, a suitable -pre-command function, or a shorthand for such a function. -@xref{Pre-commands for Non-Suffixes}. +pre-command function, or a shorthand for such a function. See +@ref{Pre-commands for Non-Suffixes}. @item The common behavior for the suffixes of a particular prefix can be @@ -2424,7 +2424,7 @@ secondary value, called a ``scope''. See @code{transient-define-prefix}. @code{transient-suffix}, @code{transient-non-suffix} and @code{transient-switch-frame} play a part when determining whether the currently active transient prefix command remains active/transient when a suffix or arbitrary -non-suffix command is invoked. @xref{Transient State}. +non-suffix command is invoked. See @ref{Transient State}. @item @code{refresh-suffixes} Normally suffix objects and keymaps are only setup @@ -2760,7 +2760,7 @@ currently cannot be invoked. By default these predicates run when the prefix command is invoked, but this can be changes, using the @code{refresh-suffixes} prefix slot. -@xref{Prefix Slots}. +See @ref{Prefix Slots}. One more slot is shared between group and suffix classes, @code{level}. Like the slots documented above, it is a predicate, but it is used for a diff --git a/doc/misc/wisent.texi b/doc/misc/wisent.texi index 6c700779ba7..a92f61fd6c7 100644 --- a/doc/misc/wisent.texi +++ b/doc/misc/wisent.texi @@ -446,8 +446,8 @@ matching the empty string, for which the default action is to return @section Example @cindex grammar example -Here is an example to parse simple infix arithmetic expressions. -@xref{Infix Calc, , , bison}, in the Bison manual for details. +Here is an example to parse simple infix arithmetic expressions. See +@ref{Infix Calc, , , bison}, in the Bison manual for details. @lisp @group @@ -570,7 +570,7 @@ must be @dfn{LALR(1)}. @cindex look-ahead token A grammar is @acronym{LALR(1)} if it is possible to tell how to parse any portion of an input string with just a single token of look-ahead: -the @dfn{look-ahead token}. @xref{Language and Grammar, , , +the @dfn{look-ahead token}. See @ref{Language and Grammar, , , bison}, in the Bison manual for more information. @cindex grammar compilation @@ -643,7 +643,7 @@ When either a shift or a reduction would be valid at the same state. Such conflicts are resolved by choosing to shift, unless otherwise directed by operator precedence declarations. -@xref{Shift/Reduce , , , bison}, in the Bison manual for more +See @ref{Shift/Reduce , , , bison}, in the Bison manual for more information. @cindex reduce/reduce conflicts @@ -654,8 +654,8 @@ grammar. Such conflicts are resolved by choosing to use the rule that appears first in the grammar, but it is very risky to rely on this. Every -reduce/reduce conflict must be studied and usually eliminated. -@xref{Reduce/Reduce , , , bison}, in the Bison manual for more +reduce/reduce conflict must be studied and usually eliminated. See +@ref{Reduce/Reduce , , , bison}, in the Bison manual for more information. @end table @@ -701,7 +701,7 @@ reports are separated from each other by a line like this: @end example where @var{source-file} is the name of the Emacs Lisp file from which -the grammar was read. @xref{Understanding the automaton}, for +the grammar was read. See @ref{Understanding the automaton}, for details on the verbose report. @table @strong @@ -1312,7 +1312,7 @@ value of the variable @code{wisent-recovering} is non-@code{nil}. @cindex error recovery The error recovery mechanism of the Wisent's parser conforms to the -one Bison uses. @xref{Error Recovery, , , bison}, in the Bison +one Bison uses. See @ref{Error Recovery, , , bison}, in the Bison manual for details. @cindex error token commit e54b94c28cdf9699009e7691f7c8ffa5b2c7b741 Author: Stefan Kangas Date: Sun Jan 19 01:34:44 2025 +0100 Use @xref more consistently; "See @ref" -> "@xref" * doc/lispref/commands.texi (Using Interactive): * doc/lispref/customize.texi (Type Keywords): * doc/lispref/edebug.texi (Using Edebug, Specification List): * doc/lispref/frames.texi (Frame Layout): * doc/lispref/functions.texi (What Is a Function, Related Topics): * doc/lispref/keymaps.texi (Controlling Active Maps, Key Lookup): * doc/lispref/minibuf.texi (Completion Variables): * doc/lispref/os.texi (Terminal Input): * doc/lispref/text.texi (JSONRPC Overview): * doc/misc/calc.texi (More About Embedded Mode, Customizing Calc): * doc/misc/cc-mode.texi (Movement Commands, Auto-newlines) (Config Basics, Custom Auto-newlines): * doc/misc/gnus.texi (Email Based Diary): * doc/misc/htmlfontify.texi (Interactive, Non-interactive): (Variables): * doc/misc/idlwave.texi (Using the Shell): * doc/misc/srecode.texi (Quick Start, User Templates) (Parts of SRecode, Compound Variable Values, Template Macros): * doc/misc/tramp.texi (Inline methods, FUSE-based methods) (Predefined connection information, Remote shell setup) (Frequently Asked Questions): * doc/misc/transient.texi (Configuration, Technical Introduction): (Binding Suffix and Infix Commands, Transient State): (Prefix Slots, Predicate Slots): * doc/misc/wisent.texi (Example, Compiling a grammar, Conflicts): (Grammar Debugging, Error recovery): diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 9fe8b4b9e21..6b660bdf5ba 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -184,7 +184,7 @@ occurs within the body, the form simply returns @code{nil} without even evaluating its argument. The @var{modes} list allows specifying which modes the command is -meant to be used in. See @ref{Command Modes} for more details about +meant to be used in. @xref{Command Modes} for more details about the effect of specifying @var{modes}, and when to use it. By convention, you should put the @code{interactive} form in the diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 09c05fa18c6..95fa77c73a3 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -1221,7 +1221,7 @@ the value is acceptable. Specify how to decide whether an inline value matches the type. The corresponding value, @var{function}, should be a function that accepts two arguments, a widget and an inline value; it should return -non-@code{nil} if the value is acceptable. See @ref{Splicing into +non-@code{nil} if the value is acceptable. @xref{Splicing into Lists} for more information about inline values. @item :validate @var{function} diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 0effe48e9a3..e234db6fce5 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -85,8 +85,8 @@ start using it. To debug a Lisp program with Edebug, you must first @dfn{instrument} the Lisp code that you want to debug. A simple way to do this is to first move point into the definition of a function or macro and then do -@kbd{C-u C-M-x} (@code{eval-defun} with a prefix argument). See -@ref{Instrumenting}, for alternative ways to instrument code. +@kbd{C-u C-M-x} (@code{eval-defun} with a prefix argument). +@xref{Instrumenting}, for alternative ways to instrument code. Once a function is instrumented, any call to the function activates Edebug. Depending on which Edebug execution mode you have selected, @@ -1369,8 +1369,8 @@ specifications and the backquote example. @cindex preventing backtracking No argument is matched but backtracking through the gate is disabled while matching the remainder of the specifications at this level. This -is primarily used to generate more specific syntax error messages. See -@ref{Backtracking}, for more details. Also see the @code{let} example. +is primarily used to generate more specific syntax error messages. +@xref{Backtracking}, for more details. Also see the @code{let} example. @item &error @code{&error} should be followed by a string, an error message, in the diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index a0d0e489ad0..da89a46d7bc 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -774,8 +774,7 @@ As a rule, the inner frame is subdivided into the frame's root window rule: A @dfn{minibuffer-less frame} contains a root window only and does not contain a minibuffer window. A @dfn{minibuffer-only frame} contains only a minibuffer window which also serves as that frame's root window. -See @ref{Initial Parameters} for how to create such frame -configurations. +@xref{Initial Parameters} for how to create such frame configurations. @item Text Area @cindex text area diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 2b5847d2f64..7f881bae7f5 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -90,7 +90,7 @@ fundamental part of Lisp (e.g., @code{car}), or because it provides a low-level interface to operating system services, or because it needs to run fast. Unlike functions defined in Lisp, primitives can be modified or added only by changing the C sources and recompiling -Emacs. See @ref{Writing Emacs Primitives}. +Emacs. @xref{Writing Emacs Primitives}. @item special form A primitive that is like a function but does not evaluate all of its @@ -2976,56 +2976,56 @@ elsewhere, but we provide cross references here. @table @code @item apply -See @ref{Calling Functions}. +@xref{Calling Functions}. @item autoload -See @ref{Autoload}. +@xref{Autoload}. @item call-interactively -See @ref{Interactive Call}. +@xref{Interactive Call}. @item called-interactively-p -See @ref{Distinguish Interactive}. +@xref{Distinguish Interactive}. @item commandp -See @ref{Interactive Call}. +@xref{Interactive Call}. @item documentation -See @ref{Accessing Documentation}. +@xref{Accessing Documentation}. @item eval -See @ref{Eval}. +@xref{Eval}. @item funcall -See @ref{Calling Functions}. +@xref{Calling Functions}. @item function -See @ref{Anonymous Functions}. +@xref{Anonymous Functions}. @item ignore -See @ref{Calling Functions}. +@xref{Calling Functions}. @item indirect-function -See @ref{Function Indirection}. +@xref{Function Indirection}. @item interactive -See @ref{Using Interactive}. +@xref{Using Interactive}. @item interactive-p -See @ref{Distinguish Interactive}. +@xref{Distinguish Interactive}. @item mapatoms -See @ref{Creating Symbols}. +@xref{Creating Symbols}. @item mapcar -See @ref{Mapping Functions}. +@xref{Mapping Functions}. @item map-char-table -See @ref{Char-Tables}. +@xref{Char-Tables}. @item mapconcat -See @ref{Mapping Functions}. +@xref{Mapping Functions}. @item undefined -See @ref{Functions for Key Lookup}. +@xref{Functions for Key Lookup}. @end table diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 7095942d7b2..eaba29a33e3 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -1046,8 +1046,8 @@ When more than one minor mode keymap is active, the earlier one in minor modes so that they don't interfere with each other. If you do this properly, the order will not matter. -See @ref{Keymaps and Minor Modes}, for more information about minor -modes. See also @code{minor-mode-key-binding} (@pxref{Functions for Key +@xref{Keymaps and Minor Modes}, for more information about minor modes. +See also @code{minor-mode-key-binding} (@pxref{Functions for Key Lookup}). @end defvar @@ -1204,7 +1204,7 @@ and @var{command} is its binding. @xref{What Is a Function}. @cindex string in keymap The array (either a string or a vector) is a keyboard macro. The events used so far in the lookup form a complete key, and the array is its -binding. See @ref{Keyboard Macros}, for more information. +binding. @xref{Keyboard Macros}, for more information. @item @var{keymap} @cindex keymap in keymap diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index d8e7e6c2e76..ecd34b95294 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1890,7 +1890,7 @@ The function to add prefixes and suffixes to completions. @end table @noindent -See @ref{Programmed Completion}, for a complete list of metadata entries. +@xref{Programmed Completion}, for a complete list of metadata entries. @end defopt @defvar completion-extra-properties diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 31ae373f6f3..9b92093f629 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2518,8 +2518,7 @@ idleness. Here's an example: @cindex terminal input This section describes functions and variables for recording or -manipulating terminal input. See @ref{Display}, for related -functions. +manipulating terminal input. @xref{Display}, for related functions. @menu * Input Modes:: Options for how input is processed. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 2d24436d214..0e7fd17e7ed 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -6019,7 +6019,7 @@ a different underlying transport strategy (for details on how to subclass, see @ref{Inheritance,Inheritance,,eieio}.). Users of the application-building interface can then instantiate objects of this concrete class (using the @code{make-instance} function) and connect -to JSONRPC endpoints using that strategy. See @ref{Process-based +to JSONRPC endpoints using that strategy. @xref{Process-based JSONRPC connections} for a built-in transport implementation. This API has mandatory and optional parts. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 0635ab7ac05..5fd3c6351de 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -30811,7 +30811,7 @@ embedded in a @TeX{} or @LaTeX{} document its plain version will be invisible in the final printed copy. Certain major modes have different delimiters to ensure that the ``plain'' version will be in a comment for those modes, also. -See @ref{Customizing Embedded Mode} to see how to change the ``plain'' +@xref{Customizing Embedded Mode} to see how to change the ``plain'' formula delimiters. There are several notations which Calc's parser for ``big'' @@ -35323,7 +35323,7 @@ also be reset by putting the appropriate lines in your .emacs file; Some of the customizable variables are regular expressions. A regular expression is basically a pattern that Calc can search for. -See @ref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual} +@xref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual} to see how regular expressions work. @defvar calc-settings-file @@ -35341,7 +35341,7 @@ value will be @code{"~/.calc.el"}. @end defvar @defvar calc-gnuplot-name -See @ref{Graphics}.@* +@xref{Graphics}.@* The variable @code{calc-gnuplot-name} should be the name of the GNUPLOT program (a string). If you have GNUPLOT installed on your system but Calc is unable to find it, you may need to set this @@ -35352,7 +35352,7 @@ The default value of @code{calc-gnuplot-name} is @code{"gnuplot"}. @defvar calc-gnuplot-plot-command @defvarx calc-gnuplot-print-command -See @ref{Devices, ,Graphical Devices}.@* +@xref{Devices, ,Graphical Devices}.@* The variables @code{calc-gnuplot-plot-command} and @code{calc-gnuplot-print-command} represent system commands to display and print the output of GNUPLOT, respectively. These may be @@ -35367,7 +35367,7 @@ and the default value of @code{calc-gnuplot-print-command} is @end defvar @defvar calc-language-alist -See @ref{Basic Embedded Mode}.@* +@xref{Basic Embedded Mode}.@* The variable @code{calc-language-alist} controls the languages that Calc will associate with major modes. When Calc embedded mode is enabled, it will try to use the current major mode to @@ -35396,7 +35396,7 @@ The default value of @code{calc-language-alist} is @defvar calc-embedded-announce-formula @defvarx calc-embedded-announce-formula-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variable @code{calc-embedded-announce-formula} helps determine what formulas @kbd{C-x * a} will activate in a buffer. It is a regular expression, and when activating embedded formulas with @@ -35434,7 +35434,7 @@ and @code{calc-embedded-open-close-mode-alist}. @defvar calc-embedded-open-formula @defvarx calc-embedded-close-formula @defvarx calc-embedded-open-close-formula-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-formula} and @code{calc-embedded-close-formula} control the region that Calc will activate as a formula when Embedded mode is entered with @kbd{C-x * e}. @@ -35471,7 +35471,7 @@ It consists of a list of lists of the form @defvar calc-embedded-word-regexp @defvarx calc-embedded-word-regexp-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variable @code{calc-embedded-word-regexp} determines the expression that Calc will activate when Embedded mode is entered with @kbd{C-x * w}. It is a regular expressions. @@ -35490,7 +35490,7 @@ It consists of a list of lists of the form @defvar calc-embedded-open-plain @defvarx calc-embedded-close-plain @defvarx calc-embedded-open-close-plain-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-plain} and @code{calc-embedded-open-plain} are used to delimit ``plain'' formulas. Note that these are actual strings, not regular @@ -35531,7 +35531,7 @@ and @code{calc-embedded-open-close-mode-alist}. @defvar calc-embedded-open-new-formula @defvarx calc-embedded-close-new-formula @defvarx calc-embedded-open-close-new-formula-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-new-formula} and @code{calc-embedded-close-new-formula} are strings which are inserted before and after a new formula when you type @kbd{C-x * f}. @@ -35559,7 +35559,7 @@ It consists of a list of lists of the form @defvar calc-embedded-open-mode @defvarx calc-embedded-close-mode @defvarx calc-embedded-open-close-mode-alist -See @ref{Customizing Embedded Mode}.@* +@xref{Customizing Embedded Mode}.@* The variables @code{calc-embedded-open-mode} and @code{calc-embedded-close-mode} are strings which Calc will place before and after any mode annotations that it inserts. Calc never scans for @@ -35600,7 +35600,7 @@ and @code{calc-embedded-open-close-plain-alist}. @defvar calc-lu-power-reference @defvarx calc-lu-field-reference -See @ref{Logarithmic Units}.@* +@xref{Logarithmic Units}.@* The variables @code{calc-lu-power-reference} and @code{calc-lu-field-reference} are unit expressions (written as strings) which Calc will use as reference quantities for logarithmic @@ -35612,7 +35612,7 @@ and the default value of @code{calc-lu-field-reference} is @end defvar @defvar calc-note-threshold -See @ref{Musical Notes}.@* +@xref{Musical Notes}.@* The variable @code{calc-note-threshold} is a number (written as a string) which determines how close (in cents) a frequency needs to be to a note to be recognized as that note. @@ -35623,7 +35623,7 @@ The default value of @code{calc-note-threshold} is 1. @defvar calc-highlight-selections-with-faces @defvarx calc-selected-face @defvarx calc-nonselected-face -See @ref{Displaying Selections}.@* +@xref{Displaying Selections}.@* The variable @code{calc-highlight-selections-with-faces} determines how selected sub-formulas are distinguished. If @code{calc-highlight-selections-with-faces} is @code{nil}, then @@ -35671,7 +35671,7 @@ be preserved. The default value of @code{calc-undo-length} is @expr{100}. @end defvar @defvar calc-gregorian-switch -See @ref{Date Forms}.@* +@xref{Date Forms}.@* The variable @code{calc-gregorian-switch} is either a list of integers @code{(@var{YEAR} @var{MONTH} @var{DAY})} or @code{nil}. If it is @code{nil}, then Calc's date forms always represent Gregorian dates. diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index b46eb80055a..176087e20ca 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -925,7 +925,7 @@ behavior prior to version 5.32.}, set @code{c-defun-tactic} to These functions are analogous to the Emacs built-in commands @code{beginning-of-defun} and @code{end-of-defun}, except they eliminate the constraint that the top-level opening brace of the defun -must be in column zero. See @ref{Defuns,,,@emacsman{}, +must be in column zero. @xref{Defuns,,,@emacsman{}, @emacsmantitle{}}, for more information. @item @kbd{C-M-a} (AWK Mode) (@code{c-awk-beginning-of-defun}) @@ -1485,7 +1485,7 @@ Sometimes @ccmode{} inserts an auto-newline where you don't want one, such as after a @samp{@}} when you're about to type a @samp{;}. Hungry deletion can help here (@pxref{Hungry WS Deletion}), or you can activate an appropriate @dfn{clean-up}, which will remove the excess -whitespace after you've typed the @samp{;}. See @ref{Clean-ups} for a +whitespace after you've typed the @samp{;}. @xref{Clean-ups} for a full description. See also @ref{Electric Keys} for a summary of clean-ups listed by key. @@ -2420,7 +2420,7 @@ Mode and Java Mode buffers, you could do it like this: @end group @end example -See @ref{CC Hooks} for more details on the use of @ccmode{} hooks. +@xref{CC Hooks} for more details on the use of @ccmode{} hooks. @item Styles A @ccmode{} @dfn{style} is a coherent collection of customizations @@ -2438,7 +2438,7 @@ in your @file{.emacs} file: (other . "free-group-style"))) @end example -See @ref{Styles} for fuller details on using @ccmode{} styles and how +@xref{Styles} for fuller details on using @ccmode{} styles and how to create them. @item File Local Variable setting @@ -3312,7 +3312,7 @@ different ways, depending on the character just typed: an alist. This element specifies where to put newlines: this is any combination of before and after the brace or colon. If no alist element is found, newlines are inserted both before and after a brace, -but none are inserted around a colon. See @ref{Hanging Braces} and +but none are inserted around a colon. @xref{Hanging Braces} and @ref{Hanging Colons}. @item Semicolons and Commas diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 41ec75a5ed2..db477d90d70 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -18252,7 +18252,7 @@ inherited. This section describes a special mail back end called @code{nndiary}, and its companion library @code{gnus-diary}. It is ``special'' in the sense that it is not meant to be one of the standard alternatives for -reading mail with Gnus. See @ref{Choosing a Mail Back End} for that. +reading mail with Gnus. @xref{Choosing a Mail Back End} for that. Instead, it is used to treat @emph{some} of your mails in a special way, namely, as event reminders. diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi index fd9b9435123..d8c1534edec 100644 --- a/doc/misc/htmlfontify.texi +++ b/doc/misc/htmlfontify.texi @@ -141,7 +141,7 @@ and hyperlinks as appropriate. (htmlfontify-run-etags @var{srcdir}) @end lisp -Load the etags cache for @var{srcdir}. See @ref{hfy-load-tags-cache}. +Load the etags cache for @var{srcdir}. @xref{hfy-load-tags-cache}. @item htmlfontify-copy-and-link-dir @findex htmlfontify-copy-and-link-dir @@ -828,7 +828,7 @@ If @var{class} is @code{nil}, then you just get whatever @code{face-attr-construct} returns; i.e., the current specification in effect for @var{face}. -See @ref{hfy-display-class} for details of valid values for @var{class}. +@xref{hfy-display-class} for details of valid values for @var{class}. @item hfy-face-at @findex hfy-face-at @@ -1069,7 +1069,7 @@ Each tag hash entry then contains entries of the form: i.e., an alist mapping (relative) file paths to line and character offsets. -See @ref{hfy-load-tags-cache}. +@xref{hfy-load-tags-cache}. @item hfy-tags-rmap @vindex hfy-tags-rmap diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 0db01faf3d1..bc3dcf70db6 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -2546,7 +2546,7 @@ commands: In addition to these standard @file{comint} commands, @code{idlwave-shell-mode} provides many of the same commands which simplify writing IDL code available in IDLWAVE buffers. This includes -abbreviations, online help, and completion. See @ref{Routine Info} and +abbreviations, online help, and completion. @xref{Routine Info} and @ref{Online Help} and @ref{Completion} for more information on these commands. diff --git a/doc/misc/srecode.texi b/doc/misc/srecode.texi index e8c0958c252..68c03d5ed6a 100644 --- a/doc/misc/srecode.texi +++ b/doc/misc/srecode.texi @@ -121,7 +121,7 @@ or add into a language hook function to force it on (which is the default) or pass in @code{-1} to force it off. -See @ref{SRecode Minor Mode} for more on using the minor mode. +@xref{SRecode Minor Mode} for more on using the minor mode. Use the menu to insert templates into the current file. @@ -169,7 +169,7 @@ Each template file you write is dedicated to a single major mode. In it, you can write templates within the same context and with the same name as core templates. You can force your templates to override the core templates for a particular major mode by setting the -priority. See @ref{Special Variables}. +priority. @xref{Special Variables}. To get going quickly, open a new @file{.srt} file. It will start in the @srecode{} template writing mode. Use the @srecode{} minor mode @@ -237,8 +237,8 @@ used in macros in a template. Variables are what allows a generic template such as a function to be made specific, such as a function named foo. The value of a variable can be one of three things; a string, a list of more dictionaries, or a special -@code{srecode-dictionary-compound-value} object subclass. See -@ref{Variables} for more. +@code{srecode-dictionary-compound-value} object subclass. +@xref{Variables} for more. @section Template Insertion The template insertion layer involves extensions to the basic template @@ -589,8 +589,8 @@ A variable can also have a compound value. This means the value of the variable is an @EIEIO{} object, which is a subclass of @code{srecode-dictionary-compound-value}. -New compound variables can only be setup from Lisp code. See -@ref{Compound Dictionary Values} for details on setting up compound +New compound variables can only be setup from Lisp code. +@xref{Compound Dictionary Values} for details on setting up compound variables from Lisp. @node Templates @@ -707,7 +707,7 @@ major mode. Template macros occur in the template text. The default escape characters are ``@{@{`` and ``@}@}'', though they can be changed -in the top-level variables. See @ref{Variables}. +in the top-level variables. @xref{Variables}. Thus, if you have the template code that looks like this: diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 45ecf18b06e..31c7ad9c677 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -853,8 +853,8 @@ as the @option{rsh} method. Instead of connecting to a remote host, @command{su} program allows editing as another user. The host can be either @samp{localhost} or -the host returned by the function @command{(system-name)}. See -@ref{Multi-hops} for an exception to this behavior. +the host returned by the function @command{(system-name)}. +@xref{Multi-hops} for an exception to this behavior. @cindex method @option{androidsu} @cindex @option{androidsu} method @@ -907,7 +907,7 @@ This is an optional method, @pxref{Optional methods}. The @command{sg} program allows editing as different group. The host can be either @samp{localhost} or the host returned by the function @command{(system-name)}. The user name must be specified, but it -denotes a group name. See @ref{Multi-hops} for an exception to this +denotes a group name. @xref{Multi-hops} for an exception to this behavior. @cindex method @option{sshx} @@ -1566,7 +1566,7 @@ remote file name, it is ignored. Access via @option{rclone} is slow. If you have an alternative method for accessing the system storage, you should use it. -@ref{GVFS-based methods} for example, methods @option{gdrive} and +@xref{GVFS-based methods} for example, methods @option{gdrive} and @option{nextcloud}. @cindex method @option{sshfs} @@ -2390,7 +2390,7 @@ to a remote home directory, like @option{adb}, @option{rclone} and The temporary directory on the remote host. If not specified, the default value is @t{"/data/local/tmp"} for the @option{adb} method, @t{"/C$/Temp"} for the @option{smb} method, and @t{"/tmp"} otherwise. -@ref{Temporary directory}. +@xref{Temporary directory}. @item @t{"posix"} @@ -2535,8 +2535,8 @@ connection information}. If you want, for example, use @end lisp This works only for connection methods which allow overriding the -remote login shell, like @option{sshx} or @option{plink}. See -@ref{Inline methods} and @ref{External methods} for connection methods +remote login shell, like @option{sshx} or @option{plink}. +@xref{Inline methods} and @ref{External methods} for connection methods which support this. @vindex tramp-sh-extra-args @@ -5445,8 +5445,8 @@ as value of the @env{TERM} environment variable. If you want to use another value for @env{TERM}, change @code{tramp-terminal-type} and this line accordingly. -Alternatively, you can set the remote login shell explicitly. See -@ref{Remote shell setup} for discussion of this technique, +Alternatively, you can set the remote login shell explicitly. +@xref{Remote shell setup} for discussion of this technique, When using fish shell on remote hosts, disable fancy formatting by adding the following to @file{~/.config/fish/config.fish}: diff --git a/doc/misc/transient.texi b/doc/misc/transient.texi index 2f2e4cf7edd..fb8b6da145c 100644 --- a/doc/misc/transient.texi +++ b/doc/misc/transient.texi @@ -789,7 +789,7 @@ used to draw the line. This user option may be overridden if @code{:mode-line-format} is passed when creating a new prefix with @code{transient-define-prefix}. -Otherwise this can be any mode-line format. See @ref{Mode Line Format,,,elisp,}, for details. +Otherwise this can be any mode-line format. @xref{Mode Line Format,,,elisp,}, for details. @end defopt @defopt transient-semantic-coloring @@ -1089,14 +1089,14 @@ enabled. One benefit of the Transient interface is that it remembers history not only on a global level (``this command was invoked using these arguments, and previously it was invoked using those other arguments''), but also remembers the values of individual arguments -independently. See @ref{Using History}. +independently. @xref{Using History}. After a transient prefix command is invoked, @kbd{C-h @var{KEY}} can be used to show the documentation for the infix or suffix command that @kbd{@var{KEY}} is bound to (see @ref{Getting Help for Suffix Commands}), and infixes and suffixes can be removed from the transient using @kbd{C-x l @var{KEY}}. Infixes and suffixes that are disabled by default can be enabled the same way. -See @ref{Enabling and Disabling Suffixes}. +@xref{Enabling and Disabling Suffixes}. Transient ships with support for a few different types of specialized infix commands. A command that sets a command line option, for example, @@ -1444,7 +1444,7 @@ guessed based on the long argument. If the argument ends with @samp{=} Finally, details can be specified using optional @var{KEYWORD}-@var{VALUE} pairs. Each keyword has to be a keyword symbol, either @code{:class} or a keyword -argument supported by the constructor of that class. See @ref{Suffix Slots}. +argument supported by the constructor of that class. @xref{Suffix Slots}. @node Defining Suffix and Infix Commands @section Defining Suffix and Infix Commands @@ -1726,8 +1726,8 @@ means that all outer prefixes are exited at once. @item The behavior for non-suffixes can be set for a particular prefix, by the prefix's @code{transient-non-suffix} slot to a boolean, a suitable -pre-command function, or a shorthand for such a function. See -@ref{Pre-commands for Non-Suffixes}. +pre-command function, or a shorthand for such a function. +@xref{Pre-commands for Non-Suffixes}. @item The common behavior for the suffixes of a particular prefix can be @@ -2424,7 +2424,7 @@ secondary value, called a ``scope''. See @code{transient-define-prefix}. @code{transient-suffix}, @code{transient-non-suffix} and @code{transient-switch-frame} play a part when determining whether the currently active transient prefix command remains active/transient when a suffix or arbitrary -non-suffix command is invoked. See @ref{Transient State}. +non-suffix command is invoked. @xref{Transient State}. @item @code{refresh-suffixes} Normally suffix objects and keymaps are only setup @@ -2760,7 +2760,7 @@ currently cannot be invoked. By default these predicates run when the prefix command is invoked, but this can be changes, using the @code{refresh-suffixes} prefix slot. -See @ref{Prefix Slots}. +@xref{Prefix Slots}. One more slot is shared between group and suffix classes, @code{level}. Like the slots documented above, it is a predicate, but it is used for a diff --git a/doc/misc/wisent.texi b/doc/misc/wisent.texi index a92f61fd6c7..6c700779ba7 100644 --- a/doc/misc/wisent.texi +++ b/doc/misc/wisent.texi @@ -446,8 +446,8 @@ matching the empty string, for which the default action is to return @section Example @cindex grammar example -Here is an example to parse simple infix arithmetic expressions. See -@ref{Infix Calc, , , bison}, in the Bison manual for details. +Here is an example to parse simple infix arithmetic expressions. +@xref{Infix Calc, , , bison}, in the Bison manual for details. @lisp @group @@ -570,7 +570,7 @@ must be @dfn{LALR(1)}. @cindex look-ahead token A grammar is @acronym{LALR(1)} if it is possible to tell how to parse any portion of an input string with just a single token of look-ahead: -the @dfn{look-ahead token}. See @ref{Language and Grammar, , , +the @dfn{look-ahead token}. @xref{Language and Grammar, , , bison}, in the Bison manual for more information. @cindex grammar compilation @@ -643,7 +643,7 @@ When either a shift or a reduction would be valid at the same state. Such conflicts are resolved by choosing to shift, unless otherwise directed by operator precedence declarations. -See @ref{Shift/Reduce , , , bison}, in the Bison manual for more +@xref{Shift/Reduce , , , bison}, in the Bison manual for more information. @cindex reduce/reduce conflicts @@ -654,8 +654,8 @@ grammar. Such conflicts are resolved by choosing to use the rule that appears first in the grammar, but it is very risky to rely on this. Every -reduce/reduce conflict must be studied and usually eliminated. See -@ref{Reduce/Reduce , , , bison}, in the Bison manual for more +reduce/reduce conflict must be studied and usually eliminated. +@xref{Reduce/Reduce , , , bison}, in the Bison manual for more information. @end table @@ -701,7 +701,7 @@ reports are separated from each other by a line like this: @end example where @var{source-file} is the name of the Emacs Lisp file from which -the grammar was read. See @ref{Understanding the automaton}, for +the grammar was read. @xref{Understanding the automaton}, for details on the verbose report. @table @strong @@ -1312,7 +1312,7 @@ value of the variable @code{wisent-recovering} is non-@code{nil}. @cindex error recovery The error recovery mechanism of the Wisent's parser conforms to the -one Bison uses. See @ref{Error Recovery, , , bison}, in the Bison +one Bison uses. @xref{Error Recovery, , , bison}, in the Bison manual for details. @cindex error token commit 2c7b08c60a20268b3f55c95699542c9df95fc786 Author: Stefan Kangas Date: Sun Jan 19 00:48:08 2025 +0100 Initialize full range in parse_menu_item * src/keyboard.c (parse_menu_item): Initialize the full range of item, in case future changes makes ITEM_PROPERTY_ENABLE != ITEM_PROPERTY_MAX. Problem reported by Pip Cet . Ref: https://mail.gnu.org/r/emacs-devel/2025-01/msg00680.html diff --git a/src/keyboard.c b/src/keyboard.c index c17210db8b8..fa19c9f8ad3 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8716,7 +8716,7 @@ parse_menu_item (Lisp_Object item, int inmenubar) item_properties = make_nil_vector (ITEM_PROPERTY_MAX + 1); /* Initialize optional entries. */ - for (i = ITEM_PROPERTY_DEF; i < ITEM_PROPERTY_MAX; i++) + for (i = ITEM_PROPERTY_DEF; i <= ITEM_PROPERTY_MAX; i++) ASET (item_properties, i, Qnil); ASET (item_properties, ITEM_PROPERTY_ENABLE, Qt); commit 8661f40ce4d6bce649cb2a564f7c4e766318476c Author: Paul Eggert Date: Sat Jan 18 11:22:22 2025 -0800 Remove unnecessary stdalign.in.h * lib/stdalign.in.h: Remove. This file was already removed in commit b429274c5b4b2b511d2d351111dea2d354498e0f (2023-02-04) but was brought back mistakenly by a merge from emacs-29 in commit ecf08f0621c25ad1dfadd96399e204c389ab1695 (2024-01-02). * nt/inc/stdalign.h: Don’t mention removed file in comment. diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h deleted file mode 100644 index 49172ccc9dd..00000000000 --- a/lib/stdalign.in.h +++ /dev/null @@ -1,49 +0,0 @@ -/* A substitute for ISO C11 . - - Copyright 2011-2025 Free Software Foundation, Inc. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* Written by Paul Eggert and Bruno Haible. */ - -/* Define two obsolescent C11 macros, assuming alignas and alignof are - either keywords or alignasof-defined macros. */ - -#ifndef _@GUARD_PREFIX@_STDALIGN_H - -#if __GNUC__ >= 3 -@PRAGMA_SYSTEM_HEADER@ -#endif -@PRAGMA_COLUMNS@ - -/* We need to include the system's when it exists, because it might - define 'alignof' as a macro when it's not a keyword or compiler built-in. */ -#if @HAVE_STDALIGN_H@ -/* The include_next requires a split double-inclusion guard. */ -# @INCLUDE_NEXT@ @NEXT_STDALIGN_H@ -#endif - -#ifndef _@GUARD_PREFIX@_STDALIGN_H -#define _@GUARD_PREFIX@_STDALIGN_H - -#if (defined alignas \ - || (defined __STDC_VERSION__ && 202311 <= __STDC_VERSION__) \ - || (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) -# define __alignas_is_defined 1 -#endif - -#define __alignof_is_defined 1 - -#endif /* _@GUARD_PREFIX@_STDALIGN_H */ -#endif /* _@GUARD_PREFIX@_STDALIGN_H */ diff --git a/nt/inc/stdalign.h b/nt/inc/stdalign.h index 7e349dc31d0..808407156fa 100644 --- a/nt/inc/stdalign.h +++ b/nt/inc/stdalign.h @@ -1,9 +1,6 @@ #ifndef _NT_STDALIGN_H_ #define _NT_STDALIGN_H_ -/* This header has the necessary stuff from lib/stdalign.in.h, but - avoids the need to have Sed at build time. */ - #include #if defined __cplusplus template struct __alignof_helper { char __a; __t __b; }; commit 311b3f70f543a106bc9ebc369b69432a106b0e38 Author: Arsen Arsenović Date: Sat Jan 18 16:40:29 2025 +0100 ruler-mode: Improve compatibility with text-scale (bug#75168) * lisp/ruler-mode.el (ruler-mode-ruler): Use pixelwise line-number display width for alignment with line numbers. diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index 003dcae560f..64568e06cc9 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -632,12 +632,7 @@ Optional argument PROPS specifies other text properties to apply." (let* ((w (ruler-mode-text-scaled-window-width)) (m (window-margins)) (f (window-fringes)) - (i (if display-line-numbers - ;; FIXME: ruler-mode relies on I being an integer, so - ;; the column numbers might be slightly off if the - ;; line-number face is customized. - (round (line-number-display-width 'columns)) - 0)) + (i 0) (j (ruler-mode-text-scaled-window-hscroll)) ;; Setup the scrollbar, fringes, and margins areas. (lf (ruler-mode-space @@ -745,6 +740,12 @@ Optional argument PROPS specifies other text properties to apply." (dolist (p (nreverse props)) (add-text-properties (nth 0 p) (nth 1 p) (nthcdr 2 p) ruler-str)) + ;; Attach an alignment indent. + (if display-line-numbers + (setq ruler-str + (concat (ruler-mode-space `(,(line-number-display-width t))) + ruler-str))) + ;; Return the ruler propertized string. Using list here, ;; instead of concat visually separate the different areas. (if (nth 2 (window-fringes)) commit 63a322b616b8e2d1edd2b3dd9217ff595eaaec6e Author: Eli Zaretskii Date: Sat Jan 18 15:17:28 2025 +0200 ; * lisp/repeat.el (cl-extra): Require, to shut up byte-compiler. diff --git a/lisp/repeat.el b/lisp/repeat.el index fe8145e5daa..fcf9bc24376 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -87,6 +87,8 @@ ;;; Code: +(require 'cl-extra) + ;;;;; ************************* USER OPTIONS ************************** ;;;;; (defgroup repeat nil commit dcfc31dabd6f6b51be7b2fbc1115787856397870 Merge: fae75737c81 853719c4c23 Author: Eli Zaretskii Date: Sat Jan 18 07:46:34 2025 -0500 Merge from origin/emacs-30 853719c4c23 ; * lisp/net/eww.el (eww-download): Doc fix (bug#75585) 45ec5865aa7 ; * etc/NEWS: Tweak wording of NSM items. b981889e9ee ; cperl-mode-tests.el: Don't run the newest test in perl-... 6a864ef8f39 Add smtpmail cross-reference to 'auth-sources'. 1fd7957bc72 ; cperl-mode.el: Add a test for Bug#74245 8d289670d60 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/... b74ac4af940 ; cperl-mode.el: Allow bare $ in a signature (Bug#74245) 30e84fc6537 Emphasize the use of :tag for new customization types # Conflicts: # etc/NEWS commit fae75737c81523e223a66344c9a87ec721847f2d Merge: 840057bb1bf 30e84fc6537 Author: Eli Zaretskii Date: Sat Jan 18 07:46:31 2025 -0500 ; Merge from origin/emacs-30 The following commit was skipped: 30e84fc6537 Emphasize the use of :tag for new customization types commit 840057bb1bfc05a52519793c620d729688ea1d8f Author: Eli Zaretskii Date: Sat Jan 18 13:08:45 2025 +0200 ; Fix last change by using 'cl-oddp' and 'cl-evenp' (bug#75633). diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el index dc1a52c9716..e2a0276ae0a 100644 --- a/test/lisp/emacs-lisp/cl-extra-tests.el +++ b/test/lisp/emacs-lisp/cl-extra-tests.el @@ -184,14 +184,14 @@ nil))) (ert-deftest cl-extra-test-notany () - (should (equal (cl-notany #'oddp '(1 3 5)) nil)) - (should (equal (cl-notany #'oddp '(2 4 6)) t)) - (should (equal (cl-notany #'oddp '(1 2 3 4 5)) nil))) + (should (equal (cl-notany #'cl-oddp '(1 3 5)) nil)) + (should (equal (cl-notany #'cl-oddp '(2 4 6)) t)) + (should (equal (cl-notany #'cl-oddp '(1 2 3 4 5)) nil))) (ert-deftest cl-extra-test-notevery () - (should (equal (cl-notevery #'oddp '(1 3 5)) nil)) - (should (equal (cl-notevery #'oddp '(2 4 6)) t)) - (should (equal (cl-notevery #'oddp '(1 2 3 4 5)) t))) + (should (equal (cl-notevery #'cl-oddp '(1 3 5)) nil)) + (should (equal (cl-notevery #'cl-oddp '(2 4 6)) t)) + (should (equal (cl-notevery #'cl-oddp '(1 2 3 4 5)) t))) (ert-deftest cl-extra-test-gcd () (should (equal (cl-gcd 4) 4)) diff --git a/test/lisp/emacs-lisp/cl-seq-tests.el b/test/lisp/emacs-lisp/cl-seq-tests.el index 59ece0e4006..3541a989d34 100644 --- a/test/lisp/emacs-lisp/cl-seq-tests.el +++ b/test/lisp/emacs-lisp/cl-seq-tests.el @@ -133,23 +133,23 @@ Body are forms defining the test." (should (equal '(1 2 3 4 5 6) (cl-remove 2 list :from-end t :count 1))))) (ert-deftest cl-remove-if-test () - (should (equal '(1 3) (cl-remove-if 'evenp '(1 2 3 4)))) - (should (equal '(1 3) (cl-remove-if 'evenp '(1 2 3 4) :count 2))) - (should (equal '(1 3 4) (cl-remove-if 'evenp '(1 2 3 4) :start 1 :end 3))) - (should (equal '(1 3) (cl-remove-if 'evenp '(1 2 3 4) :from-end t))) - (should (equal '(2 4) (cl-remove-if 'oddp '(1 2 3 4)))) - (should (equal '() (cl-remove-if 'evenp '()))) - (should (equal '() (cl-remove-if 'evenp '(2))))) + (should (equal '(1 3) (cl-remove-if 'cl-evenp '(1 2 3 4)))) + (should (equal '(1 3) (cl-remove-if 'cl-evenp '(1 2 3 4) :count 2))) + (should (equal '(1 3 4) (cl-remove-if 'cl-evenp '(1 2 3 4) :start 1 :end 3))) + (should (equal '(1 3) (cl-remove-if 'cl-evenp '(1 2 3 4) :from-end t))) + (should (equal '(2 4) (cl-remove-if 'cl-oddp '(1 2 3 4)))) + (should (equal '() (cl-remove-if 'cl-evenp '()))) + (should (equal '() (cl-remove-if 'cl-evenp '(2))))) (ert-deftest cl-remove-if-not-test () - (should (equal '(2 4) (cl-remove-if-not 'evenp '(1 2 3 4)))) - (should (equal '(2 4) (cl-remove-if-not 'evenp '(1 2 3 4) :count 2))) - (should (equal '(1 2 4) (cl-remove-if-not 'evenp '(1 2 3 4) :start 1 :end 3))) - (should (equal '(2 4) (cl-remove-if-not 'evenp '(1 2 3 4) :from-end t))) - (should (equal '(1 3) (cl-remove-if-not 'oddp '(1 2 3 4)))) - (should (equal '() (cl-remove-if-not 'evenp '()))) - (should (equal '(2) (cl-remove-if-not 'evenp '(2)))) - (should (equal '(2) (cl-remove-if-not 'evenp '(2) :key #'(lambda (x) (- x)))))) + (should (equal '(2 4) (cl-remove-if-not 'cl-evenp '(1 2 3 4)))) + (should (equal '(2 4) (cl-remove-if-not 'cl-evenp '(1 2 3 4) :count 2))) + (should (equal '(1 2 4) (cl-remove-if-not 'cl-evenp '(1 2 3 4) :start 1 :end 3))) + (should (equal '(2 4) (cl-remove-if-not 'cl-evenp '(1 2 3 4) :from-end t))) + (should (equal '(1 3) (cl-remove-if-not 'cl-oddp '(1 2 3 4)))) + (should (equal '() (cl-remove-if-not 'cl-evenp '()))) + (should (equal '(2) (cl-remove-if-not 'cl-evenp '(2)))) + (should (equal '(2) (cl-remove-if-not 'cl-evenp '(2) :key #'(lambda (x) (- x)))))) ;; keywords supported: :test :test-not :key :count :start :end :from-end (ert-deftest cl-seq-delete-test () @@ -176,19 +176,19 @@ Body are forms defining the test." (ert-deftest cl-delete-if-test () (let ((list (list 1 2 3 4 5))) - (cl-delete-if 'evenp list) + (cl-delete-if 'cl-evenp list) (should (equal '(1 3 5) list)) - (should (equal '(1 3 5) (cl-delete-if 'evenp (list 1 2 3 4 5) :start 0 :end 4))) - (should (equal '(1 3 5) (cl-delete-if 'evenp (list 1 2 3 4 5) :from-end t))) - (should (equal '(2 4) (cl-delete-if 'oddp (list 1 2 3 4 5)))) - (should (equal '() (cl-delete-if 'evenp '()))) - (should (equal '() (cl-delete-if 'evenp (list 2)))))) + (should (equal '(1 3 5) (cl-delete-if 'cl-evenp (list 1 2 3 4 5) :start 0 :end 4))) + (should (equal '(1 3 5) (cl-delete-if 'cl-evenp (list 1 2 3 4 5) :from-end t))) + (should (equal '(2 4) (cl-delete-if 'cl-oddp (list 1 2 3 4 5)))) + (should (equal '() (cl-delete-if 'cl-evenp '()))) + (should (equal '() (cl-delete-if 'cl-evenp (list 2)))))) (ert-deftest cl-delete-if-not-test () (let ((list (list 1 2 3 4 5))) - (should (equal '(2 4) (cl-delete-if-not 'evenp list))) - (should (equal '() (cl-delete-if-not 'evenp '()))) - (should (equal '() (cl-delete-if-not 'evenp (list 1)))))) + (should (equal '(2 4) (cl-delete-if-not 'cl-evenp list))) + (should (equal '() (cl-delete-if-not 'cl-evenp '()))) + (should (equal '() (cl-delete-if-not 'cl-evenp (list 1)))))) (ert-deftest cl-delete-duplicates-test () (let ((list (list 1 2 3 2 1))) @@ -242,61 +242,61 @@ Body are forms defining the test." :if-not (lambda (x) (> (cl-position x list :from-end t) 1))))))) (ert-deftest cl-seq-substitute-if-test () - (let ((result (cl-substitute-if 'x #'evenp '(1 2 3 4 5)))) + (let ((result (cl-substitute-if 'x #'cl-evenp '(1 2 3 4 5)))) (should (equal result '(1 x 3 x 5)))) - (let ((result (cl-substitute-if 'x #'evenp '(1 3 5)))) + (let ((result (cl-substitute-if 'x #'cl-evenp '(1 3 5)))) (should (equal result '(1 3 5)))) (let ((result (cl-substitute-if 'x #'(lambda (n) t) '(1 2 3 4 5)))) (should (equal result '(x x x x x)))) - (let ((result (cl-substitute-if 'x #'evenp '(1 2 3 4 5) :start 1 :end 4))) + (let ((result (cl-substitute-if 'x #'cl-evenp '(1 2 3 4 5) :start 1 :end 4))) (should (equal result '(1 x 3 x 5)))) - (let ((result (cl-substitute-if 'x #'oddp '(1 2 3 4 5) :from-end t))) + (let ((result (cl-substitute-if 'x #'cl-oddp '(1 2 3 4 5) :from-end t))) (should (equal result '(x 2 x 4 x)))) (let ((result (cl-substitute-if 'x (lambda (n) (= n 3)) '(1 2 3 4 5) :key 'identity))) (should (equal result '(1 2 x 4 5))))) (ert-deftest cl-seq-substitute-if-not-test () - (let ((result (cl-substitute-if-not 'x #'evenp '(1 2 3 4 5)))) + (let ((result (cl-substitute-if-not 'x #'cl-evenp '(1 2 3 4 5)))) (should (equal result '(x 2 x 4 x)))) - (let ((result (cl-substitute-if-not 'x #'evenp '(2 4 6)))) + (let ((result (cl-substitute-if-not 'x #'cl-evenp '(2 4 6)))) (should (equal result '(2 4 6)))) (let ((result (cl-substitute-if-not 'x #'(lambda (n) (> n 5)) '(1 2 3 4 5)))) (should (equal result '(x x x x x)))) - (let ((result (cl-substitute-if-not 'x #'evenp '(1 2 3 4 5) :start 0 :end 4))) + (let ((result (cl-substitute-if-not 'x #'cl-evenp '(1 2 3 4 5) :start 0 :end 4))) (should (equal result '(x 2 x 4 5)))) - (let ((result (cl-substitute-if-not 'x #'oddp '(1 2 3 4 5) :from-end t))) + (let ((result (cl-substitute-if-not 'x #'cl-oddp '(1 2 3 4 5) :from-end t))) (should (equal result '(1 x 3 x 5)))) (let ((result (cl-substitute-if-not 'x (lambda (n) (= n 3)) '(1 2 3 4 5) :key 'identity))) (should (equal result '(x x 3 x x))))) (ert-deftest cl-find-if-test () - (let ((result (cl-find-if #'evenp '(1 2 3 4 5)))) + (let ((result (cl-find-if #'cl-evenp '(1 2 3 4 5)))) (should (equal result 2))) (let ((result (cl-find-if #'(lambda (n) (> n 5)) '(1 2 3 4 5)))) (should (equal result nil))) (let ((result (cl-find-if #'(lambda (n) (> n 3)) '(1 2 3 4 5 6 7)))) (should (equal result 4))) - (let ((result (cl-find-if #'evenp '(1 2 3 4 5) :start 2))) + (let ((result (cl-find-if #'cl-evenp '(1 2 3 4 5) :start 2))) (should (equal result 4))) - (let ((result (cl-find-if #'evenp '(1 2 3 4 5) :end 1))) + (let ((result (cl-find-if #'cl-evenp '(1 2 3 4 5) :end 1))) (should (equal result nil))) - (let ((result (cl-find-if #'oddp '(2 4 5 6 7) :from-end t))) + (let ((result (cl-find-if #'cl-oddp '(2 4 5 6 7) :from-end t))) (should (equal result 7))) (let ((result (cl-find-if (lambda (n) (= n 4)) '(1 2 3 4 5) :key 'identity))) (should (equal result 4)))) (ert-deftest cl-find-if-not-test () - (let ((result (cl-find-if-not #'evenp '(1 2 3 4 5)))) + (let ((result (cl-find-if-not #'cl-evenp '(1 2 3 4 5)))) (should (equal result 1))) - (let ((result (cl-find-if-not #'oddp '(1 3 5)))) + (let ((result (cl-find-if-not #'cl-oddp '(1 3 5)))) (should (equal result nil))) (let ((result (cl-find-if-not #'(lambda (n) (< n 4)) '(1 2 3 4 5 6 7)))) (should (equal result 4))) - (let ((result (cl-find-if-not #'evenp '(1 2 3 4 5) :start 2))) + (let ((result (cl-find-if-not #'cl-evenp '(1 2 3 4 5) :start 2))) (should (equal result 3))) - (let ((result (cl-find-if-not #'evenp '(1 2 3 4 5) :end 3))) + (let ((result (cl-find-if-not #'cl-evenp '(1 2 3 4 5) :end 3))) (should (equal result 1))) - (let ((result (cl-find-if-not #'oddp '(2 4 6 7 8) :from-end t))) + (let ((result (cl-find-if-not #'cl-oddp '(2 4 6 7 8) :from-end t))) (should (equal result 8))) (let ((result (cl-find-if-not (lambda (n) (= n 4)) '(1 2 3 4 5) :key 'identity))) (should (equal result 1)))) @@ -357,17 +357,17 @@ Body are forms defining the test." (should (= 5 (cl-position 5 list :key (lambda (x) (1+ (* x x))) :from-end t))))) (ert-deftest cl-position-if-test () - (let ((result (cl-position-if #'evenp '(1 2 3 4 5)))) + (let ((result (cl-position-if #'cl-evenp '(1 2 3 4 5)))) (should (equal result 1))) (let ((result (cl-position-if #'(lambda (n) (> n 5)) '(1 2 3 4 5)))) (should (equal result nil))) (let ((result (cl-position-if #'(lambda (n) (> n 3)) '(1 2 3 4 5 6 7)))) (should (equal result 3))) - (let ((result (cl-position-if #'evenp '(1 2 3 4 5) :start 2))) + (let ((result (cl-position-if #'cl-evenp '(1 2 3 4 5) :start 2))) (should (equal result 3))) - (let ((result (cl-position-if #'evenp '(1 2 3 4 5) :end 1))) + (let ((result (cl-position-if #'cl-evenp '(1 2 3 4 5) :end 1))) (should (equal result nil))) - (let ((result (cl-position-if #'oddp '(2 4 5 6 7) :from-end t))) + (let ((result (cl-position-if #'cl-oddp '(2 4 5 6 7) :from-end t))) (should (equal result 4))) (let ((result (cl-position-if (lambda (n) (= n 4)) '(1 2 3 4 5) :key 'identity))) (should (equal result 3)))) @@ -386,9 +386,9 @@ Body are forms defining the test." (cl-count 'foo list :test-not (lambda (_a b) (cl-evenp b))))))) (ert-deftest cl-count-if-test () - (let ((result (cl-count-if #'evenp '(1 2 3 4 5)))) + (let ((result (cl-count-if #'cl-evenp '(1 2 3 4 5)))) (should (equal result 2))) - (let ((result (cl-count-if #'oddp '(2 4 6 8)))) + (let ((result (cl-count-if #'cl-oddp '(2 4 6 8)))) (should (equal result 0))) (let ((result (cl-count-if (lambda (x) t) '(1 2 3 4)))) (should (equal result 4))) @@ -396,11 +396,11 @@ Body are forms defining the test." (should (equal result 0))) (let ((result (cl-count-if #'(lambda (x) (> x 2)) '(1 2 3 4 5) :key 'identity))) (should (equal result 3))) - (let ((result (cl-count-if #'evenp '(1 2 3 4 5) :start 2))) + (let ((result (cl-count-if #'cl-evenp '(1 2 3 4 5) :start 2))) (should (equal result 1))) - (let ((result (cl-count-if #'evenp '(1 2 3 4 5) :end 3))) + (let ((result (cl-count-if #'cl-evenp '(1 2 3 4 5) :end 3))) (should (equal result 1))) - (let ((result (cl-count-if #'evenp '()))) + (let ((result (cl-count-if #'cl-evenp '()))) (should (equal result 0))) (let ((result (cl-count-if #'(lambda (x) (numberp x)) '(1 "two" 3 4 "five" 6)))) (should (equal result 4))) @@ -408,9 +408,9 @@ Body are forms defining the test." (should (equal result 4)))) (ert-deftest cl-count-if-not-test () - (let ((result (cl-count-if-not #'evenp '(1 2 3 4 5)))) + (let ((result (cl-count-if-not #'cl-evenp '(1 2 3 4 5)))) (should (equal result 3))) - (let ((result (cl-count-if-not #'oddp '(1 3 5)))) + (let ((result (cl-count-if-not #'cl-oddp '(1 3 5)))) (should (equal result 0))) (let ((result (cl-count-if-not (lambda (x) t) '(1 2 3 4)))) (should (equal result 0))) @@ -418,11 +418,11 @@ Body are forms defining the test." (should (equal result 4))) (let ((result (cl-count-if-not #'(lambda (x) (> x 3)) '(1 2 3 4 5) :key 'identity))) (should (equal result 3))) - (let ((result (cl-count-if-not #'evenp '(1 2 3 4 5) :start 2))) + (let ((result (cl-count-if-not #'cl-evenp '(1 2 3 4 5) :start 2))) (should (equal result 2))) - (let ((result (cl-count-if-not #'evenp '(1 2 3 4 5) :end 3))) + (let ((result (cl-count-if-not #'cl-evenp '(1 2 3 4 5) :end 3))) (should (equal result 2))) - (let ((result (cl-count-if-not #'evenp '()))) + (let ((result (cl-count-if-not #'cl-evenp '()))) (should (equal result 0))) (let ((result (cl-count-if-not #'(lambda (x) (numberp x)) '(1 "two" 3 4 "five" 6)))) (should (equal result 2))) @@ -584,7 +584,7 @@ Body are forms defining the test." (should (equal result '(2 3 4 5))))) (ert-deftest cl-member-if-test () - (let ((result (cl-member-if #'evenp '(1 2 3 4 5)))) + (let ((result (cl-member-if #'cl-evenp '(1 2 3 4 5)))) (should (equal result '(2 3 4 5)))) (let ((result (cl-member-if #'(lambda (x) nil) '(1 2 3 4 5)))) (should (equal result nil))) @@ -592,13 +592,13 @@ Body are forms defining the test." (should (equal result '(1 2 3 4 5)))) (let ((result (cl-member-if #'(lambda (x) (= x 1)) '(1 2 3 4 5)))) (should (equal result '(1 2 3 4 5)))) - (let ((result (cl-member-if #'(lambda (x) (and (numberp x) (evenp x))) '(1 3 5 4 2)))) + (let ((result (cl-member-if #'(lambda (x) (and (numberp x) (cl-evenp x))) '(1 3 5 4 2)))) (should (equal result '(4 2)))) (let ((result (cl-member-if (lambda (x) (string= (number-to-string x) "3")) '(1 2 3 4 5) :key 'identity))) (should (equal result '(3 4 5)))) (let ((result (cl-member-if #'(lambda (x) (eq x 'a)) '(a a a a)))) (should (equal result '(a a a a)))) - (let ((result (cl-member-if #'evenp '()))) + (let ((result (cl-member-if #'cl-evenp '()))) (should (equal result nil))) (let ((result (cl-member-if #'(lambda (x) (< x 0)) '(1 2 3 4 5)))) (should (equal result nil))) @@ -608,9 +608,9 @@ Body are forms defining the test." (should (equal result '(6 7 8))))) (ert-deftest cl-member-if-not-test () - (let ((result (cl-member-if-not #'evenp '(1 2 3 4 5)))) + (let ((result (cl-member-if-not #'cl-evenp '(1 2 3 4 5)))) (should (equal result '(1 2 3 4 5)))) - (let ((result (cl-member-if-not #'evenp '(2 4 6 8 10 11)))) + (let ((result (cl-member-if-not #'cl-evenp '(2 4 6 8 10 11)))) (should (equal result '(11)))) (let ((result (cl-member-if-not #'(lambda (x) (> x 5)) '(1 2 3 4 5)))) (should (equal result '(1 2 3 4 5)))) @@ -620,7 +620,7 @@ Body are forms defining the test." (should (equal result '(2 3 4 5)))) (let ((result (cl-member-if-not (lambda (x) (string= (number-to-string x) "2")) '(1 2 3 4 5) :key 'identity))) (should (equal result '(1 2 3 4 5)))) - (let ((result (cl-member-if-not #'evenp '()))) + (let ((result (cl-member-if-not #'cl-evenp '()))) (should (equal result nil))) (let ((result (cl-member-if-not #'(lambda (x) (eq x 'a)) '(a a a a)))) (should (equal result nil))) @@ -650,7 +650,7 @@ Body are forms defining the test." (should (equal result '(b . 2))))) (ert-deftest cl-assoc-if-test () - (let ((result (cl-assoc-if #'evenp '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even"))))) + (let ((result (cl-assoc-if #'cl-evenp '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even"))))) (should (equal result '(2 . "even")))) (let ((result (cl-assoc-if #'(lambda (x) (= x 5)) '((1 . "one") (2 . "two") (3 . "three"))))) (should (equal result nil))) @@ -662,7 +662,7 @@ Body are forms defining the test." (should (equal result '(3 . "three")))) (let ((result (cl-assoc-if #'(lambda (x) (> x 1)) '((0 . "zero") (1 . "one") (2 . "two"))))) (should (equal result '(2 . "two")))) - (let ((result (cl-assoc-if #'evenp '()))) + (let ((result (cl-assoc-if #'cl-evenp '()))) (should (equal result nil))) (let ((result (cl-assoc-if #'(lambda (x) (eq x 'a)) '((a . "first") (a . "second") (b . "third"))))) (should (equal result '(a . "first")))) @@ -672,7 +672,7 @@ Body are forms defining the test." (should (equal result '((1 2) . "pair 1"))))) (ert-deftest cl-assoc-if-not-test () - (let ((result (cl-assoc-if-not #'evenp '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even"))))) + (let ((result (cl-assoc-if-not #'cl-evenp '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even"))))) (should (equal result '(1 . "odd")))) (let ((result (cl-assoc-if-not #'(lambda (x) (> x 0)) '((1 . "one") (2 . "two") (3 . "three"))))) (should (equal result nil))) @@ -686,7 +686,7 @@ Body are forms defining the test." (should (equal result '(1 . "one")))) (let ((result (cl-assoc-if-not #'(lambda (x) (symbolp x)) '((1 . "one") (b . "bee") (2 . "two"))))) (should (equal result '(1 . "one")))) - (let ((result (cl-assoc-if-not #'evenp '()))) + (let ((result (cl-assoc-if-not #'cl-evenp '()))) (should (equal result nil))) (let ((result (cl-assoc-if-not #'(lambda (x) (eq x 'a)) '((a . "first") (a . "second") (b . "third"))))) (should (equal result '(b . "third"))))) @@ -710,9 +710,9 @@ Body are forms defining the test." (should (equal result nil)))) (ert-deftest cl-rassoc-if-test () - (let ((result (cl-rassoc-if #'evenp '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (let ((result (cl-rassoc-if #'cl-evenp '(( "one" . 1) ("two" . 2) ("three" . 3))))) (should (equal result '("two" . 2)))) - (let ((result (cl-rassoc-if #'evenp '(( "one" . 1) ("three" . 3) ("five" . 5))))) + (let ((result (cl-rassoc-if #'cl-evenp '(( "one" . 1) ("three" . 3) ("five" . 5))))) (should (equal result nil))) (let ((result (cl-rassoc-if #'(lambda (x) (= x 1)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) (should (equal result '("one" . 1)))) @@ -720,7 +720,7 @@ Body are forms defining the test." (should (equal result '("two" . 2)))) (let ((result (cl-rassoc-if #'(lambda (x) (and (numberp x) (< x 3))) '(( "one" . 1) ("two" . 2) ("three" . 3))))) (should (equal result '("one" . 1)))) - (let ((result (cl-rassoc-if #'evenp '()))) + (let ((result (cl-rassoc-if #'cl-evenp '()))) (should (equal result nil))) (let ((result (cl-rassoc-if #'(lambda (x) (> x 0)) '(( "first" . 1) ("second" . 2) ("third" . 3))))) (should (equal result '("first" . 1)))) @@ -730,7 +730,7 @@ Body are forms defining the test." (should (equal result nil)))) (ert-deftest cl-rassoc-if-not-test () - (let ((result (cl-rassoc-if-not #'evenp '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (let ((result (cl-rassoc-if-not #'cl-evenp '(( "one" . 1) ("two" . 2) ("three" . 3))))) (should (equal result '("one" . 1)))) (let ((result (cl-rassoc-if-not #'(lambda (x) (> x 0)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) (should (equal result nil))) @@ -744,7 +744,7 @@ Body are forms defining the test." (should (equal result '("three" . 3)))) (let ((result (cl-rassoc-if-not #'(lambda (x) (equal x 2)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) (should (equal result '("one" . 1)))) - (let ((result (cl-rassoc-if-not #'evenp '()))) + (let ((result (cl-rassoc-if-not #'cl-evenp '()))) (should (equal result nil))) (let ((result (cl-rassoc-if-not #'(lambda (x) (numberp x)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) (should (equal result nil))) commit 103ae72ee9f197943265b76590cbad1d6e08a9b5 Author: Ahmed Khanzada Date: Fri Jan 17 09:48:57 2025 -0500 New unit-tests for cl-lib (bug#75633). diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el index b74e79aa9e0..dc1a52c9716 100644 --- a/test/lisp/emacs-lisp/cl-extra-tests.el +++ b/test/lisp/emacs-lisp/cl-extra-tests.el @@ -29,6 +29,33 @@ (should (eq (cl-get 'cl-get-test 'y :none) nil)) (should (eq (cl-get 'cl-get-test 'z :none) :none))) +(ert-deftest cl-extra-test-coerce () + (should (equal (cl-coerce "abc" 'list) '(?a ?b ?c))) + (should (equal (cl-coerce ["a" "b" "c"] 'list) '("a" "b" "c"))) + (should (equal (cl-coerce "abc" 'vector) [97 98 99])) + (should (equal (cl-coerce '("a" "b" "c") 'vector) ["a" "b" "c"])) + (should (equal (cl-coerce '(3 4) 'bool-vector) #&2"")) + (should (equal (cl-coerce "abc" 'bool-vector) #&3"")) + (should (equal (cl-coerce [1] 'string) (char-to-string 1))) + (should (equal (cl-coerce '(1) 'string) (char-to-string 1))) + (should (equal (cl-coerce '(1 2 3) 'array) [1 2 3])) + (should (equal (cl-coerce "abc" 'array) "abc")) + (should-error (cl-coerce (list 1 2 3) 'character)) + (should-error (cl-coerce [1 2 3] 'character)) + (should-error (cl-coerce "abc" 'character)) + (should (equal (cl-coerce "a" 'character) 97)) + (should (equal (cl-coerce 'a 'character) 97))) + +(ert-deftest cl-extra-test-equalp () + (should (cl-equalp "Test" "test")) + (should (cl-equalp 1 1.0)) + (should (cl-equalp '(1 2 3) '(1 2 3))) + (should (cl-equalp [1 2 3] [1 2 3])) + (should-not (cl-equalp "Test1" "Test2")) + (should-not (cl-equalp 1 2)) + (should-not (cl-equalp '(1 2 3) '(4 5 6))) + (should-not (cl-equalp [1 2 3] [4 5 6]))) + (ert-deftest cl-getf () (let ((plist '(x 1 y nil))) (should (eq (cl-getf plist 'x) 1)) @@ -127,4 +154,154 @@ (should (equal (cl-concatenate 'string "123" "456") "123456"))) +(ert-deftest cl-extra-test-mapcan () + (should (equal (cl-mapcan #'list '(1 2 3)) '(1 2 3))) + (should (equal (cl-mapcan #'list '(1 2 3) '(4 5 6)) '(1 4 2 5 3 6))) + (should (equal (cl-mapcan #'list '(1 2) '(3 4 5)) '(1 3 2 4))) + (should (equal (cl-mapcan #'list '(1 2 3) "#$%") '(1 ?# 2 ?$ 3 ?%))) + (should (equal (cl-mapcan #'list '()) '())) + (should (equal (cl-mapcan #'list '() '()) '()))) + +(ert-deftest cl-extra-test-mapcon () + (should (equal (cl-mapcon #'list '(1 2 3)) '((1 2 3) (2 3) (3)))) + (should (equal (cl-mapcon #'list '()) nil)) + (should (equal (cl-mapcon #'list '() '()) nil))) + +(ert-deftest cl-extra-test-some () + (should (equal (cl-some #'identity (list nil nil "foo")) "foo")) + (should (equal (cl-some #'identity [nil nil nil]) nil)) + (should (equal (cl-some (lambda (a b) (> (+ a b) 198)) (list ?a ?b ?c) "abcz") nil)) + (should (equal (cl-some (lambda (a b) (> (+ a b) 198)) (list ?a ?b ?c) "abz") t))) + +(ert-deftest cl-extra-test-every () + (should (equal (cl-every #'identity (list t 42 "foo")) t)) + (should (equal (cl-every #'identity [t nil "foo"]) nil)) + (should (equal (cl-every (lambda (a b) (<= (+ a b) 198)) + (list ?a ?b ?c) "abcz") + t)) + (should (equal (cl-every (lambda (a b) (<= (+ a b) 198)) + (list ?a ?b ?c) "abz") + nil))) + +(ert-deftest cl-extra-test-notany () + (should (equal (cl-notany #'oddp '(1 3 5)) nil)) + (should (equal (cl-notany #'oddp '(2 4 6)) t)) + (should (equal (cl-notany #'oddp '(1 2 3 4 5)) nil))) + +(ert-deftest cl-extra-test-notevery () + (should (equal (cl-notevery #'oddp '(1 3 5)) nil)) + (should (equal (cl-notevery #'oddp '(2 4 6)) t)) + (should (equal (cl-notevery #'oddp '(1 2 3 4 5)) t))) + +(ert-deftest cl-extra-test-gcd () + (should (equal (cl-gcd 4) 4)) + (should (equal (cl-gcd 3 5) 1)) + (should (equal (cl-gcd 4 8) 4)) + (should (equal (cl-gcd 3 5 7) 1)) + (should (equal (cl-gcd 4 8 12) 4)) + (should (equal (cl-gcd 0) 0)) + (should (equal (cl-gcd 4 0) 4)) + (should (equal (cl-gcd 0 0) 0))) + +(ert-deftest cl-extra-test-lcm () + (should (equal (cl-lcm 4) 4)) + (should (equal (cl-lcm 3 5) 15)) + (should (equal (cl-lcm 4 8) 8)) + (should (equal (cl-lcm 3 5 7) 105)) + (should (equal (cl-lcm 4 8 12) 24)) + (should (equal (cl-lcm 0 4) 0)) + (should (equal (cl-lcm 0 0) 0)) + (should (equal (cl-lcm) 1))) + +(ert-deftest cl-extra-test-isqrt () + (should (equal (cl-isqrt 4) 2)) + (should (equal (cl-isqrt 100) 10)) + (should (equal (cl-isqrt 1) 1)) + (should (equal (cl-isqrt 0) 0)) + (should (equal (cl-isqrt 3) 1)) + (should (equal (cl-isqrt 10) 3)) + (should-error (cl-isqrt -4)) + (should-error (cl-isqrt 2.5))) + +(ert-deftest cl-extra-test-floor () + (should (equal (cl-floor 4.5) '(4 0.5))) + (should (equal (cl-floor 10 3) '(3 1)))) + +(ert-deftest cl-extra-test-ceiling () + (should (equal (cl-ceiling 4.5) '(5 -0.5))) + (should (equal (cl-ceiling 10 3) '(4 -2)))) + +(ert-deftest cl-extra-test-truncate () + (should (equal (cl-truncate 4.5) '(4 0.5))) + (should (equal (cl-truncate 10 3) '(3 1)))) + +(ert-deftest cl-extra-test-round () + (should (equal (cl-round 4.5) '(4 0.5))) + (should (equal (cl-round 10 3) '(3 1))) + (should (equal (cl-round 1.5) '(2 -0.5))) + (should (equal (cl-round 2.5) '(2 0.5)))) + +(ert-deftest cl-extra-test-mod () + (should (equal (cl-mod 10 3) 1)) + (should (equal (cl-mod -10 -3) -1)) + (should (equal (cl-mod -10 3) 2)) + (should (equal (cl-mod 10 -3) -2))) + +(ert-deftest cl-extra-test-rem () + (should (equal (cl-rem 10 3) 1)) + (should (equal (cl-rem -10 -3) -1)) + (should (equal (cl-rem -10 3) -1)) + (should (equal (cl-rem 10 -3) 1))) + +(ert-deftest cl-extra-test-signum () + (should (equal (cl-signum 10) 1)) + (should (equal (cl-signum -10) -1)) + (should (equal (cl-signum 0) 0))) + +(ert-deftest cl-extra-test-parse-integer () + (should (equal (cl-parse-integer "10") 10)) + (should (equal (cl-parse-integer "-10") -10)) + (should (equal (cl-parse-integer "+10") 10)) + (should (equal (cl-parse-integer "ff" :radix 16) 255)) + (should (equal (cl-parse-integer "11" :start 1) 1)) + (should (equal (cl-parse-integer "abc def" :end 3 :junk-allowed t) nil))) + +(ert-deftest cl-extra-test-subseq () + (should (equal (cl-subseq "hello" 1) "ello")) + (should (equal (cl-subseq "hello" 1 4) "ell")) + (should (equal (cl-subseq "hello" -1) "o")) + (should (equal (cl-subseq "hello world" -5 -1) "worl")) + (should (equal (cl-subseq '(1 2 3 4 5) 2) '(3 4 5))) + (should (equal (cl-subseq '(1 2 3 4 5) 1 3) '(2 3)))) + +(ert-deftest cl-extra-test-concatenate () + (should (equal (cl-concatenate 'string "hello " "world") "hello world")) + (should (equal (cl-concatenate 'list '(1 2) '(3 4) '(5 6)) '(1 2 3 4 5 6)))) + +(ert-deftest cl-extra-test-revappend () + (should (equal (cl-revappend '(1 2 3) '(4 5 6)) '(3 2 1 4 5 6)))) + +(ert-deftest cl-extra-test-nreconc () + (should (equal (cl-nreconc '(1 2 3) '(4 5 6)) '(3 2 1 4 5 6)))) + +(ert-deftest cl-extra-test-list-length () + (should (equal (cl-list-length '(1 2 3)) 3)) + (should (equal (cl-list-length '()) 0)) + (let ((xl (number-sequence 1 100))) + (setcdr (nthcdr 99 xl) xl) + (should (equal (cl-list-length xl) nil)))) + +(ert-deftest cl-extra-test-tailp () + (let ((l '(1 2 3 4 5))) + (should (cl-tailp (nthcdr 2 l) l)) + (should (cl-tailp l l)) + (should (not (cl-tailp '(4 5) l))))) + +(ert-deftest cl-extra-test-remprop () + (let ((sym (make-symbol "test"))) + (put sym 'foo 'bar) + (should (equal (cl-get sym 'foo) 'bar)) + (cl-remprop sym 'foo) + (should (equal (cl-get sym 'foo 'default) 'default)))) + ;;; cl-extra-tests.el ends here diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index a9c71fa5808..ff860d94468 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el @@ -242,6 +242,42 @@ (should (= (cl-the integer (cl-incf side-effect)) 1)) (should (= side-effect 1)))) +(ert-deftest cl-lib-test-pushnew () + (let ((list '(1 2 3))) + (cl-pushnew 0 list) + (should (equal list '(0 1 2 3)))) + (let ((list '((1 2) (3 4)))) + (cl-pushnew '(3 7) list :key #'cdr) + (should (equal list '((3 7) (1 2) (3 4)) ))) + (let ((list '((1 2) (3 4)))) + (cl-pushnew '(3 7) list :key #'car) + (should (equal list '((1 2) (3 4))))) + (let ((list '((1 2) (3 4)))) + (cl-pushnew '(3 4) list :test #'equal) + (should (equal list '((1 2) (3 4))))) + (let ((list '((1 2) (3 4)))) + (cl-pushnew '(3 5) list :test #'equal) + (should (equal list '((3 5) (1 2) (3 4))))) + (let ((list '((1 2) (3 4)))) + (cl-pushnew '(3 4) list :test-not #'equal) + (should (equal list '((1 2) (3 4))))) + (let ((list '((1 2) (3 4)))) + (cl-pushnew '(3 5) list :test-not #'equal) + (should (equal list '((1 2) (3 4)))))) + +(ert-deftest cl-lib-test-values-list () + (let ((list '(:a :b :c))) + (should (equal (cl-values-list list) '(:a :b :c)))) + (let ((not-a-list :a)) + (should-error (cl-values-list not-a-list) :type 'wrong-type-argument))) + +(ert-deftest cl-lib-multiple-value-list () + (should (equal (cl-multiple-value-list 1) 1)) + (should (equal (cl-multiple-value-list '(1 2 3)) '(1 2 3))) + (should (equal (cl-multiple-value-list "string") "string")) + (should (equal (cl-multiple-value-list nil) nil)) + (should (equal (cl-multiple-value-list (list 1 2 3)) '(1 2 3)))) + (ert-deftest cl-lib-test-incf () (let ((var 0)) (should (= (cl-incf var) 1)) @@ -388,6 +424,50 @@ (should (= 10 (cl-tenth '(1 2 3 4 5 6 7 8 9 10 11)))) (should-error (cl-tenth "1234567890") :type 'wrong-type-argument)) +(ert-deftest cl-lib-test-mapcar () + (should (equal (cl-mapcar #'1+ '(1 2 3)) '(2 3 4))) + (should (equal (cl-mapcar #'+ '(1 2 3) '(4 5 6)) '(5 7 9))) + (should (equal (cl-mapcar #'+ '(1 2 3) '(4 5)) '(5 7))) + (should (equal (cl-mapcar #'+ '() '()) '())) + (should-error (cl-mapcar #'+ 1 '(4 5 6))) + (should-error (cl-mapcar #'+ '(1 2 3) 4))) + +(ert-deftest cl-lib-test-list* () + (should (equal (cl-list* 'a) 'a)) + (should (equal (cl-list* 'a 'b) '(a . b))) + (should (equal (cl-list* 'a 'b 'c 'd) '(a b c . d))) + (should (equal (cl-list* 'a 'b '(c d)) '(a b c d)))) + +(ert-deftest cl-lib-test-copy-list () + (let ((original '(1 2 . 3)) + (result (cl-copy-list '(1 2 . 3)))) + (and (should (equal original result)) + (not (eq original result))))) + +(ert-deftest cl-lib-test-subst () + (should (equal (cl-subst 'x 'a '(a b c)) '(x b c))) + (should (equal (cl-subst 'x 'a '(a b a c)) '(x b x c))) + (should (equal (cl-subst 'x 'a '(b c d)) '(b c d))) + (should (equal (cl-subst 'x 'a '(a b (a c) d)) '(x b (x c) d))) + (should (equal (cl-subst "a" "A" '("a" "b" "c" "a") :test #'equal) '("a" "b" "c" "a")))) + +(ert-deftest cl-lib-test-acons () + (should (equal (cl-acons 'key 'value '()) '((key . value)))) + (should (equal (cl-acons 'key 'value '((a . 1) (b . 2))) '((key . value) (a . 1) (b . 2)))) + (should (equal (cl-acons 'a 1 '((a . 1) (b . 2))) '((a . 1) (a . 1) (b . 2)))) + (should (equal (cl-acons nil 'value '((a . 1) (b . 2))) '((nil . value) (a . 1) (b . 2)))) + (should (equal (cl-acons 'key nil '((a . 1) (b . 2))) '((key . nil) (a . 1) (b . 2))))) + +(ert-deftest cl-lib-test-pairlis () + (should (equal (cl-pairlis '(a b c) '(1 2 3)) '((a . 1) (b . 2) (c . 3)))) + (should (equal (cl-pairlis '(a b c d) '(1 2 3)) '((a . 1) (b . 2) (c . 3)))) + (should (equal (cl-pairlis '(a b c) '(1 2 3 4)) '((a . 1) (b . 2) (c . 3)))) + (should (equal (cl-pairlis '(a b c) '(1 2 3) '((d . 4) (e . 5))) '((a . 1) (b . 2) (c . 3) (d . 4) (e . 5)))) + (should (equal (cl-pairlis '() '(1 2 3)) '())) + (should (equal (cl-pairlis '(a b c) '()) '())) + (should (equal (cl-pairlis '(a nil c) '(1 2 3)) '((a . 1) (nil . 2) (c . 3)))) + (should (equal (cl-pairlis '(a b c) '(1 nil 3)) '((a . 1) (b) (c . 3))))) + (ert-deftest cl-lib-test-endp () (should (cl-endp '())) (should-not (cl-endp '(1))) @@ -558,5 +638,37 @@ (should (equal (mapcar (cl-constantly 3) '(a b c d)) '(3 3 3 3)))) +(ert-deftest cl-lib-set-difference () + ;; our set-difference preserves order, though it is not required to + ;; by cl standards. Nevertheless better keep that invariant + (should (equal (cl-set-difference '(1 2 3 4) '(3 4 5 6)) + '(1 2)))) + +(ert-deftest cl-nset-difference () + ;; our nset-difference doesn't + (let* ((l1 (list 1 2 3 4)) (l2 '(3 4 5 6)) + (diff (cl-nset-difference l1 l2))) + (should (memq 1 diff)) + (should (memq 2 diff)) + (should (= (length diff) 2)) + (should (equal l2 '(3 4 5 6)))) + (let* ((l1 (list "1" "2" "3" "4")) (l2 '("3" "4" "5" "6")) + (diff (cl-nset-difference l1 l2 :test #'equal))) + (should (member "1" diff)) + (should (member "2" diff)) + (should (= (length diff) 2)) + (should (equal l2 '("3" "4" "5" "6")))) + (let* ((l1 (list '(a . 1) '(b . 2) '(c . 3) '(d . 4))) + (l2 (list '(c . 3) '(d . 4) '(e . 5) '(f . 6))) + (diff (cl-nset-difference l1 l2 :key #'car))) + (should (member '(a . 1) diff)) + (should (member '(b . 2) diff)) + (should (= (length diff) 2))) + (let* ((l1 (list '("a" . 1) '("b" . 2) '("c" . 3) '("d" . 4))) + (l2 (list '("c" . 3) '("d" . 4) '("e" . 5) '("f" . 6))) + (diff (cl-nset-difference l1 l2 :key #'car :test #'string=))) + (should (member '("a" . 1) diff)) + (should (member '("b" . 2) diff)) + (should (= (length diff) 2)))) ;;; cl-lib-tests.el ends here diff --git a/test/lisp/emacs-lisp/cl-seq-tests.el b/test/lisp/emacs-lisp/cl-seq-tests.el index 9c62379d857..59ece0e4006 100644 --- a/test/lisp/emacs-lisp/cl-seq-tests.el +++ b/test/lisp/emacs-lisp/cl-seq-tests.el @@ -59,6 +59,22 @@ Body are forms defining the test." (when ,list2 (setq cl-seq--test-list2 ,orig2)))))) +(ert-deftest cl-seq-endp-test () + (should (cl-endp '())) + (should (not (cl-endp '(1 2 3)))) + (should-error (cl-endp 42) :type 'wrong-type-argument)) + +(ert-deftest cl-seq-reduce-test () + (should (equal 6 (cl-reduce #'+ '(1 2 3)))) + (should (equal 5 (cl-reduce #'+ '(1 2 3 4) :start 1 :end 3))) + (should (equal 10 (cl-reduce #'+ '(1 2 3 4) :from-end t))) + (should (equal 10 (cl-reduce #'+ '(1 2 3 4) :initial-value 0))) + (should (equal 24 (cl-reduce #'* '(1 2 3 4) :initial-value 1))) + (should (equal 0 (cl-reduce #'+ '()))) + (should (equal 0 (cl-reduce #'+ '() :initial-value 0))) + (should (equal 1 (cl-reduce #'+ '(1)))) + (should (equal 0 (cl-reduce #'+ '() :initial-value 0)))) + ;; keywords supported: :start :end (ert-deftest cl-seq-fill-test () (let* ((cl-seq--test-list '(1 2 3 4 5 2 6)) @@ -116,6 +132,25 @@ Body are forms defining the test." (should (equal '(1 3 4 5 2 6) (cl-remove 2 list :from-end nil :count 1))) (should (equal '(1 2 3 4 5 6) (cl-remove 2 list :from-end t :count 1))))) +(ert-deftest cl-remove-if-test () + (should (equal '(1 3) (cl-remove-if 'evenp '(1 2 3 4)))) + (should (equal '(1 3) (cl-remove-if 'evenp '(1 2 3 4) :count 2))) + (should (equal '(1 3 4) (cl-remove-if 'evenp '(1 2 3 4) :start 1 :end 3))) + (should (equal '(1 3) (cl-remove-if 'evenp '(1 2 3 4) :from-end t))) + (should (equal '(2 4) (cl-remove-if 'oddp '(1 2 3 4)))) + (should (equal '() (cl-remove-if 'evenp '()))) + (should (equal '() (cl-remove-if 'evenp '(2))))) + +(ert-deftest cl-remove-if-not-test () + (should (equal '(2 4) (cl-remove-if-not 'evenp '(1 2 3 4)))) + (should (equal '(2 4) (cl-remove-if-not 'evenp '(1 2 3 4) :count 2))) + (should (equal '(1 2 4) (cl-remove-if-not 'evenp '(1 2 3 4) :start 1 :end 3))) + (should (equal '(2 4) (cl-remove-if-not 'evenp '(1 2 3 4) :from-end t))) + (should (equal '(1 3) (cl-remove-if-not 'oddp '(1 2 3 4)))) + (should (equal '() (cl-remove-if-not 'evenp '()))) + (should (equal '(2) (cl-remove-if-not 'evenp '(2)))) + (should (equal '(2) (cl-remove-if-not 'evenp '(2) :key #'(lambda (x) (- x)))))) + ;; keywords supported: :test :test-not :key :count :start :end :from-end (ert-deftest cl-seq-delete-test () (let* ((cl-seq--test-list '(1 2 3 4 5 2 6)) @@ -139,6 +174,27 @@ Body are forms defining the test." (cl-seq--with-side-effects orig nil test))))) +(ert-deftest cl-delete-if-test () + (let ((list (list 1 2 3 4 5))) + (cl-delete-if 'evenp list) + (should (equal '(1 3 5) list)) + (should (equal '(1 3 5) (cl-delete-if 'evenp (list 1 2 3 4 5) :start 0 :end 4))) + (should (equal '(1 3 5) (cl-delete-if 'evenp (list 1 2 3 4 5) :from-end t))) + (should (equal '(2 4) (cl-delete-if 'oddp (list 1 2 3 4 5)))) + (should (equal '() (cl-delete-if 'evenp '()))) + (should (equal '() (cl-delete-if 'evenp (list 2)))))) + +(ert-deftest cl-delete-if-not-test () + (let ((list (list 1 2 3 4 5))) + (should (equal '(2 4) (cl-delete-if-not 'evenp list))) + (should (equal '() (cl-delete-if-not 'evenp '()))) + (should (equal '() (cl-delete-if-not 'evenp (list 1)))))) + +(ert-deftest cl-delete-duplicates-test () + (let ((list (list 1 2 3 2 1))) + (should (equal '(3 2 1) (cl-delete-duplicates list))) + (should (equal '() (cl-delete-duplicates '()))))) + ;; keywords supported: :test :test-not :key :start :end :from-end (ert-deftest cl-seq-remove-duplicates-test () (let ((list '(1 2 3 4 5 2 6))) @@ -185,6 +241,65 @@ Body are forms defining the test." (should (equal '(b 2 3 4 5 2 6) (cl-substitute 'b nil list :if-not (lambda (x) (> (cl-position x list :from-end t) 1))))))) +(ert-deftest cl-seq-substitute-if-test () + (let ((result (cl-substitute-if 'x #'evenp '(1 2 3 4 5)))) + (should (equal result '(1 x 3 x 5)))) + (let ((result (cl-substitute-if 'x #'evenp '(1 3 5)))) + (should (equal result '(1 3 5)))) + (let ((result (cl-substitute-if 'x #'(lambda (n) t) '(1 2 3 4 5)))) + (should (equal result '(x x x x x)))) + (let ((result (cl-substitute-if 'x #'evenp '(1 2 3 4 5) :start 1 :end 4))) + (should (equal result '(1 x 3 x 5)))) + (let ((result (cl-substitute-if 'x #'oddp '(1 2 3 4 5) :from-end t))) + (should (equal result '(x 2 x 4 x)))) + (let ((result (cl-substitute-if 'x (lambda (n) (= n 3)) '(1 2 3 4 5) :key 'identity))) + (should (equal result '(1 2 x 4 5))))) + +(ert-deftest cl-seq-substitute-if-not-test () + (let ((result (cl-substitute-if-not 'x #'evenp '(1 2 3 4 5)))) + (should (equal result '(x 2 x 4 x)))) + (let ((result (cl-substitute-if-not 'x #'evenp '(2 4 6)))) + (should (equal result '(2 4 6)))) + (let ((result (cl-substitute-if-not 'x #'(lambda (n) (> n 5)) '(1 2 3 4 5)))) + (should (equal result '(x x x x x)))) + (let ((result (cl-substitute-if-not 'x #'evenp '(1 2 3 4 5) :start 0 :end 4))) + (should (equal result '(x 2 x 4 5)))) + (let ((result (cl-substitute-if-not 'x #'oddp '(1 2 3 4 5) :from-end t))) + (should (equal result '(1 x 3 x 5)))) + (let ((result (cl-substitute-if-not 'x (lambda (n) (= n 3)) '(1 2 3 4 5) :key 'identity))) + (should (equal result '(x x 3 x x))))) + +(ert-deftest cl-find-if-test () + (let ((result (cl-find-if #'evenp '(1 2 3 4 5)))) + (should (equal result 2))) + (let ((result (cl-find-if #'(lambda (n) (> n 5)) '(1 2 3 4 5)))) + (should (equal result nil))) + (let ((result (cl-find-if #'(lambda (n) (> n 3)) '(1 2 3 4 5 6 7)))) + (should (equal result 4))) + (let ((result (cl-find-if #'evenp '(1 2 3 4 5) :start 2))) + (should (equal result 4))) + (let ((result (cl-find-if #'evenp '(1 2 3 4 5) :end 1))) + (should (equal result nil))) + (let ((result (cl-find-if #'oddp '(2 4 5 6 7) :from-end t))) + (should (equal result 7))) + (let ((result (cl-find-if (lambda (n) (= n 4)) '(1 2 3 4 5) :key 'identity))) + (should (equal result 4)))) + +(ert-deftest cl-find-if-not-test () + (let ((result (cl-find-if-not #'evenp '(1 2 3 4 5)))) + (should (equal result 1))) + (let ((result (cl-find-if-not #'oddp '(1 3 5)))) + (should (equal result nil))) + (let ((result (cl-find-if-not #'(lambda (n) (< n 4)) '(1 2 3 4 5 6 7)))) + (should (equal result 4))) + (let ((result (cl-find-if-not #'evenp '(1 2 3 4 5) :start 2))) + (should (equal result 3))) + (let ((result (cl-find-if-not #'evenp '(1 2 3 4 5) :end 3))) + (should (equal result 1))) + (let ((result (cl-find-if-not #'oddp '(2 4 6 7 8) :from-end t))) + (should (equal result 8))) + (let ((result (cl-find-if-not (lambda (n) (= n 4)) '(1 2 3 4 5) :key 'identity))) + (should (equal result 1)))) ;; keywords supported: :test :test-not :key :count :start :end :from-end (ert-deftest cl-seq-nsubstitute-test () @@ -221,7 +336,7 @@ Body are forms defining the test." (dolist (test tests) (let ((_list cl-seq--test-list)) (cl-seq--with-side-effects orig nil - test))))) + test))))) ;; keywords supported: :test :test-not :key :start :end :from-end (ert-deftest cl-seq-position-test () @@ -241,6 +356,22 @@ Body are forms defining the test." (should (= 1 (cl-position 5 list :key (lambda (x) (1+ (* x x)))))) (should (= 5 (cl-position 5 list :key (lambda (x) (1+ (* x x))) :from-end t))))) +(ert-deftest cl-position-if-test () + (let ((result (cl-position-if #'evenp '(1 2 3 4 5)))) + (should (equal result 1))) + (let ((result (cl-position-if #'(lambda (n) (> n 5)) '(1 2 3 4 5)))) + (should (equal result nil))) + (let ((result (cl-position-if #'(lambda (n) (> n 3)) '(1 2 3 4 5 6 7)))) + (should (equal result 3))) + (let ((result (cl-position-if #'evenp '(1 2 3 4 5) :start 2))) + (should (equal result 3))) + (let ((result (cl-position-if #'evenp '(1 2 3 4 5) :end 1))) + (should (equal result nil))) + (let ((result (cl-position-if #'oddp '(2 4 5 6 7) :from-end t))) + (should (equal result 4))) + (let ((result (cl-position-if (lambda (n) (= n 4)) '(1 2 3 4 5) :key 'identity))) + (should (equal result 3)))) + ;; keywords supported: :test :test-not :key :start :end (ert-deftest cl-seq-count-test () (let ((list '(1 2 3 4 5 2 6))) @@ -254,6 +385,50 @@ Body are forms defining the test." (should (equal (cl-count 'foo list :test (lambda (_a b) (cl-oddp b))) (cl-count 'foo list :test-not (lambda (_a b) (cl-evenp b))))))) +(ert-deftest cl-count-if-test () + (let ((result (cl-count-if #'evenp '(1 2 3 4 5)))) + (should (equal result 2))) + (let ((result (cl-count-if #'oddp '(2 4 6 8)))) + (should (equal result 0))) + (let ((result (cl-count-if (lambda (x) t) '(1 2 3 4)))) + (should (equal result 4))) + (let ((result (cl-count-if (lambda (x) nil) '(1 2 3 4)))) + (should (equal result 0))) + (let ((result (cl-count-if #'(lambda (x) (> x 2)) '(1 2 3 4 5) :key 'identity))) + (should (equal result 3))) + (let ((result (cl-count-if #'evenp '(1 2 3 4 5) :start 2))) + (should (equal result 1))) + (let ((result (cl-count-if #'evenp '(1 2 3 4 5) :end 3))) + (should (equal result 1))) + (let ((result (cl-count-if #'evenp '()))) + (should (equal result 0))) + (let ((result (cl-count-if #'(lambda (x) (numberp x)) '(1 "two" 3 4 "five" 6)))) + (should (equal result 4))) + (let ((result (cl-count-if (lambda (x) (and (numberp x) (> x 2))) '(1 2 3 4 5 6)))) + (should (equal result 4)))) + +(ert-deftest cl-count-if-not-test () + (let ((result (cl-count-if-not #'evenp '(1 2 3 4 5)))) + (should (equal result 3))) + (let ((result (cl-count-if-not #'oddp '(1 3 5)))) + (should (equal result 0))) + (let ((result (cl-count-if-not (lambda (x) t) '(1 2 3 4)))) + (should (equal result 0))) + (let ((result (cl-count-if-not (lambda (x) nil) '(1 2 3 4)))) + (should (equal result 4))) + (let ((result (cl-count-if-not #'(lambda (x) (> x 3)) '(1 2 3 4 5) :key 'identity))) + (should (equal result 3))) + (let ((result (cl-count-if-not #'evenp '(1 2 3 4 5) :start 2))) + (should (equal result 2))) + (let ((result (cl-count-if-not #'evenp '(1 2 3 4 5) :end 3))) + (should (equal result 2))) + (let ((result (cl-count-if-not #'evenp '()))) + (should (equal result 0))) + (let ((result (cl-count-if-not #'(lambda (x) (numberp x)) '(1 "two" 3 4 "five" 6)))) + (should (equal result 2))) + (let ((result (cl-count-if-not (lambda (x) (and (numberp x) (> x 2))) '(1 2 3 4 5 6)))) + (should (equal result 2)))) + ;; keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end (ert-deftest cl-seq-mismatch-test () (let ((list '(1 2 3 4 5 2 6)) @@ -312,5 +487,536 @@ Body are forms defining the test." (should (eq (cl-assoc x a) (car a))) (should (eq (cl-rassoc x a) (cadr a)))))) +(ert-deftest cl-sort-test () + (let ((result (cl-sort '(3 1 4 1 5 9 2 6 5 3 5) '<))) + (should (equal result '(1 1 2 3 3 4 5 5 5 6 9)))) + (let ((result (cl-sort '(5 3 2 8 1 4) '>))) + (should (equal result '(8 5 4 3 2 1)))) + (let ((result (cl-sort '("banana" "apple" "cherry") 'string<))) + (should (equal result '("apple" "banana" "cherry")))) + (let ((result (cl-sort '("banana" "fig" "apple" "kiwi") (lambda (x y) (< (length x) (length y))) :key 'identity))) + (should (equal result '("fig" "kiwi" "apple" "banana")))) + (let ((result (cl-sort (vector 3 1 4 1 5) '<))) + (should (equal result (vector 1 1 3 4 5)))) + (let ((result (cl-sort '(1 2 3 4 5) '<))) + (should (equal result '(1 2 3 4 5)))) + (let ((result (cl-sort '(-3 1 4 -1 -5 9) '<))) + (should (equal result '(-5 -3 -1 1 4 9)))) + (let ((result (cl-sort '(1 2 3 4 5) (lambda (x y) (> x y))))) + (should (equal result '(5 4 3 2 1)))) + (let ((result (cl-sort '() '<))) + (should (equal result '()))) + (let ((result (cl-sort '("Banana" "apple" "cherry") 'string< :key 'downcase))) + (should (equal result '("apple" "Banana" "cherry")))) ) + +(ert-deftest cl-stable-sort-test () + (let ((result (cl-stable-sort '(3 1 4 1 5 9 2 6 5 3 5) '<))) + (should (equal result '(1 1 2 3 3 4 5 5 5 6 9)))) + (let ((result (cl-stable-sort '(5 3 2 8 1 4) '>))) + (should (equal result '(8 5 4 3 2 1)))) + (let ((result (cl-stable-sort '("banana" "apple" "cherry") 'string<))) + (should (equal result '("apple" "banana" "cherry")))) + (let ((result (cl-stable-sort '("banana" "fig" "apple" "kiwi") (lambda (x y) (< (length x) (length y))) :key 'identity))) + (should (equal result '("fig" "kiwi" "apple" "banana")))) + (let ((result (cl-stable-sort (vector 3 1 4 1 5) '<))) + (should (equal result (vector 1 1 3 4 5)))) + (let ((result (cl-stable-sort '(1 2 3 4 5) '<))) + (should (equal result '(1 2 3 4 5)))) + (let ((result (cl-stable-sort '(-3 1 4 -1 -5 9) '<))) + (should (equal result '(-5 -3 -1 1 4 9)))) + (let ((result (cl-stable-sort '(1 2 3 4 5) (lambda (x y) (> x y))))) + (should (equal result '(5 4 3 2 1)))) + (let ((result (cl-stable-sort '() '<))) + (should (equal result '()))) + (let ((result (cl-stable-sort '("Banana" "apple" "cherry") 'string< :key 'downcase))) + (should (equal result '("apple" "Banana" "cherry")))) ) + +(ert-deftest cl-merge-test () + (let ((result (cl-merge 'list '(1 3 5) '(2 4 6) '<))) + (should (equal result '(1 2 3 4 5 6)))) + (let ((result (cl-merge 'list '(1 3 3 5) '(2 3 4 6) '<))) + (should (equal result '(1 2 3 3 3 4 5 6)))) + (let ((result (cl-merge 'list '() '(2 4 6) '<))) + (should (equal result '(2 4 6)))) + (let ((result (cl-merge 'list '(1 3 5) '() '<))) + (should (equal result '(1 3 5)))) + (let ((result (cl-merge 'list '() '() '<))) + (should (equal result '()))) + (let ((result (cl-merge 'list '(1 4 6) '(2 3 5) '< :key (lambda (x) x)))) + (should (equal result '(1 2 3 4 5 6)))) + (let ((result (cl-merge 'vector (vector 1 3 5) (vector 2 4 6) '<))) + (should (equal result (vector 1 2 3 4 5 6)))) + (let ((result (cl-merge 'list '(5 3 1) '(6 4 2) '>))) + (should (equal result '(6 5 4 3 2 1)))) + (let ((result (cl-merge 'list '(1 2 3) '(1 2 3) '>))) + (should (equal result '(1 2 3 1 2 3)))) + (let ((result (cl-merge 'list '(1 2) '(3 4 5) '<))) + (should (equal result '(1 2 3 4 5)))) + (let ((result (cl-merge 'list '(4 5 6) '(1 2 3) '<))) + (should (equal result '(1 2 3 4 5 6)))) + (let ((result (cl-merge 'list '(1 2 3) '(1.5 2.5 3.5) '<))) + (should (equal result '(1 1.5 2 2.5 3 3.5)))) + (let ((result (cl-merge 'list '(1 2 3) '(10 20 30) '< :key (lambda (x) (* x 10))))) + (should (equal result '(1 2 3 10 20 30))))) + +(ert-deftest cl-member-test () + (let ((result (cl-member 'b '(a b c d)))) + (should (equal result '(b c d)))) + (let ((result (cl-member 'x '(a b c d)))) + (should (equal result nil))) + (let ((result (cl-member 'a '(a b a c d)))) + (should (equal result '(a b a c d)))) + (let ((result (cl-member "test" '("test" "not-test" "test2") :test 'string=))) + (should (equal result '("test" "not-test" "test2")))) + (let ((result (cl-member 'x '(a b c d) :test-not 'eq))) + (should (equal result '(a b c d)))) + (let ((result (cl-member 3 '(1 2 3 4 5) :key 'identity))) + (should (equal result '(3 4 5)))) + (let ((result (cl-member 2.5 '(1 2 2.5 3) :test 'equal))) + (should (equal result '(2.5 3)))) + (let ((result (cl-member 'a '(a a a a) :test 'eq))) + (should (equal result '(a a a a)))) + (let ((result (cl-member 'a '()))) + (should (equal result nil))) + (let ((result (cl-member 'b '(a c d) :test-not 'eq))) + (should (equal result '(a c d)))) + (let ((result (cl-member 3 '(1 2 3 4 5) :key '1+))) + (should (equal result '(2 3 4 5))))) + +(ert-deftest cl-member-if-test () + (let ((result (cl-member-if #'evenp '(1 2 3 4 5)))) + (should (equal result '(2 3 4 5)))) + (let ((result (cl-member-if #'(lambda (x) nil) '(1 2 3 4 5)))) + (should (equal result nil))) + (let ((result (cl-member-if #'(lambda (x) t) '(1 2 3 4 5)))) + (should (equal result '(1 2 3 4 5)))) + (let ((result (cl-member-if #'(lambda (x) (= x 1)) '(1 2 3 4 5)))) + (should (equal result '(1 2 3 4 5)))) + (let ((result (cl-member-if #'(lambda (x) (and (numberp x) (evenp x))) '(1 3 5 4 2)))) + (should (equal result '(4 2)))) + (let ((result (cl-member-if (lambda (x) (string= (number-to-string x) "3")) '(1 2 3 4 5) :key 'identity))) + (should (equal result '(3 4 5)))) + (let ((result (cl-member-if #'(lambda (x) (eq x 'a)) '(a a a a)))) + (should (equal result '(a a a a)))) + (let ((result (cl-member-if #'evenp '()))) + (should (equal result nil))) + (let ((result (cl-member-if #'(lambda (x) (< x 0)) '(1 2 3 4 5)))) + (should (equal result nil))) + (let ((result (cl-member-if (lambda (x) (and (numberp x) (<= x 2))) '(1 "two" 3 0)))) + (should (equal result '(1 "two" 3 0)))) + (let ((result (cl-member-if (lambda (x) (> x 5)) '(1 2 3 6 7 8) :key 'identity))) + (should (equal result '(6 7 8))))) + +(ert-deftest cl-member-if-not-test () + (let ((result (cl-member-if-not #'evenp '(1 2 3 4 5)))) + (should (equal result '(1 2 3 4 5)))) + (let ((result (cl-member-if-not #'evenp '(2 4 6 8 10 11)))) + (should (equal result '(11)))) + (let ((result (cl-member-if-not #'(lambda (x) (> x 5)) '(1 2 3 4 5)))) + (should (equal result '(1 2 3 4 5)))) + (let ((result (cl-member-if-not #'(lambda (x) t) '(1 2 3 4 5)))) + (should (equal result nil))) + (let ((result (cl-member-if-not #'(lambda (x) (= x 1)) '(1 2 3 4 5)))) + (should (equal result '(2 3 4 5)))) + (let ((result (cl-member-if-not (lambda (x) (string= (number-to-string x) "2")) '(1 2 3 4 5) :key 'identity))) + (should (equal result '(1 2 3 4 5)))) + (let ((result (cl-member-if-not #'evenp '()))) + (should (equal result nil))) + (let ((result (cl-member-if-not #'(lambda (x) (eq x 'a)) '(a a a a)))) + (should (equal result nil))) + (let ((result (cl-member-if-not #'(lambda (x) (< x 0)) '(1 2 3 4 5)))) + (should (equal result '(1 2 3 4 5)))) + (let ((result (cl-member-if-not #'(lambda (x) (or (numberp x) (stringp x) (eq x 'b))) '(a "b" 3 nil)))) + (should (equal result '(a "b" 3 nil)))) + (let ((result (cl-member-if-not (lambda (x) (numberp x)) '(1 "two" 3 "four" 5) :key 'identity))) + (should (equal result '("two" 3 "four" 5))))) + +(ert-deftest cl-assoc-test () + (let ((result (cl-assoc 'b '((a . 1) (b . 2) (c . 3))))) + (should (equal result '(b . 2)))) + (let ((result (cl-assoc 'x '((a . 1) (b . 2) (c . 3))))) + (should (equal result nil))) + (let ((result (cl-assoc "key" '(("key" . 1) ("not-key" . 2)) :test 'string=))) + (should (equal result '("key" . 1)))) + (let ((result (cl-assoc 'a '((a . 1) (b . 2) (c . 3)) :test-not 'eq))) + (should (equal result '(b . 2)))) + (let ((result (cl-assoc '2 '((1 . 'a) (2 . 'b) (3 . 'c)) :key 'identity))) + (should (equal result '(2 . 'b)))) + (let ((result (cl-assoc 'a '((a . 1) (a . 2) (a . 3)) :test 'eq))) + (should (equal result '(a . 1)))) + (let ((result (cl-assoc 'a '()))) + (should (equal result nil))) + (let ((result (cl-assoc 'b '((a . 1) (b . 2) (b . 3) (c . 4))))) + (should (equal result '(b . 2))))) + +(ert-deftest cl-assoc-if-test () + (let ((result (cl-assoc-if #'evenp '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even"))))) + (should (equal result '(2 . "even")))) + (let ((result (cl-assoc-if #'(lambda (x) (= x 5)) '((1 . "one") (2 . "two") (3 . "three"))))) + (should (equal result nil))) + (let ((result (cl-assoc-if #'(lambda (x) (= x 1)) '((1 . "one") (2 . "two") (3 . "three"))))) + (should (equal result '(1 . "one")))) + (let ((result (cl-assoc-if #'(lambda (x) (string= x "baz")) '((foo . 1) (bar . 2) (baz . 3))))) + (should (equal result '(baz . 3)))) + (let ((result (cl-assoc-if (lambda (x) (and (numberp x) (> x 2))) '((1 . "one") (3 . "three") (4 . "four"))))) + (should (equal result '(3 . "three")))) + (let ((result (cl-assoc-if #'(lambda (x) (> x 1)) '((0 . "zero") (1 . "one") (2 . "two"))))) + (should (equal result '(2 . "two")))) + (let ((result (cl-assoc-if #'evenp '()))) + (should (equal result nil))) + (let ((result (cl-assoc-if #'(lambda (x) (eq x 'a)) '((a . "first") (a . "second") (b . "third"))))) + (should (equal result '(a . "first")))) + (let ((result (cl-assoc-if #'(lambda (x) (and (symbolp x) (not (eq x 'b)))) '((b . "b") (c . "c") (d . "d"))))) + (should (equal result '(c . "c")))) + (let ((result (cl-assoc-if (lambda (x) (and (listp x) (> (length x) 1))) '(((1 2) . "pair 1") ((1) . "pair 2"))))) + (should (equal result '((1 2) . "pair 1"))))) + +(ert-deftest cl-assoc-if-not-test () + (let ((result (cl-assoc-if-not #'evenp '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even"))))) + (should (equal result '(1 . "odd")))) + (let ((result (cl-assoc-if-not #'(lambda (x) (> x 0)) '((1 . "one") (2 . "two") (3 . "three"))))) + (should (equal result nil))) + (let ((result (cl-assoc-if-not #'(lambda (x) (< x 5)) '((1 . "one") (2 . "two") (3 . "three"))))) + (should (equal result nil))) + (let ((result (cl-assoc-if-not #'(lambda (x) (= x 1)) '((1 . "one") (2 . "two") (3 . "three"))))) + (should (equal result '(2 . "two")))) + (let ((result (cl-assoc-if-not #'(lambda (x) (string= x "baz")) '((foo . "first") (bar . "second") (baz . "third"))))) + (should (equal result '(foo . "first")))) + (let ((result (cl-assoc-if-not (lambda (x) (and (numberp x) (> x 2))) '((1 . "one") (3 . "three") (4 . "four"))))) + (should (equal result '(1 . "one")))) + (let ((result (cl-assoc-if-not #'(lambda (x) (symbolp x)) '((1 . "one") (b . "bee") (2 . "two"))))) + (should (equal result '(1 . "one")))) + (let ((result (cl-assoc-if-not #'evenp '()))) + (should (equal result nil))) + (let ((result (cl-assoc-if-not #'(lambda (x) (eq x 'a)) '((a . "first") (a . "second") (b . "third"))))) + (should (equal result '(b . "third"))))) + +(ert-deftest cl-rassoc-test () + (let ((result (cl-rassoc 2 '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result (cons "two" 2)))) + (let ((result (cl-rassoc 4 '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result nil))) + (let ((result (cl-rassoc 2 '(( "one" . 1) ("two" . 2) ("baz" . 2)) :test 'equal))) + (should (equal result (cons "two" 2)))) + (let ((result (cl-rassoc 2 '(( "one" . 1) ("two" . 2) ("three" . 3)) :test-not 'equal))) + (should (equal result (cons "one" 1)))) + (let ((result (cl-rassoc 1 '()))) + (should (equal result nil))) + (let ((result (cl-rassoc 1 '(( "first" . 1) ("second" . 1) ("third" . 1))))) + (should (equal result (cons "first" 1)))) + (let ((result (cl-rassoc 3 '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result (cons "three" 3)))) + (let ((result (cl-rassoc 'found '((( "pair 1") . 1) ( "pair 2" . 2) ( "pair 3" . 3))))) + (should (equal result nil)))) + +(ert-deftest cl-rassoc-if-test () + (let ((result (cl-rassoc-if #'evenp '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result '("two" . 2)))) + (let ((result (cl-rassoc-if #'evenp '(( "one" . 1) ("three" . 3) ("five" . 5))))) + (should (equal result nil))) + (let ((result (cl-rassoc-if #'(lambda (x) (= x 1)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result '("one" . 1)))) + (let ((result (cl-rassoc-if (lambda (x) (> x 1)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result '("two" . 2)))) + (let ((result (cl-rassoc-if #'(lambda (x) (and (numberp x) (< x 3))) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result '("one" . 1)))) + (let ((result (cl-rassoc-if #'evenp '()))) + (should (equal result nil))) + (let ((result (cl-rassoc-if #'(lambda (x) (> x 0)) '(( "first" . 1) ("second" . 2) ("third" . 3))))) + (should (equal result '("first" . 1)))) + (let ((result (cl-rassoc-if #'(lambda (x) (string= (number-to-string x) "two")) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result nil))) + (let ((result (cl-rassoc-if #'(lambda (x) (stringp x)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result nil)))) + +(ert-deftest cl-rassoc-if-not-test () + (let ((result (cl-rassoc-if-not #'evenp '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result '("one" . 1)))) + (let ((result (cl-rassoc-if-not #'(lambda (x) (> x 0)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result nil))) + (let ((result (cl-rassoc-if-not #'(lambda (x) (< x 5)) '(( "one" . 1) ("two" . 2) ("six" . 6))))) + (should (equal result '( "six" . 6)))) + (let ((result (cl-rassoc-if-not #'(lambda (x) (= x 1)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result '("two" . 2)))) + (let ((result (cl-rassoc-if-not #'(lambda (x) (> x 2)) '(( "one" . 1) ("two" . 1) ("three" . 3))))) + (should (equal result '("one" . 1)))) + (let ((result (cl-rassoc-if-not #'(lambda (x) (and (numberp x) (< x 3))) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result '("three" . 3)))) + (let ((result (cl-rassoc-if-not #'(lambda (x) (equal x 2)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result '("one" . 1)))) + (let ((result (cl-rassoc-if-not #'evenp '()))) + (should (equal result nil))) + (let ((result (cl-rassoc-if-not #'(lambda (x) (numberp x)) '(( "one" . 1) ("two" . 2) ("three" . 3))))) + (should (equal result nil))) + (let ((result (cl-rassoc-if-not (lambda (x) (and (listp x) (= (length x) 1))) '(((1 2) . 1) ((3 4) . 2) ((5) . 2))))) + (should (equal result '((1 2) . 1))))) + +(ert-deftest cl-intersection-test () + (let ((result (cl-intersection '(1 2 3 4) '(3 4 5 6)))) + (should (equal result '(4 3)))) + (let ((result (cl-intersection '(1 2) '(3 4)))) + (should (equal result '()))) + (let ((result (cl-intersection '(1 2 3) '(1 2 3)))) + (should (equal result '(1 2 3)))) + (let ((result (cl-intersection '(1 1 2 3) '(1 2 2 3 4)))) + (should (equal result '(3 2 1 1)))) + (let ((result (cl-intersection '(1 "two" 3) '(3 "two" 4)))) + (should (equal result '(3)))) + (let ((result (cl-intersection '(1 2 3) '(3 2 1) :test 'equal))) + (should (equal result '(1 2 3)))) + (let ((result (cl-intersection '(1 2 3) '(3 4 5) :key #'identity))) + (should (equal result '(3)))) + (let ((result (cl-intersection '() '(1 2 3)))) + (should (equal result '()))) + (let ((result (cl-intersection '() '()))) + (should (equal result '()))) + (let ((result (cl-intersection '(1 2 3 4 5) '(3 4 5 6 7 8)))) + (should (equal result '(5 4 3))))) + +(ert-deftest cl-nintersection-test () + (let ((list1 '(1 2 3 4)) + (list2 '(3 4 5 6))) + (let ((result (cl-nintersection list1 list2))) + (should (equal result '(4 3))) + (should (equal list1 '(1 2 3 4))) + (should (equal list2 '(3 4 5 6))))) + (let ((list1 '(1 2)) + (list2 '(3 4))) + (let ((result (cl-nintersection list1 list2))) + (should (equal result '())) + (should (equal list1 '(1 2))) + (should (equal list2 '(3 4))))) + (let ((list1 '(1 2 3)) + (list2 '(1 2 3))) + (let ((result (cl-nintersection list1 list2))) + (should (equal result '(1 2 3))) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(1 2 3))))) + (let ((list1 '(1 1 2 2 3)) + (list2 '(2 2 3 4))) + (let ((result (cl-nintersection list1 list2))) + (should (equal result '(3 2 2))) + (should (equal list1 '(1 1 2 2 3))) + (should (equal list2 '(2 2 3 4))))) + (let ((list1 '(1 "two" 3)) + (list2 '(3 "two" 4))) + (let ((result (cl-nintersection list1 list2))) + (should (equal result '(3))) + (should (equal list1 '(1 "two" 3))) + (should (equal list2 '(3 "two" 4))))) + (let ((list1 '(1 2 3)) + (list2 '(3 2 1))) + (let ((result (cl-nintersection list1 list2 :test 'equal))) + (should (equal result '(1 2 3))) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(3 2 1))))) + (let ((list1 '()) + (list2 '(1 2 3))) + (let ((result (cl-nintersection list1 list2))) + (should (equal result '())) + (should (equal list1 '())) + (should (equal list2 '(1 2 3))))) + (let ((list1 '()) + (list2 '())) + (let ((result (cl-nintersection list1 list2))) + (should (equal result '()))))) + +(ert-deftest cl-set-difference-test () + (let ((result (cl-set-difference '(1 2 3 4) '(3 4 5 6)))) + (should (equal result '(1 2)))) + (let ((result (cl-set-difference '(1 2 3) '()))) + (should (equal result '(1 2 3)))) + (let ((result (cl-set-difference '(1 2 3) '(1 2 3)))) + (should (equal result '()))) + (let ((result (cl-set-difference '(1 1 2 3 4) '(3 4 5)))) + (should (equal result '(1 1 2)))) + (let ((result (cl-set-difference '(1 2 3) '(3 2 4)))) + (should (equal result '(1)))) + (let ((result (cl-set-difference '(1 2 3) '(3 2 1) :test 'equal))) + (should (equal result '()))) + (let ((result (cl-set-difference '((1 . "one") (2 . "two") (3 . "three")) + '((1 . "uno") (2 . "dos")) + :key 'car))) + (should (equal result '((3 . "three"))))) + (let ((result (cl-set-difference '() '(1 2 3)))) + (should (equal result '()))) + (let ((result (cl-set-difference '(1 2 3) '()))) + (should (equal result '(1 2 3)))) + (let ((result (cl-set-difference '(1 2 3 4 5) '(3 4 5 6 7)))) + (should (equal result '(1 2)))) + (let ((list1 '(1 2 3)) + (list2 '(2 3 4))) + (cl-set-difference list1 list2) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(2 3 4))))) + +(ert-deftest cl-nset-difference-test () + (let ((list1 '(1 2 3 4)) + (list2 '(3 4 5 6))) + (let ((result (cl-nset-difference list1 list2))) + (should (equal result '(1 2))) + (should (equal list1 '(1 2 3 4))) + (should (equal list2 '(3 4 5 6))))) + (let ((list1 '(1 2 3)) + (list2 '())) + (let ((result (cl-nset-difference list1 list2))) + (should (equal result '(1 2 3))) + (should (equal list1 '(1 2 3))) + (should (equal list2 '())))) + (let ((list1 '(1 2 3)) + (list2 '(1 2 3))) + (let ((result (cl-nset-difference list1 list2))) + (should (equal result '())) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(1 2 3))))) + (let ((list1 '(1 1 2 2 3)) + (list2 '(3 4 5))) + (let ((result (cl-nset-difference list1 list2))) + (should (equal result '(1 1 2 2))) + (should (equal list1 '(1 1 2 2 3))) + (should (equal list2 '(3 4 5))))) + (let ((list1 '(1 2 3)) + (list2 '(3 2 4))) + (let ((result (cl-nset-difference list1 list2))) + (should (equal result '(1))) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(3 2 4))))) + (let ((list1 '(1 2 3)) + (list2 '(3 2 1))) + (let ((result (cl-nset-difference list1 list2 :test 'equal))) + (should (equal result '())) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(3 2 1))))) + (let ((list1 '()) + (list2 '(1 2 3))) + (let ((result (cl-nset-difference list1 list2))) + (should (equal result '())) + (should (equal list1 '())) + (should (equal list2 '(1 2 3))))) + (let ((list1 '()) + (list2 '())) + (let ((result (cl-nset-difference list1 list2))) + (should (equal result '())))) + (let ((list1 '(1 2 3 4 5)) + (list2 '(3 4 5 6 7))) + (let ((result (cl-nset-difference list1 list2))) + (should (equal result '(1 2))) + (should (equal list1 '(1 2 3 4 5))) + (should (equal list2 '(3 4 5 6 7)))))) + +(ert-deftest cl-set-exclusive-or-test () + (let ((result (cl-set-exclusive-or '(1 2 3) '(3 4 5)))) + (should (equal result '(1 2 4 5)))) + (let ((result (cl-set-exclusive-or '(1 2 3) '()))) + (should (equal result '(1 2 3)))) + (let ((result (cl-set-exclusive-or '() '(3 4 5)))) + (should (equal result '(3 4 5)))) + (let ((result (cl-set-exclusive-or '(1 2 3) '(1 2 3)))) + (should (equal result nil))) + (let ((result (cl-set-exclusive-or '(1 1 2 3) '(3 4 5)))) + (should (equal result '(1 1 2 4 5)))) + (let ((result (cl-set-exclusive-or '(1 2 3) '(3 3 4 5)))) + (should (equal result '(1 2 4 5)))) + (let ((result (cl-set-exclusive-or '(1 2 3) '(3 2 4)))) + (should (equal result '(1 4)))) + (let ((result (cl-set-exclusive-or '(1 2 3) '(3 2 1) :test 'equal))) + (should (equal result '()))) + (let ((result (cl-set-exclusive-or '() '()))) + (should (equal result '()))) + (let ((result (cl-set-exclusive-or '(1 2 3 4 5) '(3 4 5 6 7))) + (list1 '(1 2 3 4 5)) + (list2 '(3 4 5 6 7))) + (should (equal result '(1 2 6 7))) + (should (equal list1 '(1 2 3 4 5))) + (should (equal list2 '(3 4 5 6 7))))) + +(ert-deftest cl-nset-exclusive-or-test () + (let ((list1 '(1 2 3)) + (list2 '(3 4 5))) + (let ((result (cl-nset-exclusive-or list1 list2))) + (should (equal result '(1 2 4 5))) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(3 4 5))))) + (let ((list1 '(1 2 3)) + (list2 '())) + (let ((result (cl-nset-exclusive-or list1 list2))) + (should (equal result '(1 2 3))) + (should (equal list1 '(1 2 3))) + (should (equal list2 '())))) + (let ((list1 '(1 2 3)) + (list2 '(1 2 3))) + (let ((result (cl-nset-exclusive-or list1 list2))) + (should (equal result nil))) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(1 2 3)))) + (let ((list1 '(1 1 2 2 3)) + (list2 '(3 4 5))) + (let ((result (cl-nset-exclusive-or list1 list2))) + (should (equal result '(1 1 2 2 4 5))) + (should (equal list1 '(1 1 2 2 3))) + (should (equal list2 '(3 4 5))))) + (let ((list1 '(1 2 3)) + (list2 '(3 3 4 5))) + (let ((result (cl-nset-exclusive-or list1 list2))) + (should (equal result '(1 2 4 5))) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(3 3 4 5))))) + (let ((list1 '(1 2 3)) + (list2 '(3 2 4))) + (let ((result (cl-nset-exclusive-or list1 list2))) + (should (equal result '(1 4))) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(3 2 4))))) + (let ((list1 '(1 2 3)) + (list2 '(3 2 1))) + (let ((result (cl-nset-exclusive-or list1 list2 :test 'equal))) + (should (equal result '())) + (should (equal list1 '(1 2 3))) + (should (equal list2 '(3 2 1))))) + (let ((list1 '()) + (list2 '(1 2 3))) + (let ((result (cl-nset-exclusive-or list1 list2))) + (should (equal result '(1 2 3))) + (should (equal list1 '())) + (should (equal list2 '(1 2 3))))) + (let ((list1 '()) + (list2 '())) + (let ((result (cl-nset-exclusive-or list1 list2))) + (should (equal result '())))) + (let ((list1 '(1 2 3 4 5)) + (list2 '(3 4 5 6 7))) + (let ((result (cl-nset-exclusive-or list1 list2))) + (should (equal result '(1 2 6 7))) + (should (equal list1 '(1 2 3 4 5))) + (should (equal list2 '(3 4 5 6 7)))))) + +(ert-deftest cl-subsetp-test () + (let ((result (cl-subsetp '(1 2) '(1 2 3 4)))) + (should (equal result t))) + (let ((result (cl-subsetp '() '(1 2 3 4)))) + (should (equal result t))) + (let ((result (cl-subsetp '(1 2) '()))) + (should (equal result nil))) + (let ((result (cl-subsetp '(1 2 3) '(1 2 3)))) + (should (equal result t))) + (let ((result (cl-subsetp '(1 1 2) '(1 2 3)))) + (should (equal result t))) + (let ((result (cl-subsetp '(1 2) '(1 1 2 3 4)))) + (should (equal result t))) + (let ((result (cl-subsetp '(1 "two" 3) '(3 "two" 1)))) + (should (equal result nil))) + (let ((result (cl-subsetp '(1 2) '(2 1) :test 'equal))) + (should (equal result t))) + (let ((result (cl-subsetp '((1 . "one") (2 . "two")) '((1 . "uno") (2 . "dos")) :key 'car))) + (should (equal result t))) + (let ((result (cl-subsetp '(1 2) '(3 4 2 1) :test 'eq))) + (should (equal result t))) + (let ((result (cl-subsetp '((1 2) (3)) '((1 2 . "found") (3 . "found")) :key 'car))) + (should (equal result t))) + (let ((result (cl-subsetp '(1 2) '(1 2 3 2)))) + (should (equal result t))) + (let ((result (cl-subsetp '() '()))) + (should (equal result t)))) + (provide 'cl-seq-tests) ;;; cl-seq-tests.el ends here commit 853719c4c23a4ae0802a6eed3f855dc88381997f Author: Eli Zaretskii Date: Sat Jan 18 12:56:48 2025 +0200 ; * lisp/net/eww.el (eww-download): Doc fix (bug#75585) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index f1585b0bb5a..c3e927b74a6 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2162,8 +2162,16 @@ Differences in #targets are ignored." (kill-new (plist-get eww-data :url))) (defun eww-download () - "Download URL to `eww-download-directory'. -Use link at point if there is one, else the current page's URL." + "Download a Web page to `eww-download-directory'. +Use link at point if there is one, else the current page's URL. +This command downloads the page to the download directory, under +a file name generated from the last portion of the page's URL, +after the last slash. (If URL ends in a slash, the page will be +saved under the name \"!\".) +If there's already a file by that name in the download directory, +this command will modify the name to make it unique. +The command shows in the echo-area the actual file name where the +page was saved." (interactive nil eww-mode) (let ((dir (if (stringp eww-download-directory) eww-download-directory commit 45ec5865aa78d098c8842e41f360947b1b030393 Author: Stefan Kangas Date: Fri Jan 17 17:22:45 2025 +0100 ; * etc/NEWS: Tweak wording of NSM items. diff --git a/etc/NEWS b/etc/NEWS index 31a0c4938ad..ce5290171a1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -172,17 +172,17 @@ the default one. It is reimplemented in native code, reducing GC churn. To undo this change, set 'fast-read-process-output' to nil. +++ -** The Network Security Manager now warns about 3DES by default. +** Network Security Manager now warns about 3DES by default. This cypher is no longer recommended owing to a major vulnerability disclosed in 2016, and its small 112 bit key size. Emacs now warns about its use also when 'network-security-level' is set to 'medium' (the default). See 'network-security-protocol-checks'. --- -** The Network Security Manager now warns about <2048 bits in DH key exchange. -Emacs used to warn for Diffie-Hellman key exchanges with prime numbers -smaller than 1024 bits. Since more servers now support it, this -number has been bumped to 2048 bits. +** Network Security Manager now warns about <2048 bits in DH key exchange. +Emacs used to warn for ephemeral Diffie-Hellman (DHE) key exchanges with +prime numbers smaller than 1024 bits. Since more servers now support +it, this number has been bumped to 2048 bits. +++ ** URL now never sends user email addresses in HTTP requests. commit b981889e9ee0a37f1bc8e2c9b90a5d154c1d032e Author: Harald Jörg Date: Tue Jan 14 12:17:47 2025 +0100 ; cperl-mode-tests.el: Don't run the newest test in perl-mode * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-74245): Skip if not in cperl-mode diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index e54790256ab..dab4ad5ecf5 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -1592,6 +1592,7 @@ and the slash, then we have a division." (ert-deftest cperl-test-bug-74245 () "Verify that a bare \"$\" can appear at the end of a subroutine signature. It must not be mistaken for \"$)\"." + (skip-unless (eq cperl-test-mode #'cperl-mode)) (cperl--run-test-cases (ert-resource-file "cperl-bug-74245.pl") (while (null (eobp)) commit 6a864ef8f39b8ec25c33479a8ac57b62fd10cfe7 Author: Robert Pluim Date: Tue Jan 14 10:25:18 2025 +0100 Add smtpmail cross-reference to 'auth-sources'. * doc/misc/smtpmail.texi (Authentication): Add cross-reference to 'auth-sources'. diff --git a/doc/misc/smtpmail.texi b/doc/misc/smtpmail.texi index 5f99acaf7d8..12b4ea41810 100644 --- a/doc/misc/smtpmail.texi +++ b/doc/misc/smtpmail.texi @@ -225,7 +225,8 @@ send mail via a server and the SMTP server reports back that it requires authentication, Emacs (version 24.1 and later) prompts you for the user name and password to use, and then offers to save the information. By default, Emacs stores authentication information in a -file @file{~/.authinfo}. +file @file{~/.authinfo}, but this can be changed by customizing +@code{auth-sources} (@pxref{Authentication, Persisting Authinfo,,emacs}). @vindex smtpmail-servers-requiring-authorization Some SMTP servers may bandwidth-limit (or deny) requests from clients commit 1fd7957bc72b766ef8d2ddfc4858f714ee0814c0 Author: Peter Oliver Date: Thu Nov 7 19:22:21 2024 +0000 ; cperl-mode.el: Add a test for Bug#74245 * test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl: New test data. * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-74245): Verify that a bare \"$\" can appear at the end of a subroutine signature. diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl new file mode 100644 index 00000000000..44d1e49bd36 --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl @@ -0,0 +1,16 @@ +# This resource file can be run with cperl--run-testcases from +# cperl-tests.el and works with both perl-mode and cperl-mode. + +# -------- signature where last parameter is ignored: input ------- +package P { +use v5.36; +sub ignore ($first, $) {} +ignore(qw(first second)); +} +# -------- signature where last parameter is ignored: expected output ------- +package P { + use v5.36; + sub ignore ($first, $) {} + ignore(qw(first second)); +} +# -------- signature where last parameter is ignored: end ------- diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 958ffe38a8b..e54790256ab 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -1589,6 +1589,15 @@ and the slash, then we have a division." (should (equal (nth 8 (cperl-test-ppss code "/")) 9))) ) +(ert-deftest cperl-test-bug-74245 () + "Verify that a bare \"$\" can appear at the end of a subroutine signature. +It must not be mistaken for \"$)\"." + (cperl--run-test-cases + (ert-resource-file "cperl-bug-74245.pl") + (while (null (eobp)) + (cperl-indent-command) + (forward-line 1)))) + (ert-deftest test-indentation () (ert-test-erts-file (ert-resource-file "cperl-indents.erts"))) commit 8d289670d601ab89a5baf62de7a8b8c0ed31deda Merge: 30e84fc6537 b74ac4af940 Author: Eli Zaretskii Date: Mon Jan 13 14:00:10 2025 +0200 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/emacs into emacs-30 commit b74ac4af9408230645f1edb56c410b7a80bb41d2 Author: Harald Jörg Date: Mon Jan 13 12:24:40 2025 +0100 ; cperl-mode.el: Allow bare $ in a signature (Bug#74245) * lisp/progmodes/cperl-mode.el (cperl--signature-rx): Allow bare sigils for unused parameters in signatures. (cperl-find-pods-heres): Avoid $) at the end of a signature being treated as the punctuation variable $) by treating this dollar as punctuation * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-signature-rx): Add ($first,$) as a valid signature, remove ($) from the list of invalid signatures. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ed8527f0039..38015ed2acd 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1352,13 +1352,14 @@ prototypes from signatures.") (optional (sequence (0+ (sequence ,cperl--ws*-rx - ,cperl--basic-scalar-rx + (or ,cperl--basic-scalar-rx "$") ,cperl--ws*-rx ",")) ,cperl--ws*-rx (or ,cperl--basic-scalar-rx ,cperl--basic-array-rx - ,cperl--basic-hash-rx))) + ,cperl--basic-hash-rx + "$" "%" "@"))) (optional (sequence ,cperl--ws*-rx) "," ) ,cperl--ws*-rx ")") @@ -4355,8 +4356,8 @@ recursive calls in starting lines of here-documents." (opt (group (eval cperl--normal-identifier-rx))) ; #13 (eval cperl--ws*-rx) (group (or (group (eval cperl--prototype-rx)) ; #14,#15 - ;; (group (eval cperl--signature-rx)) ; #16 - (group unmatchable) ; #16 + (group (eval cperl--signature-rx)) ; #16 + ;; (group unmatchable) ; #16 (group (or anything buffer-end)))))) ; #17 "\\|" ;; -------- weird variables, capture group 18 @@ -5251,7 +5252,7 @@ recursive calls in starting lines of here-documents." ;; match-string 13: Name of the subroutine (optional) ;; match-string 14: Indicator for proto/attr/signature ;; match-string 15: Prototype - ;; match-string 16: unused + ;; match-string 16: Subroutine signature ;; match-string 17: Distinguish declaration/definition (setq b1 (match-beginning 13) e1 (match-end 13)) (if (memq (char-after (1- b)) @@ -5267,9 +5268,18 @@ recursive calls in starting lines of here-documents." (forward-comment (buffer-size)) (cperl-find-sub-attrs st-l b1 e1 b)) ;; treat attributes without prototype and incomplete stuff - (goto-char (match-beginning 17)) - (cperl-find-sub-attrs st-l b1 e1 b)))) - ;; 1+6+2+1+1+6+1=18 extra () before this: + (if (match-beginning 16) ; a complete subroutine signature + ;; A signature ending in "$)" must not be + ;; mistaken as the punctuation variable $) which + ;; messes up balance of parens (Bug#74245). + (progn + (when (= (char-after (- (match-end 16) 2)) ?$) + (put-text-property (- (match-end 16) 2) (1- (match-end 16)) + 'syntax-table cperl-st-punct)) + (goto-char (match-end 16))) + (goto-char (match-beginning 17)) + (cperl-find-sub-attrs st-l b1 e1 b))))) + ;; 1+6+2+1+1+6+1=18 extra () before this: ;; "\\(\\ Date: Sun Jan 12 15:19:40 2025 -0300 Emphasize the use of :tag for new customization types * doc/lispref/customize.texi (Type Keywords): Name important use cases of the :tag keyword. (Defining New Types): Emphasize the use of the :tag keyword when using the lazy widget. (Bug#74409) (cherry picked from commit 99b85e116f09e68e0d5750c9772d0a2489680078) diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index abd79227e31..f687acfe1c8 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -1177,7 +1177,10 @@ The symbol's value is used. @item :tag @var{tag} Use @var{tag} (a string) as the tag for the value (or part of the value) -that corresponds to this type. +that corresponds to this type. It's important to provide an informative +tag for the customization interface, especially if you're using the +@code{restricted-sexp} type or if you're defining a new type. +@xref{Defining New Types}. @item :doc @var{doc} @kindex doc@r{, customization keyword} @@ -1346,10 +1349,15 @@ with this widget. Here a @code{binary-tree-of-string} is described as being either a string, or a cons-cell whose car and cdr are themselves both @code{binary-tree-of-string}. Note the reference to the widget type we are currently in the process of defining. The @code{:tag} -attribute is a string to name the widget in the user interface, and the -@code{:offset} argument is there to ensure that child nodes are -indented four spaces relative to the parent node, making the tree -structure apparent in the customization buffer. +is another important keyword argument because we are using the +@code{lazy} widget for our new widget. By default, the @code{lazy} +widget doesn't have a tag, and in its absence the customization buffer +will show the entire widget's value (that is, the value of the user +option being customized). Since that's almost never a good idea, we +provide a string to name the @code{binary-tree-or-string} widget. The +@code{:offset} argument is there to ensure that child nodes are indented +four spaces relative to the parent node, making the tree structure +apparent in the customization buffer. The @code{defcustom} shows how the new widget can be used as an ordinary customization type.