Paul Eggert [Wed, 21 May 2025 17:07:04 +0000 (10:07 -0700)]
Work around GCC bug 117423
Problem reported by Oliver Reiter and Pip Cet (Emacs bug#78473).
It looks like GCC tree-sra is trouble in general with how Emacs
uses unions, so disable tree-sra until the GCC bug is fixed.
* configure.ac (C_SWITCH_MACHINE): Also work around GCC bug 117423.
Juri Linkov [Wed, 21 May 2025 06:31:45 +0000 (09:31 +0300)]
* lisp/treesit.el: New variables for 'down-list' and 'up-list'.
(treesit-sexp-type-down-list, treesit-sexp-type-up-list):
New buffer-local variables.
(treesit-down-list): Use 'treesit-sexp-type-down-list'.
(treesit-up-list): Use 'treesit-sexp-type-up-list'.
* lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode):
Set 'treesit-sexp-type-down-list' and
'treesit-sexp-type-up-list' to 'list'.
Stephen Berman [Tue, 20 May 2025 13:29:58 +0000 (15:29 +0200)]
Fix todo-mode item insertion bug (bug#78506)
* lisp/calendar/todo-mode.el (todo-insert-item--next-param): Unset
transient keymap on completing default or copy item insertion
command, to ensure that the next Todo mode key is recognized.
Juri Linkov [Tue, 20 May 2025 18:30:38 +0000 (21:30 +0300)]
* lisp/tab-line.el (tab-line-move-tab-forward): New command.
(tab-line-move-tab-backward): New command.
(tab-line-mode-map): Bind 'C-x M-<left>' to
'tab-line-move-tab-backward' and 'C-x M-<right>' to
'tab-line-move-tab-forward'.
(tab-line-switch-repeat-map): Bind 'M-<left>' to
'tab-line-move-tab-backward' and 'M-<right>' to
'tab-line-move-tab-forward'.
Suggested by pinmacs <pinmacs@cas.cat>.
Spencer Baugh [Mon, 19 May 2025 15:35:38 +0000 (11:35 -0400)]
Fix 'completion-ignore-case' with 'completion--file-name-table'
509cbe1c35b3d "Improve env var handling in read-file-name"
caused 'try-completion' and 'all-completion' operations with
'completion--file-name-table' to no longer update the case of
text which was already present in the input string. That is,
completions would be returned ignoring case, but the completions
would have letter-casing which matched the input string rather
than matching the actual file names.
This was caused by unnecessarily replacing text in the returned
file name completions with text from the input string ORIG,
which in turn was caused by the desire to preserve text from
ORIG even after 'substitute-in-file-name' changed it. Fix this
by detecting when ORIG was not substantially changed by
'substitute-in-file-name'; in that case, the returned file name
completions also don't need substantial changes.
* lisp/minibuffer.el (completion--file-name-table): Use text
from the completions, not the input string. (Bug#78323)
* test/lisp/minibuffer-tests.el (completion-table-test-quoting):
Test with 'completion-ignore-case' as well.
Stefan Monnier [Sun, 18 May 2025 19:48:54 +0000 (15:48 -0400)]
eww.el: Misc changes
* lisp/net/eww.el (eww--parse-html-region): Don't decode when it's a no-op.
(eww-display-raw): Simplify.
(eww-mode): Prefer #' to quote function names.
(eww-switch-to-buffer): Use `completion-table-with-metadata` instead of
`completion-extra-properties`. Don't prompt the user when there's only
one choice.
(eww-buffer-list): Use `eww--buffer-p`.
Stefan Monnier [Sun, 18 May 2025 19:44:35 +0000 (15:44 -0400)]
eww.el: Use `track-changes`
* lisp/net/eww.el: Require `track-changes`.
(eww-display-document): Don't `inhibit-modification-hooks` any more.
Use `track-changes-register` *at the end* instead.
(eww-mode): Don't use `after-change-functions` any more.
(eww--track-changes): New function.
(eww--process-text-input): Rename from `eww-process-text-input`.
Try and be more careful: don't presume `point` is near
the modification. Check for a form both at BEG and at END.
Don't rely on `:start/:end` pointing to the right places.
Use `:length` instead and shrink the field back to its original length
when possible.
(eww-size-text-inputs): Set `:length` rather than `:start/:end`.
Stefan Monnier [Sat, 17 May 2025 18:23:34 +0000 (14:23 -0400)]
editorconfig.el: Fix bug#78097
When there is no `.editorconfig` variable, the
`file-name-directory` call can signal an error, but that can
happen only if `editorconfig-get-local-variables-functions`
added entries "out of thin air". So just skip running that hook
to avoid this corner case.
* lisp/editorconfig.el (editorconfig--get-dir-local-variables):
Don't run `editorconfig-get-local-variables-functions` when we found no
EditorConfig settings.
Po Lu [Sun, 18 May 2025 00:46:27 +0000 (08:46 +0800)]
Prevent double frees in closing fonts provided by the Haiku font driver
* src/haikufont.c (haikufont_close): Clear INFO->metrics,
glyphs, be_font after they are released and do not attempt to
access them if NULL. (bug#77478)
* lisp/net/eww.el (eww--buffer-p): New function.
(eww-switch-to-buffer): Use it. And set `completion-extra-properties`
buffer-locally rather than let-binding it.
Eli Zaretskii [Sat, 17 May 2025 13:46:07 +0000 (16:46 +0300)]
Support 'dired-hide-details-mode' in find-lisp.el
* lisp/find-lisp.el (find-lisp-find-dired-insert-file): Call
'dired-insert-set-properties' to support 'dired-hide-details-mode'
in the resulting Dired display. (Bug#78455)
Eli Zaretskii [Sat, 17 May 2025 09:35:29 +0000 (12:35 +0300)]
; Remove confusing text from ELisp manual
* doc/lispref/variables.texi (Defining Variables): Remove outdated
confusing warning. For the details, see
https://lists.gnu.org/archive/html/emacs-devel/2025-05/msg00332.html.
Buttonize the ellipsis and optionally display in the ellipsis
the total number of hidden lines.
* lisp/progmodes/hideshow.el (hs-display-lines-hidden): New
user option.
(hs-ellipsis): New face.
(hs-make-overlay): Tweak.
(hs--get-ellipsis): New function.
* doc/emacs/programs.texi (Hideshow): Update documentation.
* etc/NEWS: Announce changes.
Richard Lawrence [Sun, 11 May 2025 05:47:42 +0000 (07:47 +0200)]
Fix DTSTART date when exporting `diary-float'
Instead of using current date as DTSTART and then excluding it
when it doesn't match the `diary-float' rule, just use the first
date which matches the rule in `icalendar-recurring-start-year'.
* lisp/calendar/icalendar.el (icalendar--convert-float-to-ical):
Compute the correct date.
* test/lisp/calendar/icalendar-tests.el: Add a test for the
reported test case. (Bug#78085)
New pulse functions for pulse faces and new file for ring bell fns
These new pulse functions allow pulse any defined face briefly.
The new file contains functions intended to be used in
`ring-bell-function' as alternatives to `visible-bell'.
* lisp/pulse.el (pulse-face-duration): New user option.
(pulse-flash-face): New function.
* lisp/ring-bell-fns.el (flash-face-attributes)
(flash-face-faces): New user options.
(flash-face-bell-function, flash-echo-area-bell-function):
New functions. (bug#77715)
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--indent-rules): Make sure each new ternary
branch is aligned with the previous one.
* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts:
(Chained ternary expressions): New test.
* src/eval.c (default_toplevel_binding, local_toplevel_binding):
Loop upwards, not downwards, given that we want the earliest
relevant binding present in the stack.
Stephen Berman [Sat, 10 May 2025 14:25:05 +0000 (16:25 +0200)]
Improve Electric Pair mode documentation (bug#78021)
* doc/emacs/programs.texi (Matching): Clarify and improve
documentation of Electric Pair mode.
* lisp/elec-pair.el: Improve description in header line. Add text
and a reference to the Emacs user manual in the Commentary section.
(electric-pair-skip-self, electric-pair-inhibit-predicate)
(electric-pair-preserve-balance)
(electric-pair-delete-adjacent-pairs)
(electric-pair-open-newline-between-pairs)
(electric-pair-skip-whitespace)
(electric-pair-skip-whitespace-function)
(electric-pair-analyze-conversion)
(electric-pair--skip-whitespace)
(electric-pair-text-syntax-table, electric-pair--with-syntax)
(electric-pair-syntax-info, electric-pair--insert)
(electric-pair--syntax-ppss, electric-pair--balance-info)
(electric-pair-inhibit-if-helps-balance)
(electric-pair-skip-if-helps-balance)
(electric-pair-open-newline-between-pairs-psif)
(electric-pair-mode): Clarify and improve doc strings and some comments.
(electric-pair-post-self-insert-function): Restructure doc string
to shorten overlong first line, and reformat overlong lines of code.
Juri Linkov [Wed, 14 May 2025 06:57:40 +0000 (09:57 +0300)]
Use JSX comments on jsx treesit nodes in js-ts-mode and tsx-ts-mode
* lisp/progmodes/js.el (js--treesit-comment-jsx): New internal variable.
(js--treesit-comment-setup): New function.
(js-ts-mode): Set buffer-local 'comment-setup-function' to
'js--treesit-comment-setup'.
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-base-mode):
Set buffer-local 'comment-setup-function' to 'js--treesit-comment-setup'.
Eli Zaretskii [Tue, 13 May 2025 11:45:04 +0000 (14:45 +0300)]
Eglot: Fix parsing file:// URIs on MS-Windows
* lisp/progmodes/eglot.el (eglot-uri-to-path): Remove the leading
slash in MS-Windows file names only if they begin with a slash.
This adjusts the function to the recent fix for bug#76982 in
'url-generic-parse-url', which previously would produce file names
that begin with an extra slash. (Bug#78392)
Stefan Monnier [Mon, 12 May 2025 21:49:02 +0000 (17:49 -0400)]
help.el: Don't abuse `inhibit-modification-hooks`
* lisp/help.el (substitute-command-keys):
Set `inhibit-modification-hooks` locally so it doesn't affect
downstream function.
(help--window-setup): Don't let-bind `inhibit-modification-hooks`.
It was introduced accidentally in commit cd87a5c7a18e.
Stefan Monnier [Mon, 12 May 2025 19:25:05 +0000 (15:25 -0400)]
comint.el: Cosmetic changes
* lisp/comint.el: Prefer #' to quote function names.
(comint-mode): Turn some of the `make-local-variable`s to `setq-local`
or `defval-local`.
(comint-osc-hyperlink): Delete bogus alias.
(comint-replace-by-expanded-history-before-point): Use `looking-at-p`.
(comint-history-isearch-wrap): Share a bit more code.
Juri Linkov [Mon, 12 May 2025 18:23:03 +0000 (21:23 +0300)]
* lisp/treesit.el (treesit--parser-overlay-offset): New variable.
(treesit-parsers-at): Use it (bug#77906).
(treesit-forward-sexp, treesit--forward-list-with-default)
(treesit-up-list): Let-bind 'treesit--parser-overlay-offset'.
Eli Zaretskii [Mon, 12 May 2025 12:08:20 +0000 (15:08 +0300)]
Fix filelock-tests on MS-Windows
* test/src/filelock-tests.el (filelock-tests-file-locked-p-spoiled)
(filelock-tests-unlock-spoiled)
(filelock-tests-kill-buffer-spoiled): Don't special-case
MS-Windows, as it was evidently fixed to signal the same error as
Posix systems.
Sean Whitton [Mon, 12 May 2025 09:11:18 +0000 (10:11 +0100)]
diff-mode-shared-map: Don't inherit from special-mode-map
* lisp/vc/diff-mode.el (diff-mode-shared-map): No longer inherit
from special-mode-map.
(diff-mode-map): Tidy up list of unbindings now that we no
longer need to override any bindings from special-mode-map.
(minor-mode-map-alist): <diff-mode-read-only>: Ensure that the
minor mode keymap continues to inherit from special-mode-map by
calling make-composed-keymap here.
Eli Zaretskii [Sun, 11 May 2025 16:27:13 +0000 (19:27 +0300)]
Avoid unnecessary calls to GetFileAttributes on MS-Windows
* src/w32.c (access_attrs): New function, refactored from
'faccessat'.
(faccessat): Call 'access_attrs' early to determine whether the
file doesn't exist, and if so, avoid calling 'chase_symlinks'.
Also avoid calling 'chase_symlinks' if it is known that the file
cannot be a symlink, given its attributes. (Bug#78341)
Eli Zaretskii [Sun, 11 May 2025 10:33:24 +0000 (13:33 +0300)]
Support sub-second file time-stamps on MS-Windows
* nt/inc/sys/stat.h (struct stat): New members for nsec part of
file times.
* lib-src/ntlib.c (convert_time):
* src/w32.c (convert_time): Accept an additional argument
TIME_NSEC and set it to the sub-second part of time. All callers
changed.
João Távora [Sun, 11 May 2025 10:14:02 +0000 (11:14 +0100)]
Tweak .clangd to work with gcc-compiled Emacs (bug#78367)
A Gcc configuration of Emacs emits -fstrict-flex-arrays but
clangd doesn't understand that. This causes spurious errors of
"unknown flag" that prevent analysis. So tweak .clangd to the
nearest clang equivalent (which is very similar).
Eli Zaretskii [Sat, 10 May 2025 10:11:22 +0000 (13:11 +0300)]
Fix indentation of XML comments
* lisp/nxml/nxml-mode.el (nxml-compute-indent-in-delimited-token):
Fix indentation in XML comments with empty lines. Patch by John
Ciolfi <ciolfi@mathworks.com>. (Bug#73206)
Michael Albinus [Sat, 10 May 2025 08:05:51 +0000 (10:05 +0200)]
Improve Tramp's make-process handling for Solaris
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Disable buffering also for remote Solaris hosts.
Reported by Stacey Marshall <stacey.marshall@gmail.com>.
Yuan Fu [Wed, 7 May 2025 03:57:06 +0000 (20:57 -0700)]
Make treesit--simple-indent-eval more permissive (bug#78065)
* lisp/treesit.el (treesit--simple-indent-eval): Allow EXP to be
anything, so higher-order indent presets can take anything as an
argument: t, nil, symbols, keywords, etc.