1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

165262 commits

Author SHA1 Message Date
Stefan Kangas
c5d319af47 Merge from origin/emacs-29
613de66281 Rename the newly added -ref- faces to -use-
f601e9666d Eglot: support multiple labels in same inlay hint
4a5eda7ed2 Eglot: don't paint hints outside requested region (bug#61...
11c1aa1eb1 ; * doc/misc/gnus.texi: Fix last change.
44949c292f ; Add `nnimap-user' to Gnus manual
6c7078c66f ; * lisp/progmodes/c-ts-mode.el (treesit-node-prev-siblin...
3d0a6c9baa Eglot: protect against unintended field text motion (bug#...
647e40f4a0 ; And yet another fix to eglot-current-linepos-function's...
9d0f856a16 Fix description of 'desktop-save-mode'
aee10ca1cb Adjust tree-sitter defun navigation (bug#61617)
edf5b97686 Simplify c-ts-mode--top-level-label-matcher
0f15286c53 New tree-sitter indent anchor standalone-parent used by c...

# Conflicts:
#	etc/NEWS
2023-02-28 06:30:13 +01:00
Dmitry Gutov
613de66281 Rename the newly added -ref- faces to -use-
* lisp/font-lock.el (font-lock-variable-use-face)
(font-lock-property-use-face): Rename from font-lock-variable-ref-face
and font-lock-property-ref-face.  Update all references (bug#61655).
2023-02-28 04:08:55 +02:00
Augusto Stoffel
93f557af0e New user option 'grep-use-headings'
* lisp/progmodes/grep.el (grep-heading-regexp): New user option.
(grep-heading): New face (bug#59888).
(grep--heading-format, grep--heading-state, grep--heading-filter):
Filter function for grep processes and supporting variables.
(grep-use-headings): New user option.
(grep-mode): Use the above, if applicable.
2023-02-27 21:14:47 +02:00
Augusto Stoffel
b699c38028 Introduce 'compilation-annotation' text property
It is meant to mark parts of compilation buffers which do not
correspond to process output (bug#59888).

* lisp/progmodes/compile.el (compilation-insert-annotation): New
function.
(compilation-start, compilation-handle-exit): Use it.
(compilation--ensure-parse) Rely on 'compilation-annotation' property
instead of 'compilation-header-end'.
2023-02-27 21:14:41 +02:00
João Távora
b5c1303253 * lisp/icomplete.el (fido-mode): Enable in-buffer completion (bug#45763). 2023-02-27 20:40:48 +02:00
Juri Linkov
a7a984c0eb * lisp/icomplete.el: Fix in-buffer completion.
(icomplete-force-complete-and-exit, icomplete-force-complete): Use
'icomplete--field-beg/end' when not in the minibuffer to not erase
the current buffer.  Also disable 'completion-in-region-mode' instead
of calling 'exit-minibuffer' (bug#45764, bug#51575, bug#61479).
2023-02-27 20:32:53 +02:00
João Távora
f601e9666d Eglot: support multiple labels in same inlay hint
Mainly the rust-analyzer LSP server uses this.  There are still more
things we could support, like tooltips and stuff.

* lisp/progmodes/eglot.el (lsp-interface-alist): Add
InlayHintLabelPart.
(eglot--update-hints-1): Support multiple labels for same hint.
2023-02-27 14:54:53 +00:00
João Távora
4a5eda7ed2 Eglot: don't paint hints outside requested region (bug#61812)
* lisp/progmodes/eglot.el (eglot--lambda): Add cl-block.
(eglot--update-hints-1): Return early if hint is outside the
requested inlay hint range.
2023-02-27 14:23:53 +00:00
Mattias Engdegård
1767d18c91 Adjust some pure and side-effect-free function declarations
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns):
Add `format-message` and `substring-no-properties`.
* lisp/subr.el (number-sequence, copy-tree, looking-at-p)
(string-match-p, string-trim-right, string-lines):
Declare side-effect-free.
(syntax-class, version-list-<, version-list-=, version-list-<=)
(version-list-not-zero): Declare pure and side-effect-free.
(ensure-list): Declare side-effect-free and error-free.
(string-equal-ignore-case): Remove `pure` declaration.
We may want it to be pure but right now it's not.
2023-02-27 14:34:22 +01:00
Mattias Engdegård
443c249d85 Warn about condition-case without handlers
Omitting handlers from a `condition-case` form makes it useless
since no errors are caught.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): New warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
* etc/NEWS: Announce.
2023-02-27 14:34:22 +01:00
Eli Zaretskii
11c1aa1eb1 ; * doc/misc/gnus.texi: Fix last change. 2023-02-27 14:32:57 +02:00
Arash Esbati
44949c292f ; Add `nnimap-user' to Gnus manual
* doc/misc/gnus.texi (Customizing the IMAP Connection): Document
backend variable `nnimap-user' which was introduced with commit
5e68f8614f in 2011.
Add index entries for all backend variables.  (bug#61837)
2023-02-27 14:30:29 +02:00
Eli Zaretskii
6c7078c66f ; * lisp/progmodes/c-ts-mode.el (treesit-node-prev-sibling): Declare. 2023-02-27 14:11:13 +02:00
João Távora
3d0a6c9baa Eglot: protect against unintended field text motion (bug#61726)
Suggested-by: Augusto Stoffel <arstoffel@gmail.com>

* lisp/progmodes/eglot.el (eglot--bol): New helper.
(eglot-utf-8-linepos, eglot-utf-16-linepos)
(eglot-utf-32-linepos, eglot-move-to-utf-8-linepos)
(eglot-move-to-utf-16-linepos, eglot-move-to-utf-32-linepos)
(eglot-handle-notification, eglot--xref-make-match)
(eglot-completion-at-point): Use it.
2023-02-27 11:36:22 +00:00
João Távora
647e40f4a0 ; And yet another fix to eglot-current-linepos-function's docstring
bug#61726

* lisp/progmodes/eglot.el (eglot-current-linepos-function):
Another fix.
2023-02-27 11:36:22 +00:00
Eli Zaretskii
9d0f856a16 Fix description of 'desktop-save-mode'
* doc/emacs/misc.texi (Saving Emacs Sessions): Adjust to changes
in 'desktop-path'.  Reported by Petteri Hintsanen <petterih@iki.fi>.
2023-02-27 13:31:47 +02:00
Mattias Engdegård
10d2b76eda * lisp/calc/calc.el (calcDigit-backspace): Hush warning. 2023-02-27 12:29:35 +01:00
Mattias Engdegård
434ab2e088 Improve delete-consecutive-dups doc precision and add test
* lisp/subr.el (delete-consecutive-dups): Document which element of
each run is retained (the earliest in the list).  This matters because
it makes it safe to ignore the return value.
* test/lisp/subr-tests.el (subr--delete-dups)
(subr--delete-consecutive-dups): Add tests.
2023-02-27 10:03:23 +01:00
Yuan Fu
aee10ca1cb
Adjust tree-sitter defun navigation (bug#61617)
Before this change, when you use a tree-sitter navigation function to
move to the next beginning of a thing, it jumps over the immediate
next thing and lands you at the beginning of the next-next thing.

Eg, when point is at the "|", and we evaluate
(treesit--navigate-thing pos 1 'beg), we go from

|  (thing) (thing)

to

   (thing) |(thing)

But some might expect point to go to

   |(thing) (thing)

instead, which makes sense.  Also, that's how Emacs expect defun
navigation functions to work.  The discrepancy in expectation causes
bug#61617.

In this change I made tree-sitter navigation functions to work as what
Emacs expects.  And what I described for moving to the next beginning
of thing is similarly applicable to moving to the end of previous end
of thing.

* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Handle the case where defun-skipper moves
point back to where we started, by adding a retry.

(treesit--navigate-thing): Add a single condition checking for
progress to the condition form responsible for checking whether to
skip the next defun.  Namely (eq pos (funcall advance next)))).

* test/src/treesit-tests.el:
(treesit--ert-defun-navigation-nested-master)
(treesit--ert-defun-navigation-top-level-master): Change tests to
reflect the new expectation.
2023-02-27 00:14:32 -08:00
Yuan Fu
edf5b97686
Simplify c-ts-mode--top-level-label-matcher
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--top-level-label-matcher): Make more assumptions and remove
the loop, so it's faster in large files.
2023-02-26 21:38:22 -08:00
Yuan Fu
0f15286c53
New tree-sitter indent anchor standalone-parent used by c-ts-mode
When writing c-ts-mode Theo used parent-bol which works well except
one case:

1 for (int i=0;
2      i < 5;
3      i++) {
4   func(i);
5 }

In this case, when indenting "func(i)", parent-bol returns the start
of "i++" on line 3, instead of the "correct" anchor, the start of
"for" on line 1.  parent-bol would have worked if the "for (...) {"
part is in one line.

To support this case I tried numerous things and added a bunch of
stuff, culminating in c-ts-common-statement-offset.  It's complicated,
requires extra setup, and slow.

Not anymore! I think the new anchor standalone-parent really captures
the logic behind how people expect indentation to work. It's simple
and fast, and requires no setup.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--standalone-grandparent): New anchor.
(c-ts-mode--indent-styles): Replace c-ts-common-statement-offset with
standalone-parent.
(c-ts-base-mode): Add comment.

* lisp/treesit.el:
(treesit-simple-indent-presets): New anchor standalone-parent.
2023-02-26 21:38:22 -08:00
Stefan Kangas
c640dc9ef5 Merge from origin/emacs-29
267fc6d00c ruby-smie-rules: Fix misindentation of a method call afte...
0fde314f6f * lib-src/etags.c (process_file_name): Free malloc'ed var...
dde9d149af ; Improve documentation of loading *.eln files
7c552be89d ; Another doc fix in eglot.el
75c65fcc98 ; Fix last change
a3d15c1f74 ; Fix last change
ca79b138d4 Eglot: rename and redocument encoding-related functions (...
3e3e6d71be Eglot: support positionEncoding LSP capability (bug#61726)
b0e87e930e Eglot: use faster strategy for moving to LSP positions (b...
5b174b9683 Fix mule-tests in UTF-8 locales
5256392a7e Fix 'vertical-motion' when display strings are around
0db88d625a ; * src/treesit.c (treesit_predicate_match): Fix typo.
2023-02-27 06:30:20 +01:00
Dmitry Gutov
267fc6d00c ruby-smie-rules: Fix misindentation of a method call after assignment
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Fix indentation of a
method call after assignment with ruby-after-operator-indent=nil
(bug#61822).

* test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb:
Add corresponding example.
2023-02-27 02:06:20 +02:00
Eli Zaretskii
0fde314f6f * lib-src/etags.c (process_file_name): Free malloc'ed vars (bug#61819). 2023-02-26 20:03:20 +02:00
Eli Zaretskii
dde9d149af ; Improve documentation of loading *.eln files
* doc/lispref/loading.texi (How Programs Do Loading):
* doc/emacs/building.texi (Lisp Libraries): Some additional
details about what happens with natively-compiled files.
2023-02-26 19:51:59 +02:00
Eli Zaretskii
7c552be89d ; Another doc fix in eglot.el
* lisp/progmodes/eglot.el (eglot-current-linepos-function):
Another doc fix.
2023-02-26 16:48:07 +02:00
Michael Albinus
6c4abbab79 Tramp: Do not unlock when connection is broken
* lisp/net/tramp.el (tramp-handle-unlock-file): Do not unlock when
connection is broken.  (Bug#61663)

* test/lisp/net/tramp-tests.el (tramp-test39-make-lock-file-name):
Extend test.
2023-02-26 15:40:30 +01:00
João Távora
75c65fcc98 ; Fix last change
bug#61726

* lisp/progmodes/eglot.el (eglot-current-linepos-function): Fix docstring.
2023-02-26 14:05:47 +00:00
Eli Zaretskii
a3d15c1f74 ; Fix last change
* lisp/progmodes/eglot.el (eglot-current-linepos-function)
(eglot-utf-8-linepos, eglot-utf-16-linepos)
(eglot-utf-32-linepos, eglot-move-to-linepos-function)
(eglot-move-to-utf-8-linepos, eglot-move-to-utf-32-linepos): Doc
fixes.  (Bug#61726)
2023-02-26 15:24:11 +02:00
João Távora
ca79b138d4 Eglot: rename and redocument encoding-related functions (bug#61726)
* lisp/progmodes/eglot.el (eglot-current-column): Obsolete.
(eglot-lsp-abiding-column): Obsolete.
(eglot-current-column-function): Obsolete.
(eglot-current-linepos-function): Rename from eglot-current-column-function.
(eglot-utf-8-linepos): Rename from eglot-bytewise-column.
(eglot-utf-16-linepos): Rename from eglot-lsp-abiding-column.
(eglot-utf-32-linepos): Rename from eglot-current-column.
(eglot-move-to-current-column): Obsolete.
(eglot-move-to-lsp-abiding-column): Obsolete.
(eglot-move-to-column-function): Obsolete.
(eglot-move-to-linepos-function): Rename from eglot-move-to-column-function.
(eglot-move-to-utf-8-linepos): Rename from eglot-move-to-bytewise-column.
(eglot-move-to-utf-16-linepos): Rename from eglot-move-to-lsp-abiding-column.
(eglot-move-to-utf-32-linepos): Rename from eglot-move-to-current-column.
(eglot--managed-mode): Adjust.
(eglot-client-capabilities): Trim whitespace.

* test/lisp/progmodes/eglot-tests.el (eglot-test-lsp-abiding-column)
(eglot-test-lsp-abiding-column-1): Use new function/variable names.
2023-02-26 13:00:24 +00:00
Augusto Stoffel
3e3e6d71be Eglot: support positionEncoding LSP capability (bug#61726)
* lisp/progmodes/eglot.el(eglot-client-capabilities):  Announce the
new capability.
(eglot-bytewise-column, eglot-move-to-bytewise-column): New functions.
(eglot--managed-mode): Set 'eglot-current-column-function' and
'eglot-move-to-bytewise-column' appropriately.
2023-02-26 12:53:09 +00:00
Eli Zaretskii
b0e87e930e Eglot: use faster strategy for moving to LSP positions (bug#61726)
Turns out we don't need encode-coding-region after all.

* lisp/progmodes/eglot.el (eglot-move-to-lsp-abiding-column): Rewrite.

Co-authored-by: Augusto Stoffel <arstoffel@gmail.com>
2023-02-26 10:29:14 +00:00
Eli Zaretskii
5b174b9683 Fix mule-tests in UTF-8 locales
* test/lisp/international/mule-tests.el
(sgml-html-meta-no-post-less-than-10lines): Fix test condition.
2023-02-26 11:46:20 +02:00
Eli Zaretskii
5256392a7e Fix 'vertical-motion' when display strings are around
* src/indent.c (Fvertical_motion): Correct bidi-related condition
for character position, when we didn't move vertically.  (Bug#61636)
2023-02-26 11:34:14 +02:00
Yuan Fu
0db88d625a
; * src/treesit.c (treesit_predicate_match): Fix typo. 2023-02-26 01:12:33 -08:00
Paul Eggert
8797e514ab Disable xattr test on MS-Windows.
* nt/mingw-cfg.site (enable_xattr): Set to "no".  (Bug#61782)
2023-02-26 08:54:45 +02:00
Po Lu
a5be840c7b Fix the MS-DOS build
* msdos/sedlibmk.inp: Update getopt.h conditions.
2023-02-26 14:42:14 +08:00
Stefan Kangas
580bb8f46c Merge from origin/emacs-29
3cae0e3d96 python-ts-mode: Fix single-quote string fontification
68d753e371 ; * etc/NEWS: Fix typos.
ab0cc4e781 Fix infloop in bidi.c
3b8b23f66d ; Fix doc string of 'emacs-lisp-byte-compile'

# Conflicts:
#	etc/NEWS
2023-02-26 06:30:12 +01:00
Jim Porter
9565e34762 Be more cautious in completing Eshell variable assignments
Previously, Eshell treated cases like the second argument in "tar
--directory=dir" as a variable assignment, but that prevented
'pcomplete/tar' from implementing its own completion for that
argument (bug#61778).

* lisp/eshell/esh-var.el (eshell-complete-variable-assignment): Only
handle completion when all initial arguments are variable assignments.

* test/lisp/eshell/em-cmpl-tests.el
(em-cmpl-test/variable-assign-completion/non-assignment): New test.
2023-02-25 20:38:55 -08:00
Stefan Monnier
2baf08683f (bytecomp-warn--ignore): New test
Add tests for the interaction of `ignore` with warnings.

* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-warn--ignore): New test.
(bytecomp--with-warning-test): Really make it a function.
2023-02-25 22:34:02 -05:00
Paul Eggert
b26d0dd583 Omit no-longer-needed SEEK_END workaround
* lib-src/ebrowse.c (SEEK_END): Remove; no longer needed
on any supported SunOS version.
2023-02-25 17:13:29 -08:00
Paul Eggert
6a3a729705 Update from Gnulib by running admin/merge-gnulib 2023-02-25 17:13:29 -08:00
Dmitry Gutov
3cae0e3d96 python-ts-mode: Fix single-quote string fontification
* lisp/progmodes/python.el (python--treesit-fontify-string):
Look for ', not just ", as opening delimiter (bug#61796).
2023-02-26 03:12:34 +02:00
Stefan Monnier
e91d29f004 bytecomp--with-warning-test: Make it a function
* lisp/emacs-lisp/bytecomp.el (bytecomp--with-warning-test):
Make it a function.
2023-02-25 17:45:40 -05:00
Michael Albinus
68d753e371 ; * etc/NEWS: Fix typos. 2023-02-25 18:45:14 +01:00
Eli Zaretskii
ab0cc4e781 Fix infloop in bidi.c
* src/bidi.c (bidi_set_paragraph_end): Reset the isolate_level to
zero.  Whenever stack_idx is reset to zero, the isolate_level must
also be reset, since there cannot be any isolate status outside of
embeddings.  Failure to reset isolate_level will cause us infloop
when we see a PDI.  Reported by Matt Beshara <m@mfa.pw>.
2023-02-25 17:19:15 +02:00
Eli Zaretskii
3b8b23f66d ; Fix doc string of 'emacs-lisp-byte-compile'
* lisp/progmodes/elisp-mode.el (emacs-lisp-byte-compile): Doc
fix.  (Bug#61784)
2023-02-25 15:51:04 +02:00
Michael Heerdegen
309e6aaa68 Make also 'diary-lunar-phases' report eclipses
* lisp/calendar/lunar.el (diary-lunar-phases): Report eclipses.
(calendar-lunar-phases): Tweak.
2023-02-25 11:05:54 +01:00
Stefan Kangas
50b55656b9 Merge from origin/emacs-29
5cf50d6004 Check the anchor along with the offset in treesit-indent-...
497018dd5c ; Fix typos in docstrings in c-ts-common.el
03072bbdd3 ; Set indent-tabs-mode to nil in c-ts-mode indent preproc...
4a25fa4586 Align to prev sibling for c-ts-mode indentation
d25f24fe57 Fix c-ts-common-statement-offset and c-ts-common--node-is
c92360c7a3 typescript-ts-mode: Highlight non-shorthand destructuring...
a795c51f60 Add more/finer faces for tree-sitter
146bce4932 Avoid crashes in batch mode due to lack of frame face cache
244a73cd72 Add Tramp version integrated in Emacs 28.3

# Conflicts:
#	etc/NEWS
2023-02-25 06:30:14 +01:00
Daniel Martín
5cf50d6004
Check the anchor along with the offset in treesit-indent-region
* lisp/treesit.el (treesit-indent-region): To compute a valid column,
having a non-nil offset is not enough, we need a non-nil anchor as
well.
2023-02-24 21:12:47 -08:00