Commit graph

181070 commits

Author SHA1 Message Date
João Távora
d5cec67dcc Merge branch 'master' into feature/newflex 2026-02-06 22:39:23 +00:00
João Távora
ec5479f0b5 Eglot: fix thinko in eglot--async-request
Just because a specific request of a specific "hint" is
cancelled doesn't mean we can cancel the other's too.  Also
eglot-advertise-cancellation = nil was subtly broken.

This manifested itself mostly in Eglot semantic tokens.

* lisp/progmodes/eglot.el (eglot--async-request): Fix thinkos.
2026-02-05 22:39:19 +00:00
Mattias Engdegård
4169720313 ; * test/lisp/vc/ediff-mult-tests.el: use ert-with-temp-directory
Suggested by Pip Cet.
2026-02-05 17:36:18 +01:00
Mattias Engdegård
893e0783c9 ; * lisp/subr.el (take-while): bytecode micro-optimisation 2026-02-05 17:36:17 +01:00
João Távora
afb422bb98 Rewrite flex completion scoring 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.

It was inspired by the 'hotfuzz' style available at
https://github.com/axelf4/hotfuzz which is a modified version of Gotoh's
1982 dynamic programming algorithm (see: GOTOH, Osamu. An improved
algorithm for matching biological sequences. Journal of molecular
biology, 1982, 162.3: 705-708.).  That style is slightly more
sophisticated than 'flex' (has special rules for matching things at word
boundaries, a C module with multithreading support).  It's almost (but not
entirely) void of hacks so it'd make a good candidate to replace 'flex'
entirely, but no progress has been made in getting it into Emacs's core
in over 2 years, so I thought I'd try my hand at it.

The new 'flex' implementation also uses Gotoh algorithm (apparently
a common choice for these kinds of task) and happens mostly in a new C
function.  It is strictly more correct than the "old" flex.  For
example, when matching the pattern 'goto' to, say, 'eglot--goto' and
'eglot--bol', no longer is the latter returned first, which was a
substantial annoyance.  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', but that's
mainly because this commit also includes changes to the Elisp code which
make faster regexp's for the filtering step.  It is slower than
'hotfuzz' when that style's C-module extension is leveraged.  'hotfuzz'
does the filtering and sorting steps together in C code and has
multithreaded workers there.  The matching and scoring algorithm itself
is not the bottleneck.

Test code were refactored and more tests were added.

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

* lisp/minibuffer.el (completion--flex-score): Rewrite.
(completion--flex-propertize): New function.
(completion-flex--pattern-str): New variable.
(flex-score-match-tightness): Make obsolete.
(completion-pcm--all-completions): Add optional override-re parameter.
(completion-pcm--hilit-commonality): No more re-based highlighting.
(completion-substring--all-completions): Add optional simple-re parameters.
(completion--flex-adjust-metadata): Tweak to new scoring API.
(completion-flex-try-completion, completion-flex-all-completions):
Pass simple-re parameter to completion-substring--all-completions.
(completion--hilit-from-re, completion--flex-score-1)
(completion--flex-score-last-md, completion-pcm--regexp): 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): Remove old scoring
expectations.
2026-02-05 15:17:42 +00:00
Sean Whitton
a06cddec20 ; diff--revert-kill-hunks: Hoist binding inhibit-read-only. 2026-02-05 12:24:05 +00:00
Sean Whitton
3863449a0a ; * lisp/window.el (window--frame-landscape-p): Tweak wording. 2026-02-05 12:18:54 +00:00
Visuwesh
e2f9e6ba7d vc-git--mailinfo: Use file-local-name (bug#80295, bug#80320)
* lisp/vc/vc-git.el (vc-git--mailinfo):
Use file-local-name (bug#80295, bug#80320).
2026-02-05 12:11:53 +00:00
Protesilaos Stavrou
dda572a2fa New minibuffer history for vc-user-edit-command (bug#80169)
* lisp/vc/vc-dispatcher.el (vc-user-edit-command-history): New variable.
(vc-user-edit-command): Use it (bug#80169).
* etc/NEWS: Announce it.
2026-02-05 12:01:43 +00:00
Sean Whitton
10aa35bab7 Bind "u", "@" in diff-mode-read-only-map, not diff-mode-shared-map
* lisp/vc/diff-mode.el (diff-mode-shared-map): Move bindings for
"u" and "@" from here ...
(diff-mode-read-only-map): ... to here.
2026-02-05 11:49:28 +00:00
Sean Whitton
ccee1c0de6 ; Improve outgoing base command docstrings. 2026-02-05 11:46:01 +00:00
Sean Whitton
0dfaa75612 Bind "s" in diff-mode-read-only-map, not diff-mode-shared-map
* lisp/vc/diff-mode.el (diff-mode-shared-map): Move binding for
"s" from here ...
(diff-mode-read-only-map): ... to here (bug#80330).
2026-02-05 11:31:05 +00:00
Eli Zaretskii
8beb69b77c ; Fix cross references in "User Lisp Directory"
* doc/emacs/custom.texi (User Lisp Directory): Fix wording,
punctuation, and cross-references.  (Bug#80321)
2026-02-05 11:28:13 +02:00
Troy Brown
f660a5469c Fix last change in align.el
* lisp/align.el (align-region): Additional fix of last change.
(Bug#80316)

Copyright-paperwork-exempt: yes
2026-02-05 10:56:51 +02:00
John Wiegley
fd6d8faa62 Fix aligning buffer regions containing multiple alignment sections
* lisp/align.el (align-region): Use markers to ensure the regions
stay accurate after overlapping aligning modifications.  (Bug#80316)

* test/lisp/align-tests.el (align-c-multi-section): New test.
2026-02-05 10:51:16 +02:00
Stefan Monnier
3ea1010a6b * lisp/comint.el (comint-redirect-hook): Defvar (bug#80313) 2026-02-04 11:14:10 -05:00
Stefan Monnier
f38b0872f0 (yaml-ts-mode-yamllint-options): Use a list of strings
It is both simpler to code and marginally more general (allows
spaces in arguments).

* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode-yamllint-options): Use
a list.
(yaml-ts-mode-flymake): Adjust accordingly.
2026-02-04 11:03:57 -05:00
Stefan Monnier
f73cb8fba2 shortdoc: Don't burp on missing docstrings
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Report
missing docstrings more cleanly than "Wrong type argument: stringp, nil".
2026-02-04 10:59:23 -05:00
Mattias Engdegård
1396b373ff ediff-mult-tests.el: remove temporary directory after test
* test/lisp/vc/ediff-mult-tests.el (ediff-test-bug3348): Clean up.
2026-02-04 14:33:36 +01:00
Mattias Engdegård
6dc2336a4f Make vc-git-tests work with git < 2.46
* test/lisp/vc/vc-git-tests.el (vc-git-test-branch-remotes):
The 'unset' subcommand to 'git config' was introduced in git 2.46; use
the '--unset' option instead.
2026-02-04 13:26:08 +01:00
Dmitry Gutov
083f89f858 Fix [More] buttons in tutorial and other buttons in Semantic
* lisp/help-mode.el (help-setup-xref): Update docstring (bug#80276).

* etc/NEWS: Add description for the earlier change in help-setup-xref.

* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--detailed-help): Use 'with-help-window', call it after.

* lisp/cedet/semantic/util.el (semantic-describe-buffer): Same.

* lisp/cedet/semantic/decorate/include.el
(semantic-decoration-include-describe)
(semantic-decoration-unknown-include-describe)
(semantic-decoration-fileless-include-describe)
(semantic-decoration-unparsed-include-describe)
(semantic-decoration-all-include-summary): Same.
2026-02-03 05:14:59 +02:00
Stefan Monnier
53bc4a2cb6 isearch.el: Remove autoloads hacks
* lisp/isearch.el (char-fold-to-regexp): Remove redundant autoload.
(emoji--read-emoji): Use `declare-function` rather than autoload.
2026-02-02 17:42:40 -05:00
Eli Zaretskii
16b10d7617 ; Improve indexing in the ELisp manual
* doc/lispref/functions.texi (Function Names):
* doc/lispref/variables.texi (Tips for Defining): Improve
indexing.
2026-02-02 15:24:21 +02:00
Sean Whitton
a269bcb86b diff-mode-shared-map: Bind '@' to diff-revert-and-kill-hunk
* lisp/vc/diff-mode.el (diff-mode-shared-map): Bind '@' to
diff-revert-and-kill-hunk.
2026-02-02 12:57:12 +00:00
Stephen Berman
89bc088a8d ; Fix last change to iroquoian.el
* lisp/leim/quail/iroquoian.el
(iroquoian-haudenosaunee-exception-alist): Delete mistaken
apostrophe in doc string.
2026-02-02 00:27:03 +01:00
Mattias Engdegård
8f5badc26b * etc/symbol-releases.eld: 'any' and 'all' added in Emacs 31 2026-02-01 18:20:56 +01:00
Eli Zaretskii
2652e11930 Minor improvements in vertical cusror motion
* src/xdisp.c (move_it_vertically_backward): Zero out cached value
of line height, to avoid using stale and incorrect values.
(try_window_reusing_current_matrix): Fix conditions for changes in
tab-line height.
Reported by Michael Heerdegen <michael_heerdegen@mailbox.org> in
https://lists.gnu.org/archive/html/help-gnu-emacs/2026-01/msg00163.html
This improves the scrolling a little bit, but doesn't solve the
problem entirely.
2026-02-01 17:26:56 +02:00
Mattias Engdegård
ac07913bd8 ; * lisp/progmodes/elisp-mode.el: slightly better rescanning point
Suggested by Stefan Monnier.
2026-02-01 13:25:28 +01:00
Eli Zaretskii
967294d2cb Fix desktop saving and restoring in daemon sessions
* lisp/desktop.el (desktop--check-dont-save): Don't save daemon's
initial frame.
* lisp/frameset.el (frameset-restore): Don't try deleting the
daemon's initial frame.  (Bug#80294)
2026-02-01 08:49:57 +02:00
Mattias Engdegård
87dfb040b0 Don't produce zero-length lazy strings
* lisp/emacs-lisp/bytecomp.el (byte-compile--docstring):
There is no gain from making an empty string lazy.
(It also contributed to bug#80292.)
2026-01-31 18:58:29 +01:00
Mattias Engdegård
385bcc6117 Fix lazy doc string fontify bug in elisp-byte-code-mode (bug#80292)
* lisp/progmodes/elisp-mode.el (elisp-byte-code-syntax-propertize):
Reset point to just after the start of the previous match so that we
don't skip past the end of the lazy string, which can happen if it's
zero-length; that could lead to an infinite loop.
2026-01-31 18:58:29 +01:00
Jens Schmidt
e08efecd96 Improve documentation of 'seq-difference'
* doc/lispref/sequences.texi (Sequence Functions):
* lisp/emacs-lisp/seq.el (seq-difference): Clarify the documentation of
'seq-difference'.  (Bug#80257)
2026-01-31 16:08:52 +02:00
Michael Albinus
346f1bda6b Improve connection-local variables documentation.
* doc/emacs/custom.texi (Connection Variables):
* doc/lispref/variables.texi (Applying Connection Local Variables):
Improve documentation.
2026-01-31 13:37:56 +01:00
Eli Zaretskii
b75bfa219e ; * admin/authors.el (authors-aliases): Add Boris Buliga. 2026-01-31 13:13:57 +02:00
Eli Zaretskii
f7edfdcfd4 ; Fix documentation of 'help-fns-describe-function-functions'
* lisp/help-fns.el (help-fns-describe-function-functions): Doc fix
(bug#80291).
2026-01-31 12:59:17 +02:00
Boris Buliga
046f5ef018 Fix macOS 26 (Tahoe) scrolling lag and input handling issues
macOS 26 introduced new event processing behavior that causes scrolling
lag and input handling problems in Emacs.  This patch disables two
features via NSUserDefaults when built against the macOS 26 SDK:
- NSEventConcurrentProcessingEnabled
- NSApplicationUpdateCycleEnabled
This fix is based on the equivalent patch in emacs-mac by Mitsuharu
Yamamoto.  See: https://bitbucket.org/mituharu/emacs-mac/commits/e52ebfd
* src/nsterm.m (ns_term_init): Disable problematic event processing
when built for macOS 26+.  (Bug#80268)
2026-01-31 12:18:35 +02:00
Jacob S. Gordon
049eefa611 display-time: Add option to customize help-echo format
This option controls the format of the help-echo when hovering
over the time display in mode line.  (Bug#80143)
* lisp/time.el (display-time-help-echo-format): Add option.
(display-time-string-forms): Use it.

* etc/NEWS (Time): Announce the new option.
2026-01-31 12:12:21 +02:00
Eli Zaretskii
cd152ea611 ; Fix last change
* lisp/leim/quail/iroquoian.el
(iroquoian-haudenosaunee-exception-alist): Doc fix.
2026-01-31 12:06:53 +02:00
Kierin Bell
39dc99518c Add new input method for Tuscarora
* lisp/leim/quail/iroquoian.el: New input method "tuscarora-postfix".

* etc/NEWS: Announce the new input method.  (Bug#80264)
2026-01-31 12:01:48 +02:00
Jens Schmidt
1652e36c6c ; Fix documentaion of 'seq-intersection'
* doc/lispref/sequences.texi (Sequence Functions):
* lisp/emacs-lisp/seq.el (seq-intersection): Fix documentaion of
'seq-intersection'.  (Bug#80257)
2026-01-31 11:52:27 +02:00
Eli Zaretskii
f081afe23d ; Improve documentation of 'condition-case-unless-debug'
* doc/lispref/control.texi (Handling Errors):
* lisp/subr.el (condition-case-unless-debug): Improve the
documentation of 'condition-case-unless-debug'.  (Bug#80234)
2026-01-31 11:24:53 +02:00
Stéphane Marks
a0748d9791 New function 'truncate-string-pixelwise' (bug#80244)
This function will truncate a string on a pixelwise basis in a
work buffer and using a binary search rather than brute force.

* lisp/emacs-lisp/subr-x.el (work-buffer--prepare-pixelwise):
New defun helper function.
(string-pixel-width): Use the helper function.
(truncate-string-pixelwise): New defun.
* test/lisp/misc-tests.el (misc-test-truncate-string-pixelwise):
(misc-test-truncate-string-pixelwise-unicode): New test.
* doc/lispref/display.texi (Size of Displayed Text): Document
the function.
* etc/NEWS: Announce the function.
2026-01-31 11:04:40 +02:00
Daniel Mendler
e68239773c pixel-scroll: Avoid loading `cua-base'
CUA is not necessarily used together with `pixel-scroll-precision-mode'.
Make `pixel-scroll-interpolate-down' and `pixel-scroll-interpolate-up'
independent and avoid loading cua-base.
* lisp/pixel-scroll.el (pixel-scroll-interpolate-up)
(pixel-scroll-interpolate-down): Do not use `cua-scroll-down' and
`cua-scroll-up'; replace them with inline code.  (Bug#80245)
2026-01-31 11:01:02 +02:00
Daniel Colascione
69a2b9fa17 xsettings: honor GDK DPI scaling values
Some XWayland setups only report DPI changes through
GDK xsettings, so Emacs missed DPI updates there.
Recognize the GDK DPI and scaling settings and use
them to compute the effective DPI.

* src/xsettings.c (parse_settings): Recognize
Gdk/UnscaledDPI and Gdk/WindowScalingFactor.
Use them to compute DPI when present.
2026-01-30 12:39:48 -05:00
Sean Whitton
53a3883bf6 vc--incoming-revision: Signal error on cache hit
* lisp/vc/vc.el (vc--incoming-revision): Signal an error instead
of returning nil on a cache hit (bug#80270).
(vc--outgoing-base-mergebase): Simplify, given that
vc--incoming-revision now handles the error case.
2026-01-30 15:56:58 +00:00
Sean Whitton
fcdd8678f9 Make diff-hunk-kill respect an active region
* lisp/vc/diff-mode.el (diff--revert-kill-hunks): New workhorse
routine.
(diff-hunk-kill, diff-revert-and-kill-hunk): Call it.
(diff-hunk-kill): New BEG and END parameters and interactive
form.
* doc/emacs/files.texi (Diff Mode):
* etc/NEWS: Document the change.
2026-01-30 15:06:52 +00:00
Mattias Engdegård
ae7761598d Pass lazy doc string to 'defalias'
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
We correctly emit a lazy-loaded doc string but then passed a literal
string to 'defalias' by mistake; fix that.  Saves 40 KiB in .elc files.
2026-01-30 15:48:02 +01:00
Sean Whitton
c1029c88a8 ; vc-git-topic-outgoing-base: Merge let into if-let*. 2026-01-30 13:52:37 +00:00
Sean Whitton
b4a18e466e vc-git-topic-outgoing-base: Respect a configure push remote
* lisp/vc/vc-git.el (vc-git-topic-outgoing-base): If there is a
configured push remote, return tracking branch as outgoing base.
2026-01-30 13:50:28 +00:00
Sean Whitton
83db778195 ; Fix last change. 2026-01-30 13:49:35 +00:00