* src/process.c (Fmake_process, Fmake_pipe_process)
(Fserial_process_configure, Fmake_serial_process)
(Fmake_network_process): Signal Qmalformed_keyword_arg_list when
the argument list length is odd.
* src/sound.c (parse_sound): Also here..
* src/w32fns.c (Fw32_notification_notify): ..and here.
João Távora [Mon, 20 Jan 2025 17:23:08 +0000 (17:23 +0000)]
Eglot: try again to fix try-completion logic
Emacs partial completion simply doesn't make sense in LSP.
Attempts to make it make some sense end up failing for one
reason or another.
This commit restores the original intention of the
eglot--dumb-allc and eglot--dumb-tryc functions, which was to be
dumb and pop up a *Completions* buffer (or a company tooltip),
as soon as there is doubt over what the user wants to do.
It also fixes tests, including an expensive Rust test that had
been broken for a long time.
* lisp/progmodes/eglot.el (eglot--dumb-allc): Consider point.
(eglot--dumb-tryc): Make it suitably dumb again.
* test/lisp/progmodes/eglot-tests.el
(eglot--wait-for-rust-analyzer): Wait longer.
(eglot-test-common-prefix-completion): Delete this test. It's not
the intended behavior.
(eglot--kill-completions-buffer): New helper.
(eglot-test-try-completion-nomatch): Rework test.
(eglot-test-try-completion-inside-symbol): Pops *Completions*
buffer because mustn't partial complete.
(eglot-test-try-completion-inside-symbol-2): Does complete.
(eglot-test-rust-completion-exit-function): Fix long-broken test.
Tassilo Horn [Mon, 20 Jan 2025 15:21:24 +0000 (16:21 +0100)]
Don't skip or double-process files in dired with auto-revert-mode (bug#75626)
* lisp/dired.el (dired--inhibit-auto-revert): New variable.
(dired-map-over-marks): Make the generated code bind it.
(dired-buffer-stale-p): Return nil if dired--inhibit-auto-revert is
non-nil.
Yuan Fu [Mon, 20 Jan 2025 06:34:11 +0000 (22:34 -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.
Stefan Kangas [Mon, 20 Jan 2025 00:55:19 +0000 (01:55 +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.
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.