]> git.eshelyaron.com Git - emacs.git/log
emacs.git
22 months agoFix c-ts-common-statement-offset and c-ts-common--node-is
Yuan Fu [Sat, 25 Feb 2023 03:31:34 +0000 (19:31 -0800)]
Fix c-ts-common-statement-offset and c-ts-common--node-is

* lisp/progmodes/c-ts-common.el:
(c-ts-common--node-is): Guard against case where the node has no field
name.
(c-ts-common-statement-offset): Do indent a level if the "if" in the
"else if" is on an independent line.

22 months agotypescript-ts-mode: Highlight non-shorthand destructuring bindings
Dmitry Gutov [Sat, 25 Feb 2023 01:54:31 +0000 (03:54 +0200)]
typescript-ts-mode: Highlight non-shorthand destructuring bindings

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Highlight non-shorthand
variable bindings in object destructuring.

22 months agoAdd more/finer faces for tree-sitter
Dmitry Gutov [Sat, 25 Feb 2023 01:15:46 +0000 (03:15 +0200)]
Add more/finer faces for tree-sitter

* doc/lispref/modes.texi (Faces for Font Lock):
Update the list of faces (bug#61655).

* etc/NEWS: Update the list of new faces.

* lisp/cus-theme.el (custom-theme--listed-faces): Update.

* lisp/font-lock.el (font-lock-function-call-face)
(font-lock-variable-ref-face, font-lock-property-ref-face):
New faces.
(font-lock-property-name-face):
Rename from 'font-lock-property-face'.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Use new faces.  More 'enumerator' query to 'definition' feature.
(c-ts-mode--fontify-declarator, c-ts-mode--fontify-variable):
Use new faces.

* lisp/progmodes/cmake-ts-mode.el
(cmake-ts-mode--font-lock-settings): Use new faces.

* lisp/progmodes/csharp-mode.el
(csharp-ts-mode--font-lock-settings): Use new faces.

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Use new faces.

* lisp/progmodes/java-ts-mode.el
(java-ts-mode--font-lock-settings): Use new faces.

* lisp/progmodes/js.el (js--treesit-fontify-assignment-lhs)
(js--treesit-font-lock-settings): Use new faces.  Highlight
variable definitions inside array and object destructuring
patterns.

* lisp/progmodes/python.el (python--treesit-variable-p):
Exclude identifiers in parameters.
(python--treesit-settings): Use new faces.  Highlight function
parameters.  Move 'keyword' up to still highlight 'self' as
keyword.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Use new faces.

* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--font-lock-settings): Use new faces.

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Use new faces.

* lisp/textmodes/css-mode.el (css--treesit-settings):
Use font-lock-property-ref-face.

* lisp/textmodes/toml-ts-mode.el
(toml-ts-mode--font-lock-settings):
Use font-lock-property-ref-face.

* lisp/textmodes/yaml-ts-mode.el
(yaml-ts-mode--font-lock-settings): Same.

22 months agoAvoid crashes in batch mode due to lack of frame face cache
Eli Zaretskii [Fri, 24 Feb 2023 20:46:05 +0000 (22:46 +0200)]
Avoid crashes in batch mode due to lack of frame face cache

* src/xfaces.c (Finternal_merge_in_global_face): Handle frames
with no face cache.

22 months agoAdd Tramp version integrated in Emacs 28.3
Michael Albinus [Fri, 24 Feb 2023 18:47:15 +0000 (19:47 +0100)]
Add Tramp version integrated in Emacs 28.3

* lisp/net/trampver.el (customize-package-emacs-version-alist):
Add Tramp version integrated in Emacs 28.3.

22 months agoAvoid reusing :lisp-dir twice in 'package-vc--main-file'
Philip Kaludercic [Wed, 22 Feb 2023 14:28:44 +0000 (15:28 +0100)]
Avoid reusing :lisp-dir twice in 'package-vc--main-file'

* lisp/emacs-lisp/package-vc.el (package-vc--main-file): Just use
:lisp-dir from 'package-desc-extras', not 'pkg-spec'.

This avoid appending the contents of :lisp-dir twice, in case it is
specified both in pkg-spec and pkg-desc.

22 months agoEnsure right package-desc-type before installing package
Philip Kaludercic [Wed, 22 Feb 2023 14:23:43 +0000 (15:23 +0100)]
Ensure right package-desc-type before installing package

* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Move copying
code from 'package-vc-install'.
(package-vc-install): Remove copying.  (Bug#61669)

22 months agoRestore invisibility of symlink target on exiting wdired-mode
Stephen Berman [Fri, 24 Feb 2023 15:43:35 +0000 (16:43 +0100)]
Restore invisibility of symlink target on exiting wdired-mode

* lisp/wdired.el (wdired-change-to-dired-mode): Invoke
dired-hide-details-update-invisibility-spec (bug#61510).

* test/lisp/wdired-tests.el (wdired-test-bug61510): New test.

22 months agoEglot: fix jit-lock inlay hint bugs
João Távora [Fri, 24 Feb 2023 14:48:01 +0000 (14:48 +0000)]
Eglot: fix jit-lock inlay hint bugs

One of the bugs was straightforward.  The timer function of
eglot--update-hints must set the correct buffer.

The other is much more odd.  When using Eglot on Emacs's own
src/coding.c, the jit-lock code starts calling its jit-functions over
and over again with the same sequence of arguments, like so:

======================================================================
1 -> (eglot--update-hints 63551 65051)
1 <- eglot--update-hints: [nil 25592 52026 4
======================================================================
1 -> (eglot--update-hints 65051 66551)
1 <- eglot--update-hints: [nil 25592 52026 4
======================================================================
1 -> (eglot--update-hints-1 63551 66551)
1 <- eglot--update-hints-1: nil
======================================================================
1 -> (eglot--update-hints 63551 65051)
1 <- eglot--update-hints: [nil 25592 52026 4
======================================================================
1 -> (eglot--update-hints 65051 66551)
1 <- eglot--update-hints: [nil 25592 52026 5
======================================================================
1 -> (eglot--update-hints-1 63551 66551)
1 <- eglot--update-hints-1: nil

This continues forever at a very fast rate and saturates the LSP
channel.

At first I thought that it was because eglot--update-hints-1 is
actually causing the buffer to be modified with overlays sometime in
the future, but it is not so!  It seems that merely calling

   (goto-char (eglot--lsp-position-to-point position))

(from the LSP request handler in eglot--update-hints-1) will cause
this bug.

* lisp/progmodes/eglot.el (eglot--update-hints): Fix bugs.

22 months agoEglot: fix inlay hint with label collection instead of string
João Távora [Fri, 24 Feb 2023 10:46:20 +0000 (10:46 +0000)]
Eglot: fix inlay hint with label collection instead of string

Reported by Chinmay Dalal <dalal.chinmay.0101@gmail.com>

* lisp/progmodes/eglot.el (eglot--update-hints-1): Fix bug when
inlay hint contains collection of labels.

22 months agoFix insertion of keyboard macro containing named keys
Robert Pluim [Fri, 24 Feb 2023 10:12:24 +0000 (11:12 +0100)]
Fix insertion of keyboard macro containing named keys

* lisp/kmacro.el: Autoload `macro--string-to-vector'.
(kmacro-ring-head): Convert `last-kbd-macro' to a vector if it's a
string, since `kmacro' uses `key-parse' on it.
(kmacro-lambda-form): Remove require for 'macros
* test/lisp/kmacro-tests.el
(kmacro-tests-name-last-macro-key-parse-syntax):
Test that insertion of macros that contain strings that look
like named keys works correctly.

(Bug#61700)

22 months agoEglot: simplify inlay hints implementation with jit-lock
João Távora [Thu, 23 Feb 2023 23:51:09 +0000 (23:51 +0000)]
Eglot: simplify inlay hints implementation with jit-lock

This implementation is much simpler than the one based on
windows-scroll-functions.  It's also supposedly safer, as long as
jit-lock guarantees refontification of affected regions.

It's not _trivially_ simple though, as simply adding
'eglot--update-hints-1' to jit-lock-functions, while possible, is
going to request inlay hints from the LSP server for many small
regions of the buffer, depending on what jit-lock thinks is best.  So
we keep coalescing these into a larger region until the time is
suitable for a more bandwidth-efficient request.

To do this, we use a jit-lock implementation detail,
jit-lock-context-unfontify-pos, which is a proxy for knowing that the
jit-lock-context-timer has run.  Not sure how brittle it is, but it
seems to work reasonably.

We also get rid of the previous "get hints for entire buffer"
implementation.

* doc/misc/eglot.texi (Eglot Variables): Remove mention
to deleted eglot-lazy-inlay-hints.

* lisp/progmodes/eglot.el (eglot-lazy-inlay-hints)
(eglot--inlay-hints-after-scroll)
(eglot--inlay-hints-fully)
(eglot--inlay-hints-lazily): Remove.
(eglot--update-hints): Add function.
(eglot-inlay-hints-mode): Simplify.

22 months agoEglot: update inlay hints on window configuration changes
João Távora [Thu, 23 Feb 2023 19:18:41 +0000 (19:18 +0000)]
Eglot: update inlay hints on window configuration changes

* lisp/progmodes/eglot.el
(eglot--inlay-hints-after-window-config-change): New helper.
(eglot-inlay-hints-mode): Use it.

22 months ago; Fix a typo in a doc string in c-ts-common.el (bug#61736).
Daniel Martín [Thu, 23 Feb 2023 17:30:36 +0000 (18:30 +0100)]
; Fix a typo in a doc string in c-ts-common.el (bug#61736).

22 months ago; Clarify documentation of 'file-modes-number-to-symbolic'
Eli Zaretskii [Thu, 23 Feb 2023 15:45:52 +0000 (17:45 +0200)]
; Clarify documentation of 'file-modes-number-to-symbolic'

* doc/lispref/files.texi (Changing Files):
* lisp/files.el (file-modes-number-to-symbolic): Clarify the
confusion with "symbolic" forms of file modes.  (Bug#61709)

22 months ago; Fix recently-added doc strings in eglot.el
Eli Zaretskii [Thu, 23 Feb 2023 15:18:28 +0000 (17:18 +0200)]
; Fix recently-added doc strings in eglot.el

* lisp/progmodes/eglot.el (eglot-lazy-inlay-hints)
(eglot-inlay-hints-mode): Doc fixes.

22 months agoEglot: display completion label when safe
João Távora [Thu, 23 Feb 2023 13:58:38 +0000 (13:58 +0000)]
Eglot: display completion label when safe

Originally reported in
https://github.com/joaotavora/eglot/discussions/1141 by "Mintsoup".

Eglot doesn't always show the LSP :label property of a CompletionItem
in the completion candidates.  That is because label is sometimes not
what should be inserted in the buffer in the end, the :insertText
property supercedes it.

But the label is usually more suitable for display nevertheless and if
the LSP CompletionItem contains either a snippet or a textEdit, it's
safe to display the label, since :exit-function will guarantee that a
suitable buffer insertion is performed.

This change reflects that awareness that when a textEdit is available,
it's acceptable to show the label.

* lisp/progmodes/eglot.el (eglot-completion-at-point): Adjust.

22 months agoImprove documentation of VC commands, including in Dired
Eli Zaretskii [Thu, 23 Feb 2023 12:26:06 +0000 (14:26 +0200)]
Improve documentation of VC commands, including in Dired

* doc/emacs/dired.texi (Operating on Files):
* doc/emacs/maintaining.texi (VC Change Log, VC Directory Mode)
(Version Control, Basic VC Editing): Document VC command
invocation from Dired buffers.  Improve documentation of vc-log
commands.

* lisp/dired-aux.el (dired-vc-next-action):
* lisp/vc/vc.el (vc-print-log, vc-log-search, vc-log-mergebase)
(vc-log-view-type, vc-print-root-log, vc-next-action): Doc fixes.

22 months ago* doc/emacs/maintaining.texi: More mentions of marked files in Dired.
Juri Linkov [Thu, 23 Feb 2023 08:23:41 +0000 (10:23 +0200)]
* doc/emacs/maintaining.texi: More mentions of marked files in Dired.

(Basic VC Editing, Old Revisions, VC Change Log): Add more mentions of
ability to include the marked files to the VC fileset in Dired (bug#61712).

22 months ago; * lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area): Fix typo.
Yuan Fu [Thu, 23 Feb 2023 01:55:30 +0000 (17:55 -0800)]
; * lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area): Fix typo.

22 months agoEglot: implement inlay hints (bug#61412, bug#61066)
João Távora [Tue, 21 Feb 2023 14:14:05 +0000 (14:14 +0000)]
Eglot: implement inlay hints (bug#61412, bug#61066)

Inlay hints are small text annotations to specific parts of the whole
buffer, not unlike diagnostics, but designed to help readability
instead of indicating problems.  For example, a C++ LSP server can
serve hints about positional parameter names in function calls and a
variable's automatically deduced type.  Emacs can display these hints
in many little 0-length overlays with an 'before-string property, thus
helping the user remember those types and parameter names.

Since inlay hints are potentially a large amount of data to request
from the LSP server, the implementation strives to be as parsimonious
as possible with these requests.

So, by default, inlay hints are only requested for the visible
portions of the buffer across windows showing this buffer.  This is
done by leveraging the 'window-scroll-functions' variable, making for
a reasonably complex implementation involving per-window timers.  When
scrolling a window, it may take a short amount of time for inlay hints
to "pop in".  The new user variable 'eglot-lazy-inlay-hints' can be
used to exert some control over this.

Specifically, if the variable's value is set to 'nil', then inlay
hints are greedily fetched for the whole buffer every time a change
occurs.  This is a much simpler mode of operation which may avoid
problems, but is also likely much slower in large buffers.

Also, because the inlay feature is probably visually suprising to
some, it is turned OFF by default, which is not the usual practice of
Eglot (at least not when the necessary infrastructure is present).
This decision may be changed soon.  Here's a good one-liner for
enabling it by default in every Eglot-managed buffer:

   (add-hook 'eglot-managed-mode-hook #'eglot-inlay-hints-mode)

I haven't tested inlay hints extensively across many LSP servers, so I
would appreciate any testing, both for functional edge cases and
regarding performance.  There are possibly more optimization
oportunities in the "lazy" mode of operation, like more aggressively
deleting buffer overlays that are not in visible parts of the buffer.

Though I ended up writing this one from scratch, I want to thank
Dimitry Bolopopsky <dimitri@belopopsky.com> and Chinmay Dala
<dalal.chinmay.0101@gmail.com> for suggestions and early patches.

* lisp/progmodes/eglot.el (eglot--lsp-interface-alist): Define
InlayHint.
(eglot-client-capabilities): Announce 'inlayHint' capability.
(eglot-ignored-server-capabilities): Add :inlayHintProvider.
(eglot--document-changed-hook): New helper hook.
(eglot--after-change): Use it.
(eglot-inlay-hint-face, eglot-type-hint-face)
(eglot-parameter-hint-face): New faces.
(eglot--update-hints-1, eglot--inlay-hints-after-scroll)
(eglot--inlay-hints-fully, eglot--inlay-hints-lazily): New helpers.
(eglot-lazy-inlay-hints): New user variable.
(eglot-inlay-hints-mode): New minor mode.
(eglot--maybe-activate-editing-mode): Try to activate
eglot-inlay-hints-mode.
(eglot--before-change): Remove overlays immediately in the
area being changed.
(eglot--managed-mode-off): Remove overlays.

* doc/misc/eglot.texi (Eglot Features): Mention inlay hints.
(Eglot Variables): Mention eglot-lazy-inlay-hints.

22 months agoEglot: run eglot-managed-mode-hook after LSP didOpen
João Távora [Wed, 22 Feb 2023 18:44:39 +0000 (18:44 +0000)]
Eglot: run eglot-managed-mode-hook after LSP didOpen

This allows using the hook for interacting with the LSP server using
the current buffer as the subject of that interaction ("document" in
LSP parlance).

* lisp/progmodes/eglot.el (eglot--maybe-activate-editing-mode):
Run eglot-managed-mode-hook here.
(eglot--managed-mode): Not here.

22 months agoEglot: restore eldoc-documentation-functions on shutdown
João Távora [Wed, 22 Feb 2023 18:50:46 +0000 (18:50 +0000)]
Eglot: restore eldoc-documentation-functions on shutdown

* lisp/progmodes/eglot.el (eglot--managed-mode): Restore
eldoc-documentation-functions when shutting down eglot.

22 months agoEglot: simplify capability-checking code
João Távora [Tue, 21 Feb 2023 13:59:04 +0000 (13:59 +0000)]
Eglot: simplify capability-checking code

* lisp/progmodes/eglot.el (eglot--server-capable-or-lose): New helper.
(eglot--signal-textDocument/willSave)
(eglot--signal-textDocument/didSave): Tweak docstring.
(eglot--workspace-symbols, xref-backend-identifier-at-point)
(eglot-format, eglot-completion-at-point, eglot-rename)
(eglot-code-actions): Use new eglot--server-capable-or-lose.

22 months agoEglot: go back to setting eldoc-documentation-strategy again
João Távora [Wed, 22 Feb 2023 18:05:00 +0000 (18:05 +0000)]
Eglot: go back to setting eldoc-documentation-strategy again

This commits reverts part of

   commit e83c78b8c7784254c2c6f043530ab325c2fa7f16
   Author: João Távora <joaotavora@gmail.com>
   Date:   Mon Feb 20 22:43:50 2023 +0000

       Eglot: respect user's Eldoc configuration by default

In that commit, I did what many longstanding issues and users were
suggesting and removed Eglot's override of two Eldoc user
configuration varibles.

I verified that Eglot's behaviour would stay mostly unaltered but my
tests were very incomplete.  In short there is no way that Eglot can
work acceptably with the default setting of
'eldoc-documentation-strategy', which is
'eldoc-documentation-default'.  So it must be changed, either globally
or locally in Eglot's minor mode.

This is true for any situation where both synchronous and asynchronous
documentation sources are present.  In Eglot's case there are two
asynchronous sources which have more importance than the synchronous
source.  So any other strategy except the
'eldoc-documentation-default' makes sense.

* lisp/progmodes/eglot.el (eglot--managed-mode): Set
eldoc-documentation-strategy to eldoc-documentation-compose.

22 months ago; * etc/NEWS: Fix typo again
Martin Rudalics [Wed, 22 Feb 2023 17:48:33 +0000 (18:48 +0100)]
; * etc/NEWS: Fix typo again

22 months ago; * etc/NEWS (C-x v !): Additional text.
Sean Whitton [Wed, 22 Feb 2023 17:17:08 +0000 (10:17 -0700)]
; * etc/NEWS (C-x v !): Additional text.

22 months ago; * doc/emacs/vc1-xtra.texi (Preparing Patches): Wording tweaks.
Sean Whitton [Wed, 22 Feb 2023 17:10:04 +0000 (10:10 -0700)]
; * doc/emacs/vc1-xtra.texi (Preparing Patches): Wording tweaks.

22 months ago; * doc/emacs/anti.texi (Antinews): Adjust to latest changes.
Eli Zaretskii [Wed, 22 Feb 2023 15:40:00 +0000 (17:40 +0200)]
; * doc/emacs/anti.texi (Antinews): Adjust to latest changes.

22 months agoMerge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29
Michael Albinus [Wed, 22 Feb 2023 14:35:48 +0000 (15:35 +0100)]
Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29

22 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Wed, 22 Feb 2023 14:35:03 +0000 (15:35 +0100)]
; * etc/NEWS: Fix typos.

22 months agoYield to erc-move-to-prompt before unhiding prompt
F. Jason Park [Wed, 22 Feb 2023 14:24:17 +0000 (06:24 -0800)]
Yield to erc-move-to-prompt before unhiding prompt

* lisp/erc/erc-backend.el (erc--hide-prompt): Change hook depth from 0
to 91 to allow the `move-to-prompt' module to do its thing.  This
feature was added by bug#54826 and first appeared in Emacs 29.
* lisp/erc/erc-common.el (erc-server-user): Remove erroneous comment.
The `buffers' field is a list of buffers.
* test/lisp/erc/erc-tests.el (erc-hide-prompt): Use `erc--target'
instead of `erc-default-recipients' because this is new code.

22 months ago; Improve doc string of 'C-q'
Eli Zaretskii [Wed, 22 Feb 2023 14:24:59 +0000 (16:24 +0200)]
; Improve doc string of 'C-q'

* lisp/simple.el (read-quoted-char-radix, quoted-insert): Doc fix.

22 months ago; Clarify "kill files" in Gnus manual
Eli Zaretskii [Wed, 22 Feb 2023 13:40:26 +0000 (15:40 +0200)]
; Clarify "kill files" in Gnus manual

* doc/misc/gnus.texi (Scoring): Make the reference to kill files
less vague.  (Bug#61325)

22 months ago* lisp/progmodes/python.el (python--import-sources): Fix regexp (bug#61648)
Augusto Stoffel [Mon, 20 Feb 2023 09:49:22 +0000 (10:49 +0100)]
* lisp/progmodes/python.el (python--import-sources): Fix regexp (bug#61648)

22 months agoDo not error out on non image file (bug#61639)
Manuel Giraud [Sun, 19 Feb 2023 20:03:57 +0000 (21:03 +0100)]
Do not error out on non image file (bug#61639)

* lisp/image/image-dired.el
(image-dired-display-thumbs): Do not insert non image file and do not
display image-dired buffer if it is empty.

22 months agoExplain effect of variable-pitch fonts on fill-column
Eli Zaretskii [Wed, 22 Feb 2023 13:16:25 +0000 (15:16 +0200)]
Explain effect of variable-pitch fonts on fill-column

* doc/emacs/text.texi (Fill Commands):
* doc/emacs/display.texi (Displaying Boundaries):
* lisp/display-fill-column-indicator.el
(display-fill-column-indicator-mode): Document caveats of using
variable-pitch fonts with 'fill-column' and its indicator.
(Bug#61677)

22 months agoAvoid division by zero in get_narrowed_* functions
Eli Zaretskii [Wed, 22 Feb 2023 12:55:05 +0000 (14:55 +0200)]
Avoid division by zero in get_narrowed_* functions

* src/xdisp.c (get_narrowed_width, get_narrowed_len): Return at
least 1 as the value.  (Bug#61704)

22 months ago; Fix documentation of 'icon-title-format'.
Eli Zaretskii [Tue, 21 Feb 2023 20:06:30 +0000 (22:06 +0200)]
; Fix documentation of 'icon-title-format'.

22 months ago* etc/NEWS: Mention new buffer display action alist entries
Martin Rudalics [Tue, 21 Feb 2023 17:49:04 +0000 (18:49 +0100)]
* etc/NEWS: Mention new buffer display action alist entries

22 months ago; * src/xterm.c (x_update_end): Condition on HAVE_XDBE
Robert Pluim [Tue, 21 Feb 2023 17:05:32 +0000 (18:05 +0100)]
; * src/xterm.c (x_update_end): Condition on HAVE_XDBE

22 months agoFix build --without-xdbe
Eli Zaretskii [Tue, 21 Feb 2023 16:15:35 +0000 (18:15 +0200)]
Fix build --without-xdbe

* src/xterm.c (x_end_cr_clip, handle_one_xevent): Condition
double-buffering code on HAVE_XDBE.  (Bug#61667)

22 months agoImprove dnd-direct-save-remote-files docstring
Robert Pluim [Tue, 21 Feb 2023 15:55:21 +0000 (16:55 +0100)]
Improve dnd-direct-save-remote-files docstring

* lisp/dnd.el (dnd-direct-save-remote-files): Reword.

22 months agoAdd 'process-status' to process shortdoc
Robert Pluim [Tue, 21 Feb 2023 15:45:21 +0000 (16:45 +0100)]
Add 'process-status' to process shortdoc

* lisp/emacs-lisp/shortdoc.el (process): Add 'process-status'.

22 months ago* lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Improve 5d0b45cd67b
Andrea Corallo [Tue, 21 Feb 2023 13:58:28 +0000 (14:58 +0100)]
* lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Improve 5d0b45cd67b

22 months agoImprove text about deleting windows
Robert Pluim [Tue, 21 Feb 2023 15:35:25 +0000 (16:35 +0100)]
Improve text about deleting windows

* doc/emacs/windows.texi (Change Window): Improve grammar around
'delete-window-choose-selected'.

22 months agoMake 'emacs-news-cycle-tag' work at all levels
Robert Pluim [Tue, 21 Feb 2023 14:20:56 +0000 (15:20 +0100)]
Make 'emacs-news-cycle-tag' work at all levels

* lisp/textmodes/emacs-news-mode.el (emacs-news-cycle-tag): Search for
a heading starting with 2 or more '*' rather than exactly 3.
* test/lisp/textmodes/emacs-news-mode-resources/cycle-tag.erts
(Point-Char): Add tests for 2 and 4 '*' levels.

22 months agoRepair mistake in a previous edmacro-sanitize-string change
Mattias Engdegård [Mon, 20 Feb 2023 11:55:09 +0000 (12:55 +0100)]
Repair mistake in a previous edmacro-sanitize-string change

* lisp/edmacro.el (edmacro-sanitize-for-string):
This condition should not have been 'repaired' but removed altogether.
Do so now, fixing bug#61647.

Reported by Eduardo Ochs.

(cherry picked from commit 4eefadad0670ad1c3da2505d734e528d54c76bef)

22 months agoregex-emacs.c: Reduce the use of backtracking a bit further
Stefan Monnier [Tue, 21 Feb 2023 02:22:41 +0000 (21:22 -0500)]
regex-emacs.c: Reduce the use of backtracking a bit further

bug#61514 exhibited some undesirable backtracking in a case where
it's easy to avoid it by making `mutually_exclusive_p` just a bit
more careful.

* src/regex-emacs.c (mutually_exclusive_p): Handle `on_failure_jump`s.

* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
Add a few tests.

22 months agoEglot: respect user's Eldoc configuration by default
João Távora [Mon, 20 Feb 2023 22:43:50 +0000 (22:43 +0000)]
Eglot: respect user's Eldoc configuration by default

This change addresses the problems reported in many Elglot reports
dating back to early 2021 at least:

  https://github.com/joaotavora/eglot/issues/648
  https://github.com/joaotavora/eglot/issues/894
  https://github.com/joaotavora/eglot/issues/920
  https://github.com/joaotavora/eglot/issues/1031
  https://github.com/joaotavora/eglot/issues/1171

In one form or another, the reports point out that the multiple pieces
of information about the "thing at point" made available by the LSP
server are not all being considered by the ElDoc system.

The reason for this is Eglot setting/trampling the variables
'eldoc-documentation-strategy' and 'eldoc-documentation-functions' in
its minor more entry function.

The reason it did that is historical and is partially described in the
issues above.  But, evidently, it never made much sense, because so
many people want to override it, which requires setting
'eldoc-documentation-strategy' to the non-default value
'eldoc-documentation-compose'.

The problem was made worse by the fact that setting it as usual in
either the Customize menu or their init file didn't work, requiring a
fairly complex Elisp snippet.  That is now solved as of this commit.

If the user does not do any setting, then Eglot works basically the
same as before (i.e. shows only one piece of information).

It is arguable that the default value for
'eldoc-documentation-strategy' should change globally to
'eldoc-documentation-compose', but that has other subtle implications
and is not part of this commit.

* lisp/progmodes/eglot.el (eglot--managed-mode): Don't set Eldoc
variables greedily.

22 months agoMake the native compiler always use `make-temp-file' for temporary files
Andrea Corallo [Mon, 20 Feb 2023 20:03:58 +0000 (21:03 +0100)]
Make the native compiler always use `make-temp-file' for temporary files

* src/comp.c (CALL4I): Define macro.
(Fcomp__compile_ctxt_to_file): Use `make-temp-file' instead of
`make-temp-file-internal'.
* lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Likewise.

22 months ago; * lisp/progmodes/rust-ts-mode.el (treesit-node-end): Declare.
Eli Zaretskii [Mon, 20 Feb 2023 17:30:02 +0000 (19:30 +0200)]
; * lisp/progmodes/rust-ts-mode.el (treesit-node-end): Declare.

22 months agoUpdate to Transient v0.3.7-216-gfe40342
Jonas Bernoulli [Mon, 20 Feb 2023 15:36:16 +0000 (16:36 +0100)]
Update to Transient v0.3.7-216-gfe40342

22 months agoAdd declaration_list to c-ts-common-indent-type-regexp-alist
Daniel Martín [Sun, 19 Feb 2023 21:57:54 +0000 (22:57 +0100)]
Add declaration_list to c-ts-common-indent-type-regexp-alist

* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Consider a
"declaration_list" a block. (Bug#61635)
* test/lisp/progmodes/c-ts-mode-resources/indent.erts (Code): Add a
test case.

22 months agoTypescript-ts-mode: Add switch case handling
Theodor Thornhill [Mon, 20 Feb 2023 12:38:55 +0000 (13:38 +0100)]
Typescript-ts-mode: Add switch case handling

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): New rules.

22 months agoFix object initializer for csharp-mode (bug#61541)
Theodor Thornhill [Sun, 19 Feb 2023 19:48:36 +0000 (20:48 +0100)]
Fix object initializer for csharp-mode (bug#61541)

* lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Make sure
we check the openers as well as closers.

22 months agoUpdate to Org 9.6.1-34-geea8da
Kyle Meyer [Mon, 20 Feb 2023 05:41:31 +0000 (00:41 -0500)]
Update to Org 9.6.1-34-geea8da

22 months agoImprove tree-sitter indent anchor prev-adaptive-prefix (bug#61314)
Yuan Fu [Sun, 19 Feb 2023 20:22:27 +0000 (12:22 -0800)]
Improve tree-sitter indent anchor prev-adaptive-prefix (bug#61314)

Now prev-adaptive-prefix looks at the current line and checks if it
begins with a prefix itself.  If it does, prev-adaptive-prefix tries
to place the anchor before the prefix on the previous line, rather
than after it.

 - prev line
 - this line -> This line starts with a "-", i.e., begins with a
                prefix, so we place the anchor at the beginning of the
                 "-" of the previous line, rather than after it

 - prev line
   this line -> This line doesn't start with a prefix, so the anchor
                is placed after the previous line's "-".

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el:
(treesit-simple-indent-presets): Add local variable
this-line-has-prefix, base what anchor to return on the value of
this-line-has-prefix and whether the prev line has a prefix.

22 months agoAdjust jsx indentation
Theodor Thornhill [Sat, 18 Feb 2023 22:10:13 +0000 (23:10 +0100)]
Adjust jsx indentation

We can use the fact that 'treesit-indent-1' uses 'treesit-node-on'
when on a whitespace to set the actual current node as parent.  Now we
can correctly indent the 'jsx_text' nodes.  We also add some more
electric-indent-chars so that auto-indenting of jsx behaves a little
more fluently.

* lisp/progmodes/js.el (js--treesit-indent-rules): Add new rules.
(js-ts-mode): Add more indent-chars.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Add new rules.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-base-mode): Add more indent-chars and layout rules.

22 months agoCleanup preproc indent for c-ts-mode (bug#61558)
Theodor Thornhill [Fri, 17 Feb 2023 19:46:19 +0000 (20:46 +0100)]
Cleanup preproc indent for c-ts-mode (bug#61558)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Make sure we
indent to great-grand-parent if inside an #ifdef...#endif block.  If
grand-parent is root node, then don't indent one step.
(c-ts-mode--preproc-offset): New helper anchor function to calculate
indent offset.

22 months agoAdd comment style toggle for c-ts-mode (bug#61550)
Theodor Thornhill [Fri, 17 Feb 2023 22:46:24 +0000 (23:46 +0100)]
Add comment style toggle for c-ts-mode (bug#61550)

* lisp/progmodes/c-ts-mode.el (c-ts-mode-toggle-comment-style): New
command.
(c-ts-base-mode-map): Add binding.
(c-ts-mode-set-modeline): New function.
(c-ts-mode): Set modeline.
(c++-ts-mode): Set modeline.

22 months ago* lisp/simple.el (choose-completion): Check for completion-in-region-mode.
Juri Linkov [Sun, 19 Feb 2023 19:30:02 +0000 (21:30 +0200)]
* lisp/simple.el (choose-completion): Check for completion-in-region-mode.

Don't use base-affixes when completion-use-base-affixes is non-nil
in completion-in-region-mode (bug#61535).

22 months agorust-ts-mode--font-lock-settings: Avoid the explicit 'default' face
Dmitry Gutov [Sun, 19 Feb 2023 17:18:19 +0000 (19:18 +0200)]
rust-ts-mode--font-lock-settings: Avoid the explicit 'default' face

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--fontify-scope)
(rust-ts-mode--fontify-tail): New functions.
(rust-ts-mode--font-lock-settings): Use them instead of a lot of
more complex queries (bug#61302).  Thus avoid having to create
block fontification by other features using the 'default' face.
Replace the catch-all query for 'variable' with an enumeration of
possible parent nodes.

22 months ago* lisp/progmodes/xref.el: Bump the version.
Dmitry Gutov [Sun, 19 Feb 2023 12:27:27 +0000 (14:27 +0200)]
* lisp/progmodes/xref.el: Bump the version.

22 months agoxref--insert-xrefs: Use 'shadow' for the line number colon
Dmitry Gutov [Thu, 9 Feb 2023 19:57:18 +0000 (21:57 +0200)]
xref--insert-xrefs: Use 'shadow' for the line number colon

* lisp/progmodes/xref.el (xref--insert-xrefs): Use face 'shadow' for
the line number colon instead of continuing it face (bug#61340).

(cherry picked from commit d6d25a3c221e566de4df5319181e9ba9a8df285e)

22 months ago* lisp/progmodes/xref.el (xref--insert-xrefs): Remove extra space (bug#61340).
Juri Linkov [Wed, 8 Feb 2023 07:34:49 +0000 (09:34 +0200)]
* lisp/progmodes/xref.el (xref--insert-xrefs): Remove extra space (bug#61340).

(cherry picked from commit 643a11c6e5defc0a34da1a53b64aa1e097298923)

22 months agoBackport: Fix xref-clear-marker-stack refactoring mistake
Mattias Engdegård [Thu, 26 Jan 2023 11:36:20 +0000 (12:36 +0100)]
Backport: Fix xref-clear-marker-stack refactoring mistake

* lisp/progmodes/xref.el (xref-clear-marker-stack):
Clear the history correctly.  Changing a lexical variable has no effect.

(cherry picked from commit dfdc0f5fb7b10e737c3c8e2bdb1eb873a1e91bd7)

22 months ago; Merge from origin/emacs-28
Stefan Kangas [Sun, 19 Feb 2023 16:38:00 +0000 (17:38 +0100)]
; Merge from origin/emacs-28

The following commit was skipped:

a44d906740f ; Commit files changed by "autoreconf -i -I m4 --force"

22 months agoMerge from origin/emacs-28
Stefan Kangas [Sun, 19 Feb 2023 16:37:59 +0000 (17:37 +0100)]
Merge from origin/emacs-28

f5a99945b6f ; Update ChangeLog for Emacs 28.3
f7bd5ac5521 Update HISTORY for Emacs 28.3

# Conflicts:
# etc/NEWS

22 months ago; Merge from origin/emacs-28
Stefan Kangas [Sun, 19 Feb 2023 16:35:20 +0000 (17:35 +0100)]
; Merge from origin/emacs-28

The following commits were skipped:

ba3aba3096a Bump Emacs version to 28.3
e61d743d440 Update NEWS for Emacs 28.3

22 months agoMerge from origin/emacs-28
Stefan Kangas [Sun, 19 Feb 2023 16:35:20 +0000 (17:35 +0100)]
Merge from origin/emacs-28

4a77fcb1478 Update ChangeLog and AUTHORS for Emacs 28.3

22 months ago; Merge from origin/emacs-28
Stefan Kangas [Sun, 19 Feb 2023 16:35:20 +0000 (17:35 +0100)]
; Merge from origin/emacs-28

The following commits were skipped:

e339926272a Fix etags local command injection vulnerability
5d05ea803e9 Fixed ctags local command execute vulnerability
22fb5ff5126 Fix ruby-mode.el local command injection vulnerability (b...
807d2d5b3a7 Fix htmlfontify.el command injection vulnerability.
ae9bfed50db Fix storing email into nnmail by Gnus

22 months ago; Improve image-dired-thumbnail-storage docstring
Stefan Kangas [Sun, 19 Feb 2023 16:27:19 +0000 (17:27 +0100)]
; Improve image-dired-thumbnail-storage docstring

* lisp/image/image-dired.el (image-dired-thumbnail-storage):
Improve docstring.

22 months ago; * doc/emacs/dired.texi (Image-Dired): Fix last change.
Eli Zaretskii [Sun, 19 Feb 2023 15:09:18 +0000 (17:09 +0200)]
; * doc/emacs/dired.texi (Image-Dired): Fix last change.

22 months agoMore doc on image-dired-dired-* (bug#61624)
Manuel Giraud [Sun, 19 Feb 2023 11:19:02 +0000 (12:19 +0100)]
More doc on image-dired-dired-* (bug#61624)

* doc/emacs/dired.texi (Image-Dired): Some fixes and more
documentation about image-dired-dired-* commands.

22 months agoEglot: improve treatment of completion items without :sortText (bug#61532)
Theodor Thornhill [Sun, 19 Feb 2023 11:11:13 +0000 (11:11 +0000)]
Eglot: improve treatment of completion items without :sortText (bug#61532)

Previously, defaulting to the empty string put candidates without
:sortText to the top of the list.  since string-lessp is safe with nil
arguments, this makes them sort to the end instead.

* lisp/progmodes/eglot.el (eglot-completion-at-point): Simplify.

22 months ago; * admin/make-tarball.txt: Minor copyedit.
Stefan Kangas [Sun, 19 Feb 2023 10:35:31 +0000 (11:35 +0100)]
; * admin/make-tarball.txt: Minor copyedit.

22 months ago; Commit files changed by "autoreconf -i -I m4 --force" emacs-28.3-rc1
Stefan Kangas [Fri, 17 Feb 2023 22:44:39 +0000 (23:44 +0100)]
; Commit files changed by "autoreconf -i -I m4 --force"

* build-aux/config.guess:
* build-aux/config.sub: Update files changed by running "autoreconf -i
-I m4 --force".  Do not merge.

22 months ago; Update ChangeLog for Emacs 28.3
Stefan Kangas [Fri, 17 Feb 2023 22:33:33 +0000 (23:33 +0100)]
; Update ChangeLog for Emacs 28.3

* ChangeLog.3: Refresh for Emacs 28.3.
* etc/NEWS: Add more information about fixed vulnerabilities.

22 months agoFix invocation of File->Close from the menu bar
Eli Zaretskii [Sun, 19 Feb 2023 09:29:32 +0000 (11:29 +0200)]
Fix invocation of File->Close from the menu bar

* lisp/simple.el (kill-buffer--possibly-save): Don't request
LONG-FORM from 'read-multiple-choice' if GUI dialog should be
used.
* lisp/emacs-lisp/rmc.el (read-multiple-choice): Doc fix.
(read-multiple-choice--short-answers): Don't append "?" to
CHOICES and don't display the prompt in the echo area if GUI
dialog is used.  Use 'use-dialog-box-p'.  (Bug#61553)

22 months ago; Improve documentation of 'native-comp-enable-subr-trampolines'
Eli Zaretskii [Sun, 19 Feb 2023 09:04:57 +0000 (11:04 +0200)]
; Improve documentation of 'native-comp-enable-subr-trampolines'

* doc/lispref/compile.texi (Native-Compilation Variables):
Document the interpretation of non-absolute directory names that
are the value of 'native-comp-enable-subr-trampolines'.

22 months agoUpdate thumbnail buffer's header more
Manuel Giraud [Tue, 14 Feb 2023 14:08:17 +0000 (15:08 +0100)]
Update thumbnail buffer's header more

* lisp/image/image-dired.el (image-dired-display-thumbs): Call
image-dired--update-header-line.  (Bug#61508)

22 months ago(treesit-query-validate): Fix reusing the output buffer
Dmitry Gutov [Sat, 18 Feb 2023 21:52:47 +0000 (23:52 +0200)]
(treesit-query-validate): Fix reusing the output buffer

* lisp/treesit.el (treesit-query-validate): Fix the "Buffer is
read-only" error when an output buffer already exists.

22 months ago(rust-ts-mode--font-lock-settings): Highlight closure parameters
Dmitry Gutov [Sat, 18 Feb 2023 21:51:17 +0000 (23:51 +0200)]
(rust-ts-mode--font-lock-settings): Highlight closure parameters

* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--font-lock-settings): Highlight closure parameters.

22 months ago* Fix `native-comp-enable-subr-trampolines' semantic
Andrea Corallo [Sat, 18 Feb 2023 21:44:05 +0000 (22:44 +0100)]
* Fix `native-comp-enable-subr-trampolines' semantic

* lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Interpret
`native-comp-enable-subr-trampolines' relative to
`invocation-directory'.

22 months agoFix documentation of 'just-one-space' and 'delete-horizontal-space'
Eli Zaretskii [Sat, 18 Feb 2023 18:03:33 +0000 (20:03 +0200)]
Fix documentation of 'just-one-space' and 'delete-horizontal-space'

* lisp/simple.el (just-one-space, delete-horizontal-space):
Mention the effect of prefix argument.  (Bug#61609)

22 months ago; Remove NEWS entry about deleted variable.
Eli Zaretskii [Sat, 18 Feb 2023 17:48:22 +0000 (19:48 +0200)]
; Remove NEWS entry about deleted variable.

22 months ago; Fix wording of last change.
Eli Zaretskii [Sat, 18 Feb 2023 17:45:33 +0000 (19:45 +0200)]
; Fix wording of last change.

22 months agoFix 'display-buffer-use-least-recent-window'
martin rudalics [Sun, 12 Feb 2023 09:33:11 +0000 (10:33 +0100)]
Fix 'display-buffer-use-least-recent-window'

* src/window.c (Fwindow_use_time): Doc fix.
(Fwindow_bump_use_time): Bump use time of the seleceted window as
well.  Doc fix.

* lisp/window.el (display-buffer-avoid-small-windows): Remove.
All users changed.
(window--display-buffer): Bump window use time when requested.
(display-buffer--lru-window): New function.
(display-buffer-use-some-window): Use it.
(display-buffer-use-least-recent-window): Rewrite and enhance doc
string.

* doc/lispref/windows.texi (Selecting Windows)
(Buffer Display Action Functions, Buffer Display Action Alists)
(The Zen of Buffer Display): Improve and update documentation of
window selection and display facilities.

22 months agoFix point moving when calling python-shell-send-region
kobarity [Mon, 13 Feb 2023 15:30:15 +0000 (00:30 +0900)]
Fix point moving when calling python-shell-send-region

* lisp/progmodes/python.el (python-shell-buffer-substring): Add
`save-excursion' to prevent the point from moving.
* test/lisp/progmodes/python-tests.el (python-tests-should-not-move):
New helper function to assert that point does not move while calling a
function.
(python-shell-buffer-substring-*): Use
`python-tests-should-not-move'. (Bug#61463)

22 months ago(project-try-vc): Remove unused defvar/require
Omar Polo [Sat, 18 Feb 2023 13:10:57 +0000 (15:10 +0200)]
(project-try-vc): Remove unused defvar/require

* lisp/progmodes/project.el (project-try-vc):
Remove unused defvar/require (bug#61577).

22 months ago; Fix typo
Stefan Kangas [Sat, 18 Feb 2023 12:39:14 +0000 (13:39 +0100)]
; Fix typo

22 months agoDelete redundant question from Gnus FAQ
Stefan Kangas [Sat, 18 Feb 2023 12:35:37 +0000 (13:35 +0100)]
Delete redundant question from Gnus FAQ

* doc/misc/gnus-faq.texi (FAQ 1-2): Delete redundant question.
(FAQ 1-1, FAQ 1-3): Adjust accordingly.

22 months agoSlightly improve hashcash documentation
Stefan Kangas [Sat, 18 Feb 2023 12:00:04 +0000 (13:00 +0100)]
Slightly improve hashcash documentation

* lisp/mail/hashcash.el: Improve Commentary.
(hashcash-program):
* lisp/gnus/message.el (message-generate-hashcash): Improve
docstring.

22 months agoFix cursor motion when there's line-prefix and display string at BOL
Eli Zaretskii [Sat, 18 Feb 2023 11:40:56 +0000 (13:40 +0200)]
Fix cursor motion when there's line-prefix and display string at BOL

* src/xdisp.c (move_it_in_display_line_to): Handle 'line-prefix' and
'wrap-prefix' when the screen line has a display string at its
beginning.  (Bug#61580)

22 months agoFix comment in treesit_record_change (bug#61369)
Yuan Fu [Sat, 18 Feb 2023 10:20:12 +0000 (02:20 -0800)]
Fix comment in treesit_record_change (bug#61369)

Turns out the previous commit message and comment is not entirely
correct: the old behavior is in fact wrong, not just "correct but has
problems".

Here is why the old code is wrong:

|visible range|     -> markup for visible range

updated range       -> markup for updated range
-------------

First we have some text

|aaaaaa|

Now we insert something at the beginning, because we clip
new_end_offset to visible_end, out of eight b's inserted, only the
first six are known to tree-sitter.

|bbbbbbbbaaaa|aa  start: 0, old_end: 0, new_end: 6
 ------

In treesit_sync_visible_region, we sync up visible region, but the two
missing b's are not in the updated range.

|bbbbbbbbaaaaaa|  start: 12, old_end: 12, new_end: 14
             --

The old behavior not only is wrong, but also doesn't make much sense.

* src/treesit.c (treesit_record_change): Update comment.

22 months agoSpell out RPN abbreviation in Calc manual intro
Stefan Kangas [Sat, 18 Feb 2023 09:57:27 +0000 (10:57 +0100)]
Spell out RPN abbreviation in Calc manual intro

* doc/misc/calc.texi (What is Calc, Demonstration of Calc)
(RPN Tutorial): Spell out "Reverse Polish notation" abbreviation.

22 months agoFix some uses of 'use-dialog-box'
Eli Zaretskii [Sat, 18 Feb 2023 08:58:00 +0000 (10:58 +0200)]
Fix some uses of 'use-dialog-box'

* lisp/frame.el (display-mouse-p): Fix return value on MS-Windows
in batch invocations.
* lisp/hi-lock.el (hi-lock-unface-buffer): Don't consider
'last-nonmenu-event' being nil as a mouse event, for the purpose
of using dialog boxes.

22 months agoFix hi-lock-tests when 'use-dialog-box' is non-nil
Eli Zaretskii [Sat, 18 Feb 2023 08:45:12 +0000 (10:45 +0200)]
Fix hi-lock-tests when 'use-dialog-box' is non-nil

* test/lisp/hi-lock-tests.el (hi-lock-case-fold)
(hi-lock-unhighlight): Bind 'use-dialog-box' to nil.

22 months agoFix regression due to change in face sort order by 'face-list'
Eli Zaretskii [Sat, 18 Feb 2023 07:37:34 +0000 (09:37 +0200)]
Fix regression due to change in face sort order by 'face-list'

* lisp/faces.el (x-create-frame-with-faces): Undo reversing of
the face list, which is no longer necessary, since 'face-list's
sorting order has been reversed recently.  (Bug#61521)