Paul Eggert [Sun, 18 Feb 2024 07:38:30 +0000 (23:38 -0800)]
Remove no-longer-needed pdumper_load workaround
* src/pdumper.c (pdumper_load): Revert my commit "Pacify GCC
12.1.1 in default developer build" dated 2022-06-13 13:21:18 -07,
as GCC bug 105961 is fixed, and this workaround is not needed for
unfixed GCC as these builds should not use --enable-gcc-warnings.
Paul Eggert [Sun, 18 Feb 2024 07:12:18 +0000 (23:12 -0800)]
Ignore fewer GCC -fanalyzer diagnostics in ccl.c
* src/ccl.c: Do not ignore -Wanalyzer-use-of-uninitialized-value,
as that bug has been fixed in GCC. Ignore
-Wanalyzer-out-of-bounds only if GCC 13, as the bug will
reportedly be fixed when GCC 14 comes out.
Eshel Yaron [Wed, 21 Feb 2024 16:23:57 +0000 (17:23 +0100)]
New command 'minibuffer-apply'
* lisp/minibuffer.el (completions-used-input): New face.
(minibuffer-completion-action): New variable and function.
(minibuffer-completion-command): New variable.
(completing-read-default): Set it to 'this-command'.
(minibuffer-current-input): New function.
(minibuffer-apply): New command.
(minibuffer-local-completion-map): Bind it to 'C-j'.
(minibuffer-local-must-match-map): Unbind 'C-j'.
* lisp/cus-edit.el (customize-toggle-option): Set
'minibuffer-action' property to non-nil.
Eshel Yaron [Wed, 21 Feb 2024 12:24:06 +0000 (13:24 +0100)]
; Reposition cursor after refreshing *Completions*
* lisp/minibuffer.el (minibuffer-completion-help): If *Completions* is
already visible and some candidate is highlighted, try to highlight it
again after populating the buffer anew.
Paul Eggert [Fri, 16 Feb 2024 02:45:29 +0000 (18:45 -0800)]
Adjust to yesterday’s Gnulib nstrftime changes
Bruno Haible fixed Gnulib so that nstrftime no longer requires
locking code, which means we no longer need to avoid localename.
However, nstrftime now requires localename-unsafe-limited which
pulls in some Gnulib-specific locale code, and it’s likely this
needs to be replaced with Emacs-specific locale code. In the
meantime let’s continue to finess this by avoiding
localename-unsafe-limited.
* admin/merge-gnulib (AVOIDED_MODULES):
Avoid localename-unsafe-limited instead of localename.
Jakub Ječmínek [Sat, 17 Feb 2024 17:34:36 +0000 (09:34 -0800)]
Provide better default value for date in Gnus scoring
Bug#61002, thanks to Kamil Jońca for reporting
* lisp/gnus/gnus-score.el (gnus-summary-score-entry): When scoring on
Date header, the default value for the prompt should be number of days
between the date of the article under point, and "now".
Eshel Yaron [Tue, 20 Feb 2024 14:18:52 +0000 (15:18 +0100)]
; Bind M-<left>/<right> in minibuffer for navigating *Completions*
* lisp/minibuffer.el (minibuffer-local-completion-map): Bind
'M-<left>/<right>' to 'minibuffer-previous/next-completion', and bind
'M-<down>/<up>' to the vertical variants of these commands.
Eshel Yaron [Sun, 18 Feb 2024 21:08:48 +0000 (22:08 +0100)]
; Show option state (ON/OFF) in 'toggle-option' completions list
* lisp/cus-edit.el (custom-boolean-option-on)
(custom-boolean-option-off): New faces.
(customize-read-boolean-option-affixation): New function.
(customize-read-boolean-option): Use it.
(customize-toggle-option): Update.
john muhl [Tue, 13 Feb 2024 00:46:51 +0000 (18:46 -0600)]
Eagerly indent first field in tables in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
Properly indent the first field of a table when it appears on a
line by itself. (Bug#69088)
Kévin Le Gouguec [Sat, 10 Feb 2024 16:56:57 +0000 (17:56 +0100)]
Support shebang lines with amended environment
For bug#64939.
* lisp/files.el (auto-mode-interpreter-regexp): Account for possible
VARIABLE=[VALUE] operands.
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter):
Add an example from the coreutils manual.
Kévin Le Gouguec [Sat, 10 Feb 2024 16:37:35 +0000 (17:37 +0100)]
Support more complex env invocations in shebang lines
This is not an exact re-implementation of what env accepts, but
hopefully it should be "good enough".
Example of known limitation: we assume that arguments for
--long-options will be set with '=', but that is not
necessarily the case. '--unset' (mandatory argument) can be
passed as '--unset=VAR' or '--unset VAR', but
'--default-signal' (optional argument) requires an '=' sign.
For bug#64939.
* lisp/files.el (auto-mode-interpreter-regexp): Account for
supplementary arguments passed beside -S/--split-string.
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter):
Test some of these combinations.
Kévin Le Gouguec [Sat, 10 Feb 2024 15:14:08 +0000 (16:14 +0100)]
Refine shebang tests (bug#64939)
* test/lisp/files-tests.el (files-tests--check-shebang): For
shell-script modes, verify that the correct shell is set.
(files-tests-auto-mode-interpreter): Prefer 'sh-base-mode' to
'sh-mode' to stay tree-sitter-agnostic; re-organize test cases to
make future ones easier to add.
F. Jason Park [Mon, 12 Feb 2024 04:01:54 +0000 (20:01 -0800)]
Use modern fallback for channel name detection in ERC
* lisp/erc/erc-backend.el (erc-query-buffer-p): Remove forward declaration.
* lisp/erc/erc.el (erc-query-buffer-p): Defer to `erc-channel-p'.
(erc-channel-p): Refactor and use `erc--fallback-channel-prefixes' for
the default CHANTYPES value. Honor an empty CHANTYPES value as valid,
e.g., for servers that only support direct messages.
(erc--fallback-channel-prefixes): New variable to hold fallback
CHANTYPES prefixes recommended by RFC1459 and modern authorities on
the matter.
* test/lisp/erc/erc-tests.el (erc-channel-p): Revise test. (Bug#67220)
F. Jason Park [Mon, 12 Feb 2024 01:15:14 +0000 (17:15 -0800)]
Normalize ISUPPORT params with empty values in ERC
* lisp/erc/erc-backend.el (erc-server-parameters)
(erc--isupport-params): Mention parsing and storage behavior regarding
nonstandard "FOO=" tokens.
(erc--parse-isupport-value): Move comment closer to code.
(erc--get-isupport-entry): Treat the empty string as truly null, as
prescribed by the Brocklesby draft cited in the top-level comment.
* test/lisp/erc/erc-tests.el (erc--get-isupport-entry): Add case for
the empty string appearing as a value for an `erc-server-parameters'
item.
(erc-server-005): Assert compat-related behavior of retaining the
empty string as a valid value from a raw "FOO=" token.
(Bug#67220)
F. Jason Park [Mon, 12 Feb 2024 04:42:18 +0000 (20:42 -0800)]
Ignore the TGT-LIST parameter in erc-open
* etc/ERC-NEWS: Mention `erc-open' now ignores TGT-LIST.
* lisp/erc/erc.el (erc-open): Set `erc-default-recipients' to a list
containing only the supplied target. Other values may cause ERC to
malfunction. Also redo doc string.
F. Jason Park [Mon, 13 Nov 2023 20:07:36 +0000 (12:07 -0800)]
Make erc-fill-wrap depend on scrolltobottom
* lisp/erc/erc-fill.el (erc-fill-mode): Add reference to
`erc-fill-wrap-mode' in doc string.
(erc--fill-wrap-scrolltobottom-exempt-p): New variable to allow tests
involving `fill-wrap' to opt out of having to enable `scrolltobottom'.
(erc-fill--wrap-ensure-dependencies): Warn and enable
`erc-scrolltobottom-mode' if necessary.
(erc-fill-wrap-mode): Mention workaround for automatically enabling
`scrolltobottom'.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--wrap-populate):
Exempt tests from `scrolltobottom' dependency.
* test/lisp/erc/resources/erc-scenarios-common.el: Load `erc-fill'
when compiling.
(erc-scenarios-common--print-trace): Exempt tests using `fill-wrap'
from the `scrolltobottom' dependency by making
`erc--fill-wrap-scrolltobottom-exempt-p' non-nil during test runs.
(Bug#60936)
F. Jason Park [Sun, 4 Feb 2024 01:17:48 +0000 (17:17 -0800)]
Autoload custom-loads for new Custom groups in erc.el
* lisp/erc/erc.el: Add `custom-loads' library features for group
symbols `erc-spelling' and `erc-imenu' since they aren't defined in
all supported Emacs versions. Also add groups `erc-sasl' and
`erc-nicks', new libraries recently added to ERC. Note that this is
unrelated to prefixes generated for the help system. (Bug#68943)
F. Jason Park [Fri, 16 Feb 2024 04:17:20 +0000 (20:17 -0800)]
Remove "erc-" prefixed Compat definitions
* lisp/erc/erc-compat.el: Remove NO-ERROR argument from top-level
`require' for library `compat' because it's guaranteed to be present.
(erc-compat-function, erc-compat-call): Redefine as obsolete aliases
for unprefixed namesakes.
* lisp/erc/erc-fill.el (erc-fill-wrap-nudge): Use `compat-call'
instead of `erc-compat-call'.
Stefan Kangas [Wed, 14 Feb 2024 23:39:00 +0000 (00:39 +0100)]
Add cross-reference to ELisp manual Caveats
* doc/lispref/intro.texi (Caveats): Add cross-reference to Emacs manual.
Talking about "contributing code" makes little sense in a section about
reporting mistakes in the ELisp manual, so skip that part.
Andrea Corallo [Sun, 11 Feb 2024 09:43:57 +0000 (10:43 +0100)]
* Improve reproducibility of inferred values by native comp
* lisp/emacs-lisp/comp-cstr.el (comp-normalize-valset): Do not try to
reorder conses using 'sxhash-equal' as its behavior is not reproducible
over different sessions.
Loïc Lemaître [Sun, 11 Feb 2024 03:00:38 +0000 (05:00 +0200)]
Handle typescript ts grammar breaking change for function_expression
Starting from version 0.20.4 of the typescript/tsx grammar, "function"
becomes "function_expression". The right expression is used depending
on the grammar version.
* lisp/progmodes/typescript-ts-mode.el
(tsx-ts-mode--font-lock-compatibility-function-expression):
New function (bug#69024).
(typescript-ts-mode--font-lock-settings): Use it.
Eshel Yaron [Sat, 17 Feb 2024 12:28:13 +0000 (13:28 +0100)]
Optionally highlight non-matching part on completion input
* lisp/minibuffer.el (minibuffer-completing-remote-file-p)
(minibuffer-not-completing-remote-file-p): New functions.
(minibuffer-completion-fail): New face.
(minibuffer-pulse-failing-completion): New user option.
(completion--fail): Respect it.
* doc/emacs/mini.texi (Completion Options): Document it.
Eshel Yaron [Sat, 17 Feb 2024 07:45:09 +0000 (08:45 +0100)]
; Ensure 'seq-max' argument is non empty
* lisp/faces.el (completion-face-name-affixation)
* lisp/minibuffer.el (completion-styles-affixation)
(completion-file-name-affixation)
(minibuffer-narrow-buffer-completions)
(completion-buffer-name-affixation)
* lisp/simple.el (read-extended-command--affixation): Add 0 to
beginning of 'seq-max' argument to ensure it is non empty.
Eshel Yaron [Thu, 15 Feb 2024 17:37:18 +0000 (18:37 +0100)]
Deprecate 'read-no-blanks-input'
This function is unused in the Emacs tree, and it probably
shouldn't be used anywhere else, either.
* lisp/minibuffer.el (read-no-blanks-input): Turn it into an
obsolete alias of 'read-string'.
(self-insert-and-exit, minibuffer-local-ns-map): Deprecate.
Eli Zaretskii [Thu, 15 Feb 2024 10:04:07 +0000 (12:04 +0200)]
Allow font-spec in 'face-font-rescale-alist' set at startup
* lisp/startup.el (startup--rescale-elt-match-p): New function.
(normal-top-level): Use it, instead of the naive 'string-match-p',
to match the default font against the elements of
'face-font-rescale-alist'. Reported by Rahguzar
<rahguzar@zohomail.eu>.
Simen Heggestøyl [Tue, 16 Jan 2024 07:21:41 +0000 (08:21 +0100)]
Add support for reading/writing IELM input history (bug#67000)
* lisp/ielm.el (inferior-emacs-lisp-mode): Add support for saving input
history to a file.
(ielm--history-file-name): New variable indicating IELM input history
file.
(ielm--exit): Holds a function to call when Emacs is killed to write
out the input history.
(ielm--input-history-writer): Helper function for writing the IELM
input history out to file.
Stefan Monnier [Wed, 14 Feb 2024 22:18:50 +0000 (17:18 -0500)]
titdic-cnv.el: Bring all definitions under the `tit-` namespace
Add a `tit-` or `tit--` prefix where necessary. Adjust all callers.
I kept the old names via obsolete aliases for now, although it's probably not
worth the trouble.
* lisp/international/titdic-cnv.el: Bring all definitions under the
`tit-` namespace.
(tit-quail-cxterm-package-ext-info): Rename var from
`quail-cxterm-package-ext-info`. Adjust value to new names.
(tit-dic-convert): Rename from `titdic-convert`.
(batch-tit-dic-convert): Rename from `batch-titdic-convert`.
(tit-quail-misc-package-ext-info): Rename var from
`quail-misc-package-ext-info`. Adjust value to new names.
(tit--tsang-quick-converter): Rename from `tsang-quick-converter`.
(tit--tsang-b5-converter): Rename from `tsang-b5-converter`.
(tit--quick-b5-converter): Rename from `quick-b5-converter`.
(tit--tsang-cns-converter): Rename from `tsang-cns-converter`.
(tit--quick-cns-converter): Rename from `quick-cns-converter`.
(tit--py-converter): Rename from `py-converter`.
(tit--ziranma-converter): Rename from `ziranma-converter`.
(tit--ctlau-converter): Rename from `ctlau-converter`.
(tit--ctlau-gb-converter): Rename from `ctlau-gb-converter`.
(tit--ctlau-b5-converter): Rename from `ctlau-b5-converter`.
(tit-miscdic-convert): Rename from `miscdic-convert`.
(batch-tit-miscdic-convert): Rename from `batch-miscdic-convert`.
(tit-pinyin-convert): Rename from `pinyin-convert`.
* leim/Makefile.in (${leimdir}/quail/%.el, misc_convert)
(${srcdir}/../lisp/language/pinyin.el): Use the new names.
String hashing improvements (spread and performance)
Fix gaps in hashing coverage in the middle and end of even fairly short
strings. E.g., `outline-1`, `outline-2` etc all hashed to the exact
same value but with the patch, there are no collisions among the ~160000
symbols in the Emacs tree.
This change also improves average hashing speed by using fewer mixing
operations.
* src/fns.c (hash_string):
Use unit stride for fairly short strings, while retaining the cap of 8
samples for long ones.
Always hash the last word to ensure that the end of the string is
covered. For strings shorter than a word, use fewer loads and a single
reduction step.
Eshel Yaron [Wed, 14 Feb 2024 12:51:29 +0000 (13:51 +0100)]
Improve prompting 'customize-toggle-option'
* lisp/cus-edit.el (customize-option-history): New variable.
(custom-variable-prompt): Use it.
(customize-read-boolean-option): New function.
(customize-toggle-option): Use it.
Stefan Monnier [Wed, 14 Feb 2024 01:35:05 +0000 (20:35 -0500)]
hideif.el: Minor cleanup
* lisp/progmodes/hideif.el: Prefer #' to quote function names.
(hif-eval): Use `lexical-binding`.
(hif-ifx-regexp): Don't use `defconst` since `bovine/c.el` let-binds it.
(hif--intern-safe): Rename from `intern-safe` to fix this
namespace violation.
(hif-strtok): Adjust accordingly.
Steven Allen [Sat, 10 Feb 2024 18:05:11 +0000 (10:05 -0800)]
Respect :lisp-dir whilst scanning for VC package dependencies
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1):
Scan 'lisp-dir', if set, for lisp files instead of scanning the root
package directory. (Bug#69019)
Jim Porter [Tue, 13 Feb 2024 20:27:38 +0000 (12:27 -0800)]
; Compute the list of symbols for 'eshell-eval-using-options' once
* lisp/eshell/esh-opt.el (eshell--get-option-symbols): New function...
(eshell-eval-using-options): ... use it.
(eshell--do-opts, eshell--process-args): Take OPTION-SYMS.
* test/lisp/eshell/esh-opt-tests.el (esh-opt-test/process-args):
(esh-opt-test/process-args-parse-leading-options-only):
(esh-opt-test/process-args-external): Pass OPTION-SYMS in.
Eli Zaretskii [Tue, 13 Feb 2024 19:59:03 +0000 (21:59 +0200)]
Fix left-over from renaming 'comp-*' functions
* lisp/progmodes/elisp-mode.el (comp--write-bytecode-file): Call
this instead of 'comp-write-bytecode-file', its old name.
Reported by Arthur Miller <arthur.miller@live.com>.
Paul Eggert [Tue, 13 Feb 2024 17:54:51 +0000 (09:54 -0800)]
XSYMBOL eassume speedups
* src/lisp.h (XSYMBOL_WITH_POS_SYM, XSYMBOL): Help the compiler by using
eassume instead of eassert for XSYMBOL postconditions likely to be
useful for optimization later. With gcc 13.2 -O2 x86-64 this improved
speed on my usual “compile all .el files” benchmark by 0.7% and shrank
the text size of Emacs by 0.09%.
Paul Eggert [Tue, 13 Feb 2024 17:54:51 +0000 (09:54 -0800)]
Remove SYMBOL_WITH_POS_{POS,SYM}
* src/fns.c (internal_equal): Turn comment into eassert
that !symbols_with_pos_enabled.
(sxhash_obj): Simplify case of symbol with pos (when enabled).
* src/lisp.h (XSYMBOL_WITH_POS_SYM, XSYMBOL_WITH_POS_POS)
(maybe_remove_pos_from_symbol): New inline functions.
(SYMBOL_WITH_POS_SYM, SYMBOL_WITH_POS_POS): Remove.
All uses replaced by the new functions. This avoids some
double-checking in the source code, simplifies the code overall,
and avoids the need for "Type checking is done in the following
macro" comments to explain unusual code.
Paul Eggert [Tue, 13 Feb 2024 17:54:51 +0000 (09:54 -0800)]
Remove lisp_h_XCONS etc
When configured with --enable-checking and compiled with gcc -O0,
these macros evaluated arguments multiple times, which made it too
easy to mistakenly write code that behaves differently when debugging.
This patch does not affect performance in normal builds.
In --enable-checking builds with gcc -O0 it slows down my usual
benchmark (remove all '*.elc’ files and then 'make') by 4.4%.
I hope that’s good enough; if not I can complicate the macros to
tune better for debugging builds.
* src/lisp.h (lisp_h_SET_SYMBOL_VAL, lisp_h_SYMBOL_VAL)
(lisp_h_XCONS): Remove, moving each definiens to the corresponding
inline function. All uses removed.
Paul Eggert [Tue, 13 Feb 2024 17:54:51 +0000 (09:54 -0800)]
Remove lisp_h_PSEUDOVECTORP etc
* src/lisp.h (lisp_h_PSEUDOVECTORP, lisp_h_EQ, lisp_h_SYMBOLP):
Refactor by removing these macros, moving each definiens to its only
use. Now that we have symbols with position so that there is no longer
a non-lisp_h_* macro counterpart if DEFINE_KEY_OPS_AS_MACROS, there’s
no need to separate these definiens from their inline function bodies.
Paul Eggert [Tue, 13 Feb 2024 17:54:51 +0000 (09:54 -0800)]
Remove BASE2_EQ
* src/lisp.h (lisp_h_BASE2_EQ, BASE2_EQ): Remove. All uses
removed. BASE2_EQ was present only for minor optimization and
with current gcc -O2, BASE2_EQ does not affect performance, so
it’s not worth the hassle.