* 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.
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.
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.
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)
* 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.
* 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.
* 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.
* lisp/vc/vc-git.el (vc-git--branch-remotes): New function.
(vc-git-trunk-or-topic-p): Use it.
* test/lisp/vc/vc-git-tests.el (vc-git-test-branch-remotes): New
test.
This is exclusively for the benefit of rust-analyzer, which
sends publishDiagnostics for all project files upfront, and
never republishes them on 'didOpen'.
See https://github.com/joaotavora/eglot/issues/1531.
* lisp/progmodes/eglot.el (eglot--flymake-handle-push): Simplify.
Don't flymake-list-only-diagnostics here.
Save original diagnostic in flymake-list-only-diagnostics setting.
(eglot--on-shutdown): Cleanup flymake-list-only-diagnostics.
(eglot--flymake-report-push+pulled): Hack in data from
flymake-list-only-diagnostics.
* lisp/emacs-lisp/checkdoc.el (checkdoc--batch-flag): New variable.
(checkdoc-rogue-spaces, checkdoc-message-text): Use it along the
check for interactive calls to be able to collect errors in the
diagnostic buffer.
(checkdoc-show-diagnostics): Don't show the diagnostic buffer
when 'checkdoc--batch-flag' is non-nil.
(checkdoc-batch): New function to check the buffer and print the
content of the diagnostic buffer.
* lisp/icomplete.el (icomplete-exit): New alias for 'icomplete-fido-exit'.
(icomplete-minibuffer-map): Bind it to "M-j" .
* lisp/replace.el (multi-occur--prompt): Show "M-j" bound to 'icomplete-exit'
in 'icomplete-mode'.
If the completion table requests eager-update (so *Completions*
should be updated as the user types, when already displayed)
then *Completions* will be dismissed automatically if the user
types something which isn't a completion. Previously,
*Completions* wouldn't be redisplayed until the user requests it
again. Now, if the completion table also enables eager-display
in addition to eager-update, then automatically redisplay
*Completions* after it disappears.
* lisp/minibuffer.el (completions--start-eager-display): Add
REQUIRE-EAGER-UPDATE argument and don't run if Completions is
already displayed.
(completions--after-change): Call
'completions--start-eager-display'.
(minibuffer-completion-help): Add the 'completions--after-change'
hook earlier, and let it remove itself (bug#80055).
* lisp/minibuffer.el (minibuffer--message-overlay)
(minibuffer--message-timer): New variables.
(minibuffer--delete-message-overlay): New function.
(minibuffer-message): Use a timer and 'pre-command-hook' to
clear message overlay instead of blocking with
'sit-for'. (bug#79510)
* etc/NEWS: Document the change.
* lisp/tutorial.el (tutorial--default-keys):
Don't sort quoted list in-place. Sort at compile time, not load time.
Uniform key representation (vectors) so that the default comparison can
be used. Eliminate unnecessary backquote.
(tutorial--sort-keys): Remove.
* lisp/progmodes/xref.el (xref--parse-hits, xref--sort-hits):
Extract from xref-matches-in-directory and xref-matches-in-files.
Use in both for better consistency between these functions.
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Try and (auto)load the macro in case that defines `autoload-macro`.
Simplify the code for the `loaddefs--defining-macros` case.
The main reason for this is that then these commands can have
the same bindings in VC-Dir buffers that they have under
vc-prefix-map. 'T' is a good mnemonic for "Topic" and a
serviceable mnemonic for "outsTanding".
* lisp/vc/vc-hooks.el (vc-prefix-map): Move 'o' to 'T'.
* lisp/vc/vc-dir.el (vc-dir-mode-map): New 'T' bindings.
Optionally use find and grep directly instead of going through the
Semantic framework (bug#80246).
* lisp/progmodes/project.el (project--vc-ignores): Require 'vc' to
ensure that vc-default-ignore-completion-table is available.
* lisp/progmodes/xref.el (xref-references-in-directory-function):
New user option.
(xref-references-in-directory): Call it.
(xref-references-in-directory-grep): Implementation based on find/grep.
(xref-references-in-directory-semantic): Implementation using Semantic.
(xref-matches-in-directory): Add new argument DELIMITED.
Co-authored-by: Dmitry Gutov <dmitry@gutov.dev>
`null`, `booleanp`, and `symbolp` were treated as equivalent in
`pcase--subtype-bitsets`, which was not incorrect to the extent
that we currently use this table only to detect
mutual-exclusion, but made it incorrect to use that same table
to test things like inclusion.
* lisp/emacs-lisp/cl-preloaded.el (built-in-class): New slot
`non-abstract-supertype`.
(cl--define-built-in-type): Add corresponding keyword argument.
(symbol, boolean): Use it.
* lisp/emacs-lisp/pcase.el (pcase--subtype-bitsets): Use it.
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): Require `help`
before calling `help--docstring-quote`. Fixes a corner case bootstrap
problem found along the way.
* doc/lispref/frames.texi (Input Focus): Document the commands
'select-frame-by-id' and 'undelete-frame-by-id'.
* lisp/frame.el (select-frame-by-id): Clarify return value and
add missing optional argument 'noerror' in sympathy with
'undelete-frame-by-id'.
The 'jsonrpc-request' function, when called with non-nil CANCEL-ON-INPUT,
relies on 'sit-for' to stop immediately when the user inputs something into
Emacs. Although this behavior is working well, it has the hitherto
undiscovered side effect of invoking 'redisplay_internal', which triggers
expensive operations such as fontification.
This bug was noticied when using the 'breadcrumb' package in conjunction
with Eglot and a narrowed buffer. To provide breadcrumbs for the current
context, breadcrumb.el invokes 'imenu--make-index-alist' on a timer. That
function temporarily widens the buffer and then eventually calls
'redisplay_internal' (through 'eglot-imenu', 'jsonrpc-request', and
'sit-for'). This has the effect that the temporarily widened buffer is
re-rendered and displayed to the user until the LSP server answers the
request and 'imenu--make-index-alist' restores the restriction, an effect
that lasts between 0.5 and 2 seconds usually and is annoying and confusing.
To fix this, using a non-nil NODISP argument in the 'sit-for' is not enough
(though it's arguable it should be and maybe that's a separate bug).
Binding 'inhibit-redisplay' to 't' around 'sit-for' seems to fix the issue
robustly.
* lisp/jsonrpc.el (jsonrpc-request): Bind inhibit-redisplay to t and pass
NODISP to sit-for.