Stefan Kangas [Sun, 19 Jan 2025 17:09:36 +0000 (18:09 +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)
Stefan Kangas [Sun, 19 Jan 2025 14:10:45 +0000 (15:10 +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.
Stefan Kangas [Sun, 19 Jan 2025 03:59:22 +0000 (04:59 +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 <https://coccinelle.gitlabpages.inria.fr/website/>.
Stefan Kangas [Sun, 19 Jan 2025 11:44:05 +0000 (12:44 +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.
Michael Albinus [Sun, 19 Jan 2025 10:30:10 +0000 (11:30 +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".
Paul Eggert [Sun, 19 Jan 2025 08:19:50 +0000 (00:19 -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.
Paul Eggert [Sun, 19 Jan 2025 07:26:02 +0000 (23:26 -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.
Eli Zaretskii [Sun, 19 Jan 2025 06:06:48 +0000 (08:06 +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.
Stefan Kangas [Sat, 18 Jan 2025 23:48:08 +0000 (00:48 +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 <pipcet@protonmail.com>.
Ref: https://mail.gnu.org/r/emacs-devel/2025-01/msg00680.html
Yuan Fu [Sat, 18 Jan 2025 02:24:45 +0000 (18:24 -0800)]
Fix treesit.el tests
* lisp/treesit.el (treesit--imenu-merge-entries):
(Ftreesit_parser_set_included_ranges): Warn in the docstring
that the function is destructive/owns the argument.
* test/src/treesit-tests.el (treesit-range-fixup-after-edit):
(treesit-imenu): Fix tests.
Yuan Fu [Sat, 18 Jan 2025 01:40:04 +0000 (17:40 -0800)]
Make sure treesit.el doesn't create parsers by itself (bug#75456)
Up to this point, functions in
treesit.el (font-lock/indentation/etc) creates a parser if one
doesn't exist. This doesn't work well with local parsers,
because local parsers are not visible at global level and
font-lock or indentation functions might accidentally create a
global parser for an embedded language.
The solution is to not create parsers automatically. This has
the potential of breaking things, but I don't expect any actual
breakage: all the major modes create parsers they need in the
major mode body, even though previously it isn't technically
necessary.
* lisp/treesit.el (treesit-buffer-root-node):
(treesit--update-ranges-local):
(treesit-update-ranges):
(treesit--guess-primary-parser): Use treesit-parser-list instead
of treesit-parser-create.
Yuan Fu [Wed, 15 Jan 2025 07:32:48 +0000 (23:32 -0800)]
Add treesit-query-first-valid
This should help major modes to support grammar versions.
* doc/lispref/parsing.texi (Pattern Matching): Mention new function.
* lisp/treesit.el (treesit-query-first-valid): New function.
(treesit-query-valid-p): New function.
Paul Eggert [Thu, 16 Jan 2025 07:32:43 +0000 (23:32 -0800)]
Simplify alloc by assuming MALLOC_IS_LISP_ALIGNED
Problem reported by Hong Xu <https://bugs.gnu.org/75551#14>.
* src/alloc.c (MALLOC_IS_LISP_ALIGNED): static_assert it,
since it is true on all current Emacs platforms.
All uses simplified to assume it is true.
(xmalloc, xzalloc, xrealloc, lisp_malloc): Just use
malloc/calloc/realloc. Since we are using the malloc-gnu
and realloc-posix modules, we need not worry about whether
these functions return a null pointer for zero-size requests.
(xrealloc): Stop worrying about no-longer-existing platforms
where realloc (nullptr, ...) did not work.
(laligned, lmalloc, lrealloc): Remove. All uses removed.
Paul Eggert [Fri, 17 Jan 2025 07:28:34 +0000 (23:28 -0800)]
Let Gnulib deal with malloc/realloc 0
Instead of worrying about whether malloc and realloc yield a
non-null pointer when given size 0 (the traditional behavior
recommended by Doug McIlroy, and the only behavior that makes
sense for Emacs), let Gnulib arrange for the traditional behavior.
* admin/merge-gnulib (GNULIB_MODULES): Add malloc-gnu (which we
were already depending on indirectly) and realloc-posix.
* lib/gnulib.mk.in, m4/gnulib-comp.m4:
Regenerate by running admin/merge-gnulib.
Pip Cet [Fri, 17 Jan 2025 17:13:29 +0000 (17:13 +0000)]
Fix build on Solaris 10 (bug#75451)
* autogen.sh: Avoid bashism.
* configure.ac (AC_PROG_AWK): Use.
* src/Makefile.in (AWK): Set.
(dmpstruct.h): Use "$(AWK)", not "awk".
* src/dired.c (DT_UNKNOWN, DT_DIR, DT_LNK): Define all three constants
or none of them.
Stefan Kangas [Fri, 17 Jan 2025 17:17:35 +0000 (18:17 +0100)]
Turn macros into enums in keyboard.h
* src/keyboard.h (item_property_idx, menu_item_pane_idx): Turn macros
into enums.
(ITEM_PROPERTY_MAX): New constant.
* src/keyboard.c (parse_menu_item): Use above new constant.
Stefan Monnier [Fri, 17 Jan 2025 13:43:50 +0000 (08:43 -0500)]
(hack-one-local-variable): Refine last patch (bug#74964)
* lisp/files.el (hack-local-variables--inhibit-eval): Rename from
`hack-local-variables--inhibit`.
(hack-one-local-variable): Skip only those eval forms we're already
in the process of evaluating.
Harald Jörg [Mon, 13 Jan 2025 11:24:40 +0000 (12:24 +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.
João Távora [Fri, 17 Jan 2025 10:57:46 +0000 (10:57 +0000)]
Flymake: fix bug introduced recently
Must protect against flymake--state never having been a hash
table at all, so that flymake-mode can be safely turned off even
if it never turned on in the first place.
Stefan Kangas [Fri, 17 Jan 2025 10:26:49 +0000 (11:26 +0100)]
Make NSM warn for DH key exchange on medium severity
* lisp/net/nsm.el (network-security-protocol-checks): Bump dhe-kx
severity to medium.
(nsm-protocol-check--dhe-kx): Update docstring to describe the so-called
Racoon Attack, discovered in 2020.
Stefan Monnier [Thu, 16 Jan 2025 22:18:24 +0000 (17:18 -0500)]
(asm-mode): Fix bug#75542
* lisp/progmodes/asm-mode.el (asm-mode): Be careful not to override
changes in the mode map or in `comment-start`.
Move the use of `asm-mode-set-comment-hook` back to where it was before
commit 0cff4e67f1de.
(asm-mode-set-comment-hook): Declare it obsolete.
Kierin Bell [Sat, 11 Jan 2025 22:25:51 +0000 (17:25 -0500)]
Improve usability and documentation of Iroquoian input methods
* lisp/leim/quail/iroquoian.el: Add variants for Mohawk and Oneida
endonyms in comments and docstrings. Update the 'oneida-postfix' input
method to make the most commonly used glottal stop character easiest to
input. Update the 'onondaga-postfix' input method with mnemonic keys
for nasals in the Onondaga Nation, New York orthography. (Bug#75448)
* etc/NEWS: Add variants for Mohawk and Oneida endonyms to NEWS entry.
Eli Zaretskii [Thu, 16 Jan 2025 15:51:47 +0000 (17:51 +0200)]
Fix subtle problem with updating 'font_style_table'
* src/font.c (font_style_to_value): Update the Vfont_* variables
to keep them in sync with their slots in 'font_style_table'.
(Bug#75521)
(syms_of_font): Comment on usage of DEFVAR_LISP_NOPRO.
Stefan Kangas [Wed, 15 Jan 2025 22:11:16 +0000 (23:11 +0100)]
Fix clear-string crash with text properties
* src/fns.c (Fclear_string): Fix crash by clearing all text
properties. (Bug#75581)
* doc/lispref/strings.texi (Modifying Strings): Document the above
behavior change.
Fix proposed by Andreas Schwab <schwab@linux-m68k.org>.