Commit graph

99791 commits

Author SHA1 Message Date
Basil L. Contovounesios
24349bd86d Mark add-log-always-start-new-record as safe
* lisp/vc/add-log.el (add-log-always-start-new-record): Mark as
safe-local-variable (bug#80408).
2026-02-17 13:37:04 +01:00
Juri Linkov
e91f68b742 ; * lisp/treesit.el (treesit-hs-find-next-block): Add guard (bug#80422). 2026-02-17 09:20:16 +02:00
Dmitry Gutov
988e898749 project--delete-zombie-projects: Bind tramp-error-show-message-timeout to nil
* lisp/progmodes/project.el (project--delete-zombie-projects):
Bind tramp-error-show-message-timeout to nil, to instruct Tramp
not to display the "failed to connect" and its message, hiding the
current prompt (bug#80340).
2026-02-17 03:48:22 +02:00
Juri Linkov
e3755a5eb8 Change the default value of 'split-width-threshold' from 160 to 150
* lisp/window.el (split-width-threshold): Change the default value
from 160 to 150 (bug#80050).
(split-window-preferred-function):
Mention 'split-window-preferred-direction' in the docstring.
2026-02-16 19:48:43 +02:00
Paul Nelson
509228fc6c Add repeat-map for smerge-mode commands
* lisp/vc/smerge-mode.el (smerge-repeat-map): New keymap (bug#80414).
2026-02-16 19:27:29 +02:00
Elias Gabriel Perez
f10075d78a * lisp/treesit.el (treesit-hs-find-next-block): Fix infloop. (bug#80232) 2026-02-16 19:12:22 +02:00
Michael Albinus
aa12e014f6 * lisp/system-sleep.el (sleep-event-state): Define to autoload. 2026-02-16 14:06:26 +01:00
Eli Zaretskii
2b4d088257 ; Unbreak the build broken by a recent commit
* lisp/system-sleep.el (sleep-event): Don't autoload cl-defstruct.
2026-02-16 14:16:27 +02:00
Basil L. Contovounesios
d97326035c ; * lisp/tutorial.el: Remove unneeded require. 2026-02-16 10:47:29 +01:00
Stéphane Marks
3beb804e3a ; Minor updates to system-sleep (bug#80348)
- Add several autoload cookies.
- Separate public API hook used internally into a private hook.
- Fix thinko in setting up the special event sleep-event handler.
- Probe the D-Bus session bus for screen saver support during
enable.

* lisp/system-sleep.el (system-sleep--set-back-end): Move dbus
endpoint tests into the system-sleep--enable dbus
implementation.
(system-sleep--event-after-hook-functions): New private hook.
(system-sleep--dbus-has-screensaver): New defvar.
(system-sleep--sleep-event-handler): Call the new private hook.
(system-sleep--sleep-event-function): Remove.  Use
'system-sleep--sleep-event-handler'.
(system-sleep--enable): Use the internal hook.
(system-sleep--enable): [dbus] Probe session bus for screen
saver support.
(system-sleep--disable): Remove the new internal hook.
(system-sleep--block-sleep): Call screen saver dbus endpoint
only when screen saver support is known to exist.
2026-02-16 10:23:10 +01:00
Heinz Fridolin
e2bf7ce8b6 project.el: Fix in submodules with nonexistent git root (bug#80402)
project-try-vc--search in a submodule directory tries to find the git
root directory, so the local variable root would be set to nil if it
didn't exist. Calling project--vc-merge-submodules-p on nil would lead
to a crash, so now the while loop aborts beforehand.
2026-02-15 18:23:51 +02:00
Vili Aapro
9a5eafa8c3 elisp--highlight-function-argument: Handle special syntax correctly
* lisp/progmodes/elisp-mode.el
(elisp--highlight-function-argument): Handle special usage
syntax correctly when scanning usage arguments using
'forward-sexp' (bug#8432).  Before binding 'origin', skip over
blanks, so as not to highlight them, and to move immediately
before any possible opening square brackets.  After binding
'origin' and before calling 'forward-sexp', skip over opening
square brackets, so as to highlight them.  After calling
'forward-sexp' and before setting 'start' and 'end', skip over
closing square brackets and periods, so as to highlight them.
2026-02-15 11:16:11 +00:00
Vili Aapro
8c39a17eef elisp--highlight-function-argument: Use forward-sexp
* lisp/progmodes/elisp-mode.el
(elisp--highlight-function-argument): Use 'forward-sexp' to move
over usage arguments, handling parenthesized argument patterns
monolithically (bug#8432).  Set 'start' and 'end' to the
beginning and end, respectively, of the usage argument.
2026-02-15 11:16:11 +00:00
Vili Aapro
7d2303aef8 elisp--highlight-function-argument: Use temporary buffer
* lisp/progmodes/elisp-mode.el
(elisp--highlight-function-argument): Insert 'args' into
temporary buffer to prepare for better handling of usage
arguments (bug#8432).  Move point after the first opening
parenthesis of the arguments string.  In the loop, let `origin'
track the point.  No functional change.
2026-02-15 11:16:11 +00:00
Richard Lawrence
858cebd6c5 Fix failing iCalendar tests when TZ=UTC
* lisp/calendar/diary-icalendar.el (diary-icalendar--tz-is-utc-p): New
function.
(diary-icalendar-convert-time-via-strategy): Don't expect a VTIMEZONE
for UTC times.
(diary-icalendar-export-region): Don't generate a VTIMEZONE for 'local
export strategy in UTC.
* test/lisp/calendar/diary-icalendar-tests.el
(diary-icalendar-test-entry-parser): Don't generate a VTIMEZONE for
'local export strategy in UTC.
2026-02-15 12:01:24 +01:00
Eli Zaretskii
9176826f41 ; * lisp/delsel.el: Load cl-lib when byte-compiling to avoid warning. 2026-02-15 07:16:52 +02:00
Yikai Zhao
cdf360059f Fix project-buffers error on buffers with nil default-directory
* lisp/progmodes/project.el (project-buffers):
Check that default-directory is non-nil (bug#80390).
2026-02-15 04:22:45 +02:00
Stefan Monnier
f4a1c00656 delsel.el: Improve the overlay for text replacement
* lisp/delsel.el (delete-selection-replacement-face): Delete var.
(delete-selection-replacement): New face, to replace it.
(delsel--replace-overlay, delsel--replace-text): Delete vars and ...
(delete-selection--replacement-text): ...use this single var instead.
(delete-selection--replacement-cursor): New function.
(delete-active-region): Use it with `cursor-sensor-mode` to avoid the
overlay lingering too long.
(delete-selection--replacement-text): New function extracted from
`delete-selection-repeat-replace-region`, with adjustments to account
for the above changes.
(delete-selection-repeat-replace-region): Use it.

* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--detect): Do use
`get-pos-property` when it works.  Fix the `missing-p` subfunction
so as not to get fooled by a missing property at END.
2026-02-14 16:55:06 -05:00
Kim F. Storm
38760d4ba7 delsel.el: Use an overlay to track the replacement text
This patch was sent back in 2014 as part of bug#18886.

* lisp/delsel.el (delsel--replace-text-or-position): Delete var.
(delete-selection-replacement-face): New defcustom.
(delsel--replace-text, delsel--replace-overlay): New vars.
(delete-active-region, delete-selection-repeat-replace-region):
Use overlay to track replacement text instead of abusing the
undo-list; this allows the text to be edited before it is
used for substitutions.  Add highlight to the replacement text.
2026-02-14 16:55:01 -05:00
Basil L. Contovounesios
973d5d457b Prefer value< with new 'sort' in json.el
Now that json.el uses the new sort calling convention, there's no
need to prefer string< over value<, which may even run faster.
Suggested by Mattias Engdegård <mattias.engdegard@gmail.com>.

* lisp/json.el (json-encoding-object-sort-predicate): Mention value<
in docstring.
(json-pretty-print-buffer-ordered, json-pretty-print-ordered): Use
value< in place of string<.
* test/lisp/json-tests.el (test-json-encode-hash-table-sort): Use
value< as json-encoding-object-sort-predicate in at least one test.
2026-02-14 18:56:44 +01:00
Sean Whitton
ee8b2d8ae2 vc-pull-and-push: Fix when visiting untracked files
* lisp/vc/vc.el (vc-pull-and-push): Don't fail when called from
buffers visiting unregistered or ignored files.
2026-02-14 15:33:44 +00:00
Sean Whitton
f408460cb1 * lisp/vc/vc.el (vc-push): Fix when visiting untracked files. 2026-02-14 15:32:08 +00:00
Philip Kaludercic
ee7c4ed5d8
Don't invoke Dired with -R when reviewing packages
* lisp/emacs-lisp/package.el (package-review): Remove
potentially unportable "-R" switch when calling 'dired'.
2026-02-14 16:29:33 +01:00
Philip Kaludercic
36f35a774b
; Remove 'package-vc-version' declaration 2026-02-14 16:29:33 +01:00
Philip Kaludercic
49c8dd44af
; Remove unnecessary 'inline' require from package.el
* lisp/emacs-lisp/package-activate.el (package-vc-p): Define
using a regular 'defun'.
2026-02-14 16:29:33 +01:00
Philip Kaludercic
d734b240fb
Do not upgrade VC packages using 'package-upgrade'
* lisp/emacs-lisp/package.el (package-upgrade): Trigger error
redirecting user to use 'package-vc-upgrade'.
(package--upgradeable-packages): Exclude VC packages from list
of "upgradable" packages.
2026-02-14 16:29:32 +01:00
Sean Whitton
768c68942e Fix vc-pull from buffers visiting untracked files
* lisp/vc/vc.el (vc-pull): Don't fail when called from buffers
visiting unregistered or ignored files so long as there is a
'pull' function available from the backend.
2026-02-14 15:29:07 +00:00
Sean Whitton
bc763572a9 vc-find-backend-function: Require vc for default implementations
* lisp/vc/vc-hooks.el (vc-find-backend-function): Require vc for
default implementations (bug#80254).  Report and fix due to
Daniel Mendler <mail@daniel-mendler.de>.
2026-02-14 15:03:52 +00:00
Sean Whitton
805d76790d ; vc-user-edit-command-history: Expand docstring. 2026-02-14 14:47:09 +00:00
Eli Zaretskii
5be60a2003 ; Update ldefs-boot.el. 2026-02-14 09:17:15 -05:00
Stéphane Marks
003962fa5f vtable fixes for tty rendering (bug#80312)
* lisp/emacs-lisp/vtable.el (vtable--insert-line): Do not
produce a divider after the final column.  This thinko is more
noticeable on a tty.
(vtable--insert-header-line): On a tty, nullify indicator
padding.
(vtable-tty-char-pixel-width): New defconst.
(vtable--compute-width): On a tty, adjust column width specified
in pixels down by a factor of 'vtable-tty-char-pixel-width'.
(vtable--alter-column-width): On a tty, adjust column width in
characters, otherwise in pixels.
2026-02-14 15:22:16 +02:00
Sean Whitton
16f1ca1acc Improve vc-git-topic-outgoing-base fallback algorithm
* lisp/vc/vc-hg.el (vc-hg--bookmarks): New function.
(vc-hg-trunk-or-topic-p):
* lisp/vc/vc-git.el (vc-git--branch-remotes)
(vc-git-trunk-or-topic-p): New optional BRANCH argument.
(vc-trunk-or-topic-p): Declare.
(vc-git-topic-outgoing-base): Consider only local trunks, if
there are any (bug#80006).
* lisp/vc/vc.el (trunk-or-topic-p): New optional BRANCH
argument.
(vc-trunk-or-topic-p): New function.
(vc--outgoing-base): Call it.
2026-02-14 13:20:08 +00:00
Visuwesh
cf27004e8c Escape attribute values and string DOMs when inserting them
* lisp/net/shr.el (shr-dom-print): Escape these strings, as done
in `dom-print', to prevent producing an erroneous XML document.
* test/lisp/net/shr-tests.el (dom-print-escape): Add new test
(Bug#80383).
2026-02-14 15:04:31 +02:00
Eli Zaretskii
114fab51c0 Fix 'eglot-imenu'
* lisp/progmodes/eglot.el (eglot--imenu-SymbolInformation): Fix
call to 'plist-get'.  Patch by Lester Longley <lester@ieee.org>.
(Bug#80367)

Copyright-paperwork-exempt: yes
2026-02-14 14:22:08 +02:00
Eli Zaretskii
6a1a544a90 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2026-02-14 13:59:53 +02:00
Eli Zaretskii
a444f2c7f9 ; Fix last change
* lisp/textmodes/page-ext.el (pages-directory-list-all-headers-p)
(pages-directory-count-lines-p): Doc fixes.
2026-02-14 13:59:26 +02:00
Marco Wahl
8aa8ab8b03 Add revert capability for page directory buffer
* lisp/textmodes/page-ext.el (pages-directory-revert-function): New
function.
(pages-directory-list-all-headers-p, pages-directory-count-lines-p)
(pages-directory-regexp): New variables to store the page directory
style.  (Bug#80319)
2026-02-14 13:56:26 +02:00
Eshel Yaron
27070b0c47
; completion-preview.el: Refine recent addition.
* lisp/completion-preview.el
(completion-preview-inhibit-functions): Reposition, add
:version tag.
2026-02-14 12:47:07 +01:00
Eshel Yaron
048e9553a8
; Add t as a possible value for 'completion-preview-commands'
* lisp/completion-preview.el (completion-preview-commands):
Allow the value t, which says that completion preview should
be attempted after any command.
* lisp/completion-preview.el
(completion-preview-require-certain-commands): Adapt.
2026-02-14 12:33:29 +01:00
Eshel Yaron
47b48346a3
New option 'completion-preview-inhibit-functions' (bug#80370)
* lisp/completion-preview.el
(completion-preview-inhibit-functions): New option.
(completion-preview--post-command): Respect it.
* etc/NEWS: Announce it.
2026-02-14 12:33:28 +01:00
Eli Zaretskii
25d0259a29 ; * lisp/speedbar.el (speedbar-get-focus): Doc fix. 2026-02-14 12:56:22 +02:00
Matthias Meulien
a93f4f3d93 Support 'speedbar-prefer-window' in 'speedbar-get-focus'
* lisp/speedbar.el (speedbar-get-focus)
(speedbar-frame-or-window): Support for 'speedbar-prefer-window'
with fix of 'speedbar-window' trying to delete current frame.
(Bug#80392)
2026-02-14 12:52:07 +02:00
Eli Zaretskii
187867f0a9 ; 'package--autosuggest-after-change-mode': Improve help-echo. 2026-02-14 08:52:00 +02:00
Stefan Monnier
9fe325c935 ede/proj-shared.el: Remove leftover obsolete EIEIO name arguments
* lisp/cedet/ede/proj-shared.el (ede-gcc-shared-compiler)
(ede-gcc-libtool-shared-compiler, ede-cc-linker-libtool)
(ede-g++-shared-compiler, ede-g++-libtool-shared-compiler)
(ede-g++-linker-libtool): Remove obsolete name argument to `clone`.
2026-02-13 23:48:32 -05:00
Dmitry Gutov
a937396e76 vc-log-show-limit: Change default to 500, and the button to 4X
* lisp/vc/vc.el (vc-log-show-limit):
Change the default to 500 (bug#80037).
(vc-print-log-setup-buttons): Have the first button prompt and
propose 4X the current limit as the default.
(vc-print-fileset-branch-log):
Update the reference to the changed button text.

* lisp/vc/log-view.el (log-view-end-of-defun-1): Same.

* doc/emacs/maintaining.texi (VC Change Log): Also here.
2026-02-14 02:52:52 +02:00
João Távora
aa181cd352 Rewrite flex completion with Gotoh algorithm
The greedy regexp matching, broken scoring and broken highlight were
sources of frequent complaints about the 'flex' matching style.  This
commit fixes that.

Inspired by the 'hotfuzz' style (available at
https://github.com/axelf4/hotfuzz) it uses a modified version of Gotoh's
1982 dynamic programming algorithm. It is strictly more correct than the
"old" flex.  For example, when matching the pattern 'goto' to no longer
will 'eglot-format' be sorted before some hypothetical much better
'goobarbaz-goto'.  And of course the highlighting is also correctly
placed on the 'goto', not scattered across the candidate.

Regarding performance, it is faster than the naive 'flex', primarily
because of the Elisp rewrite in minibuffer.el.  The matching and costing
algorithm matters but is not the bottleneck.

The Elisp parts of the style were almost completely decoupled from the
pcm/substring styles in lisp/minibuffer.el.  Only
'completion-flex-try-completion' uses some of pcm's code for pattern
augmentation.

* src/minibuf.c (completion--flex-cost-gotoh): New function.

* lisp/minibuffer.el (completion-flex--pattern-str): New variable.
(flex-score-match-tightness): Make obsolete.
(completion--flex-all-completions-1): New helper function.
(completion-flex-try-completion, completion-flex-all-completions): Rewrite.
(completion-substring--all-completions): No longer take transform-pattern-fn.
(completion--flex-adjust-metadata): Tweak.
(completion--flex-score, completion--flex-score-1)
(completion--flex-score-last-md, completion-flex--make-flex-pattern): Delete.

* test/lisp/minibuffer-tests.el (completion--sorted-flex-completions):
New helper function.
(completion-flex-test-non-ascii): New test.
(completion--pcm-score): Delete.
(completion-pcm-test-3, completion-pcm-test-4)
(completion-substring-test-1, completion-substring-test-2)
(completion-flex-test-2, completion-flex-test-3): Tweak.

* etc/NEWS: Describe change.
2026-02-13 23:46:11 +00:00
Philip Kaludercic
52b24ed7aa
Only check regular files for package metadata
* lisp/emacs-lisp/package.el (package-dir-info): Do not check
files that do not satisfy 'file-regular-p' when trying to find
the file with the package metadata.  (Bug#79742)
2026-02-13 22:47:59 +01:00
Philip Kaludercic
567155047c
Improve 'package-upgrade-all' robustness
* lisp/emacs-lisp/package.el (package-upgrade-all): Do not quit
because a single upgrade fails with an error.  (Bug#80357)
2026-02-13 22:23:01 +01:00
Philip Kaludercic
d092c8f63a
Fix 'help-echo' for package suggestions in mode line
* lisp/emacs-lisp/package-activate.el (package--autosugest-line-format):
Remove variable and function.
(package--autosuggest-after-change-mode): Inject upgrade prompt
using ':propertize'.  We can drop the condition testing if there
are any suggestions, as installing the package changes the major
mode and thus also 'mode-name'.
2026-02-13 22:01:35 +01:00
Philip Kaludercic
7470151179
Autoload 'diff-no-select'
* lisp/emacs-lisp/package.el (package-review): Remove
unnecessary 'require'.
* lisp/eshell/em-unix.el: Remove declaration.
* lisp/files.el (save-some-buffers-action-alist): Remove
unnecessary 'require'.
* lisp/vc/diff.el (diff-no-select): Autoload it.

(Bug#80288)
2026-02-13 19:53:12 +01:00