1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00
Commit Graph

164819 Commits

Author SHA1 Message Date
Paul Eggert
b429274c5b Use Gnulib module alignasof instead of stdalign
* admin/merge-gnulib (GNULIB_MODULES):
Replace obsolescent Gnulib module stdalign with alignasof.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/stdalign.in.h: Remove; no longer needed.
2023-02-04 15:14:16 -08:00
Paul Eggert
04d97e76a9 Update from Gnulib by running admin/merge-gnulib 2023-02-04 15:14:16 -08:00
Paul Eggert
7e1c7db1cb Prefer https: to git: URIs
Prefer https: to git: URIs on Savannah.
The idea is to avoid some adversary-in-the-middle attacks
on developers.
2023-02-04 15:14:15 -08:00
Stefan Monnier
c39c26e33f nadvice: Fix bug#61179
Advising interactive forms relies on the ability to distinguish
interactive forms that do nothing else than return a function.
So, be careful to preserve this info.
Furthermore, interactive forms are expected to be evaluated in
the lexical context captured by the closure to which they belong,
so be careful to preserve that context when manipulating those forms.

* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form) <lambda>:
Preserve the info that an interactive form does nothing else than
return a function.

* lisp/emacs-lisp/nadvice.el (advice--interactive-form-1): New function.
(advice--interactive-form): Use it.
(advice--make-interactive-form): Refine to also accept function values
quoted with `quote`.  Remove obsolete TODO.

* test/lisp/emacs-lisp/nadvice-tests.el: Don't disallow byte-compilation.
(advice-test-bug61179): New test.

* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): Allow
the `if` arg to be a form.
* lisp/simple.el (oclosure-interactive-form): Adjust accordingly.
2023-02-04 11:23:31 -05:00
Theodor Thornhill
229d0772e2 Add test for java indentation (bug#61115)
* test/lisp/progmodes/java-ts-mode-resources/indent.erts: Add new test
case.
2023-02-04 09:26:54 +01:00
Alan Mackenzie
0a95a81d8d CC Mode: Fontify a certain foo * bar class by the asymmetric space heuristic
This fixes bug #61144.  If the space around the * is "symmetric" we leave foo
* bar unfontified, a multiplication operation.  If it is "asymmetric" we
fontify it as a pointer declaration.

* lisp/progmodes/cc-engine.el (c-fdoc-assymetric-space-about-asterisk): New
macro, extracted from c-forward-decl-or-cast-1.
(c-forward-decl-or-cast-1): Invoke the new macro twice, in CASE 16 (new) and
CASE 17.5 (the source of the macro).  In CASE 16, additionally set
unsafe-maybe when appropriate.
2023-02-03 20:55:59 +00:00
Stefan Kangas
ac7ec87a7a Merge from origin/emacs-29
96ea27278b ; Fix c-ts-mode indent test
d963a8f135 Make c-ts-mode indent tests side-effect-free
8a6bdf88b4 Call treesit_record_change in insert_from_gap_1
a2b77c79dc Use c-ts-common-statement-offset for closing brackets too
74e715cb72 ; Go back to original point when filling comments in c-ts...
b8009bbf2d ; Fix error where we pass t to treesit-node-type in c-ts-...
88ccf78b20 ; * src/treesit.c (treesit_predicate_match): Simplify las...
20454128b8 Minor improvements in sqlite.c
3b3c47d977 (treesit_predicate_match): Match node text against regexp...
e8334781c9 Improve documentation of gdb-mi's dedicated windows
c498884059 Avoid spurious pause in kill-ring-save (Bug#60841)
382ab516ce Change the default of 'treesit-defun-tactic' for 'c-ts-mode'
4d3428e95a Fix docstring fontification of CL's 'defstruct'
1c125baa3f Teach 'hs-minor-mode' about tree-sitter based modes
2de0ab5cbd ; Doc fixes in keymap.el
c6660a6d6d Improve documentation of 'repeat-mode' and related variables
be304bb328 ; * etc/NEWS: Mention the 'utf-8-auto' bugfix (bug#60750).

# Conflicts:
#	etc/NEWS
2023-02-03 06:30:24 +01:00
Yuan Fu
96ea27278b
; Fix c-ts-mode indent test
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Move the linux
style test case down.
2023-02-02 18:32:08 -08:00
Yuan Fu
d963a8f135
Make c-ts-mode indent tests side-effect-free
Running indent tests changes the global value of
c-ts-mode-indent-style.  That's not good.  This change fixes that.

I also refactored the indent style functions a bit.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--prompt-for-style): New function.
(c-ts-mode-set-local-style): New function.
(c-ts-mode-set-style): Use c-ts-mode--prompt-for-style.  Use
derived-mode-p when testing for major mode.  Remove check of current
buffer's major mode since it doesn't matter.

* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts:
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Use
c-ts-mode-set-local-style to set the indent style locally.
2023-02-02 18:32:08 -08:00
Yuan Fu
8a6bdf88b4
Call treesit_record_change in insert_from_gap_1
Before this change, insert_from_gap calls treesit_record_change but
insert_from_gap_1 doesn't.  However, insert_from_gap_1 is a public
function and is called in many other places outside of insdel.c.  This
could lead to tree-sitter's parse tree becoming out-of-sync with the
buffer content.

This change might fix bug#60650.

* src/insdel.c (insert_from_gap_1): Call treesit_record_change.
(insert_from_gap): Remove call to treesit_record_change.

* admin/notes/tree-sitter/treesit_record_change: New file.
2023-02-02 18:31:19 -08:00
Yuan Fu
a2b77c79dc
Use c-ts-common-statement-offset for closing brackets too
Merge c-ts-mode--close-bracket-offset into
c-ts-common-statement-offset.

* lisp/progmodes/c-ts-common.el:
(c-ts-common-statement-offset): Handle closing brackets too.
(c-ts-mode--close-bracket-offset): Remove function.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Use
c-ts-common-statement-offset for closing brackets.
2023-02-02 18:28:08 -08:00
Yuan Fu
74e715cb72
; Go back to original point when filling comments in c-ts-mode
* lisp/progmodes/c-ts-common.el:
(c-ts-common--fill-block-comment): Go to original point.
2023-02-02 17:39:08 -08:00
Yuan Fu
b8009bbf2d
; Fix error where we pass t to treesit-node-type in c-ts-common.el
* lisp/progmodes/c-ts-common.el:
(c-ts-common-statement-offset): Move the form that sets node to t
down, also add a check for node’s nullness.
2023-02-02 17:39:08 -08:00
Eli Zaretskii
88ccf78b20 ; * src/treesit.c (treesit_predicate_match): Simplify last change. 2023-02-02 21:54:15 +02:00
Eli Zaretskii
20454128b8 Minor improvements in sqlite.c
* src/sqlite.c (Fsqlite_next): Doc fix.  Return nil if SQLITE_DONE
was once seen for this statement.  (Bug#61151)
(row_to_value): Cons the value in reverse, to avoid the Fnreverse
call.  Patch by Helmut Eller <eller.helmut@gmail.com>.
(Bug#61165)
2023-02-02 21:45:44 +02:00
Dmitry Gutov
3b3c47d977 (treesit_predicate_match): Match node text against regexp without consing
* src/treesit.c (treesit_predicate_match): Match node text against
regexp without creating a new string object (bug#60953).

* src/search.c (search_buffer): Make not static.
Delete declaration near the beginning of the file.

* src/lisp.h: Declare it here.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--builtin-method-p):
Remove function.
(ruby-ts--font-lock-settings): Use the regexp with :match directly.
2023-02-02 21:38:59 +02:00
Eli Zaretskii
e8334781c9 Improve documentation of gdb-mi's dedicated windows
* doc/emacs/building.texi (Other GDB Buffers): Describe the I/O
buffer and commands to show individual specialized windows.
Improve indexing.
2023-02-02 20:49:15 +02:00
Kévin Le Gouguec
c498884059 Avoid spurious pause in kill-ring-save (Bug#60841)
'indicate-copied-region' checks whether the region is "highlighted"
and if not, briefly moves point to mark to give a visual cue of the
extent of text that was saved to the kill ring.

The region is considered "highlighted" if (a) it is active and (b) its
face specifies a :background.  That latter condition does not account
for the multiple ways in which the face can make the region "visually
distinct" from the default face, so switch to the more extensive
predicate face-differs-from-default-p.

The patch also fixes a couple of issues with the predicate's
implementation, and introduces a new user option in case anyone
happened to enjoy unconditional blinking.

* lisp/faces.el (face-differs-from-default-p): Filter out :extend; add
rationale for the attributes we ignore.
* lisp/simple.el (copy-region-blink-predicate): Add option to let
users explicitly opt into or out of blinking point and mark.
(region-indistinguishable-p): New function to detect
"if there is currently no active region highlighting", leveraging
face-differs-from-default-p.
(indicate-copied-region): Use it.
* src/xfaces.c (merge_face_ref): Allow :stipple to be nil, since it is
a documented valid value for that attribute.
* etc/NEWS: Announce user option.
2023-02-02 19:39:39 +01:00
Eli Zaretskii
382ab516ce Change the default of 'treesit-defun-tactic' for 'c-ts-mode'
* lisp/progmodes/c-ts-mode.el (c-ts-mode): Set
'treesit-defun-tactic' as appropriate for C.  (Bug#61208)
2023-02-02 20:21:02 +02:00
Eli Zaretskii
4d3428e95a Fix docstring fontification of CL's 'defstruct'
* lisp/emacs-lisp/lisp-mode.el (defstruct): Set 'doc-string'
property.  Patch by Nicolas Martyanoff <nicolas@n16f.net>.

Copyright-paperwork-exempt: yes
2023-02-02 20:12:02 +02:00
Eli Zaretskii
1c125baa3f Teach 'hs-minor-mode' about tree-sitter based modes
* lisp/progmodes/hideshow.el (hs-special-modes-alist): Teach
'hs-minor-mode' about tree-sitter based modes.  (Bug#61232)
2023-02-02 19:41:09 +02:00
Eli Zaretskii
2de0ab5cbd ; Doc fixes in keymap.el
* lisp/keymap.el (key-valid-p, key-translate, keymap-lookup)
(define-keymap): Doc fixes.
2023-02-02 16:14:15 +02:00
Mattias Engdegård
bfd338aad9 LAP peephole optimisation improvements
- Since discardN-preserve-tos(1) and stack-set(1) have the same
  effect, treat them as equivalent in all transformations.

- Move the rule

        discardN-preserve-tos(X) discardN-preserve-tos(Y)
    --> discardN-preserve-tos(X+Y)

  from the final pass to the main iteration since it may enable
  further optimisations.

- Don't apply the rule

    goto(X) ... X: DISCARD --> DISCARD goto(Y) ... X: DISCARD Y:

  when DISCARD could be merged or deleted instead, which is even better.

- Add the rule

    OP const return -> <deleted> const return

  where OP is effect-free.

- Generalise the push-pop annihilation rule to

    PUSH(K) discard(N) -> discard(N-K), N>K
    PUSH(K) discard(N) -> <deleted>,    N=K

  to any N, not just N=1.

- Add the rule

    OP goto(X) Y: OP X: -> <deleted> Y: OP X:

  for any operation OP.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Make the changes described above.
2023-02-02 14:46:53 +01:00
Mattias Engdegård
f6955482c2 Clean up LAP peephole logging
Make `byte-compile-log-lap` more robust and produce nicer output.
This is of interest for Elisp compiler maintainers only.

* lisp/emacs-lisp/byte-opt.el (bytecomp--log-lap-arg): New.
(byte-compile-log-lap-1): Extract argument conversion and rewrite
in a more modern way, fixing bugs.  In particular, tags are now
displayed as "X:" where X is the tag number, and that tag number
is shown as argument to goto-like ops.
(byte-optimize-lapcode): Clean up and simplify logging, producing
useful information when `byte-optimize-log` is `byte` as intended.
2023-02-02 14:43:10 +01:00
Eli Zaretskii
c6660a6d6d Improve documentation of 'repeat-mode' and related variables
* lisp/bindings.el (next-error-repeat-map)
(page-navigation-repeat-map, undo-repeat-map):
* lisp/tab-bar.el (tab-bar-switch-repeat-map)
(tab-bar-move-repeat-map):
* lisp/window.el (other-window-repeat-map)
(resize-window-repeat-map): Mention repeatable commands in the doc
strings.
* lisp/repeat.el (repeat-exit-timeout, repeat-check-key)
(repeat-echo-function, repeat-mode, repeat-check-key)
(repeat-check-map, repeat-echo-message-string)
(repeat-echo-message, repeat-echo-mode-line)
(describe-repeat-maps): Improve wording of doc strings.
(describe-repeat-maps): Improve wording of the heading line.
(Bug#61183)

* doc/emacs/basic.texi (Repeating): Clarify and improve wording of
'repeat-mode' documentation.
2023-02-02 15:34:58 +02:00
Eli Zaretskii
be304bb328 ; * etc/NEWS: Mention the 'utf-8-auto' bugfix (bug#60750). 2023-02-02 12:35:16 +02:00
Stefan Kangas
0571a3cc87 Merge from origin/emacs-29
9715715ac1 (eshell--complete-commands-list): Fix regression in fix t...
ea1bb26315 * doc/emacs/basic.texi (Repeating): Mention describe-repe...
f91bf9df89 Unbreak the MS-Windows build
2023-02-02 06:30:28 +01:00
Nicolas Martyanoff
9715715ac1 (eshell--complete-commands-list): Fix regression in fix to bug#48995
Copyright-Paperwork-Exempt: Yes

* lisp/eshell/em-cmpl.el (eshell--complete-commands-list):
Fix misuse of `completion-table-dynamic` when completing a file name.
2023-02-01 22:17:57 -05:00
Juri Linkov
c831f55b23 * lisp/progmodes/ruby-ts-mode.el: Extend treesit-sexp-type-regexp.
(ruby-ts-mode): Add more node types to treesit-sexp-type-regexp.
2023-02-01 20:14:06 +02:00
Juri Linkov
ea1bb26315 * doc/emacs/basic.texi (Repeating): Mention describe-repeat-maps (bug#61183).
* lisp/repeat.el (describe-repeat-maps): Add more explanation to
the docstring.  Suggested by Robert Pluim <rpluim@gmail.com>.
2023-02-01 20:05:52 +02:00
Michael Albinus
8c6a463931 Handle large process output strings for Tramp
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Improve handling of connection-type `pipe'.

* test/lisp/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process): Extend tests.
2023-02-01 18:40:11 +01:00
Eli Zaretskii
f91bf9df89 Unbreak the MS-Windows build
* src/treesit.c (ts_query_pattern_count) [WINDOWSNT]: Load from
the library and define as macro.
2023-02-01 14:13:54 +02:00
Stefan Kangas
0214e9021b ; Merge from origin/emacs-29
The following commit was skipped:

f7fcc62b78 ; Auto-commit of loaddefs files.
2023-02-01 06:30:39 +01:00
Stefan Kangas
cfde8a1490 Merge from origin/emacs-29
66aa9cb450 ; (Ftreesit_query_capture): Fix typo
f711f4e99f (Ftreesit_query_capture): Cache list of predicates for gi...
47ab9ba55d * lisp/keymap.el (keymap-global-unset): Correct prompt
49b6140558 Fix cursor-in-echo-area on TTY frames
2023-02-01 06:30:39 +01:00
Stefan Kangas
f724fca732 ; Auto-commit of loaddefs files. 2023-02-01 05:08:57 +01:00
Stefan Kangas
f7fcc62b78 ; Auto-commit of loaddefs files. 2023-02-01 05:08:25 +01:00
Dmitry Gutov
66aa9cb450 ; (Ftreesit_query_capture): Fix typo 2023-02-01 03:53:38 +02:00
Dmitry Gutov
f711f4e99f (Ftreesit_query_capture): Cache list of predicates for given pattern index
* src/treesit.c (Ftreesit_query_capture):
Cache list of predicates for given pattern index (bug#60953).
2023-02-01 03:45:55 +02:00
Robert Pluim
47ab9ba55d * lisp/keymap.el (keymap-global-unset): Correct prompt 2023-01-31 18:18:50 +01:00
Eli Zaretskii
49b6140558 Fix cursor-in-echo-area on TTY frames
* src/dispnew.c (update_frame_1): Fix off-by-one error when
positioning the cursor in the echo-area.  (Bug#61184)
2023-01-31 18:03:28 +02:00
Stefan Kangas
a73b046c7d Merge from origin/emacs-29
1684e254a3 Update to Transient v0.3.7-196-gb91f509
327941b211 CC Mode: Fix a coding bug in c-make-keywords-re.  This sh...
2f3683cd4d * lisp/isearch.el (isearch-emoji-by-name): Disable derive...
86b03046c0 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
e866490a07 Fix keymap inheritance in descendants of 'c-ts-base-mode'
f67a9a12b7 Fix interactive use of `keymap-local-set' and `keymap-glo...
2023-01-31 06:30:26 +01:00
Jim Porter
e7d0aa248e During completion, convert all Eshell arguments to strings
Eshell was already converting some types (numbers, nil) to strings, as
well as fixing up multiple-dot forms like ".../", so this way is more
consistent and should produce fewer problems for Pcomplete functions.

* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments): Always
convert parsed arguments to strings.

* test/lisp/eshell/em-cmpl-tests.el (eshell-arguments-equal,
eshell-arguments-equal--equal-explainer): New functions.
(em-cmpl-test/parse-arguments/pipeline)
(em-cmpl-test/parse-arguments/multiple-dots)
(em-cmpl-test/parse-arguments/variable/numeric)
(em-cmpl-test/parse-arguments/variable/nil)
(em-cmpl-test/parse-arguments/variable/list)
(em-cmpl-test/parse-arguments/variable/splice): Use
'eshell-arguments-equal'.
2023-01-30 17:49:11 -08:00
Jim Porter
cc5a2ed457 Properly parse Eshell variable splices for interactive completion
Previously, the code simply ignored the splice operator, which usually
worked, but isn't actually correct.

* lisp/eshell/em-cmpl.el (eshell-complete-eval-argument-form): New
function.
(eshell-complete-parse-arguments): Properly parse variable splices.

* test/lisp/eshell/em-cmpl-tests.el
(em-cmpl-test/parse-arguments/variable/splice): New test.
2023-01-30 17:49:11 -08:00
Jim Porter
79154f625c Add regression tests for Eshell completions
* lisp/eshell/esh-cmd.el (eshell-complete-lisp-symbols): Fix
docstring.

* test/lisp/eshell/em-cmpl-tests.el: New file.
2023-01-30 17:49:11 -08:00
Jonas Bernoulli
1684e254a3
Update to Transient v0.3.7-196-gb91f509 2023-01-30 22:39:38 +01:00
Alan Mackenzie
327941b211 CC Mode: Fix a coding bug in c-make-keywords-re. This should fix bug #61135
* lisp/progmodes/cc-defs.el (c-make-keywords-re): Generate "\>" components in
result regexp when argument ADORN is `appendable'.  This fully fixes a bug
which was half-fixed on 2019-01-22.
2023-01-30 20:02:36 +00:00
Eli Zaretskii
e19b91f946 Revert "Fix incremental build failures with tree-sitter"
This reverts commit 176830fe2b.
That commit isn't needed, since the problem was fixed
in another way, in the defcustom's :set function.
2023-01-30 20:25:59 +02:00
Eric Abrahamsen
cdc8f7c28e Gnus nnimap date search string must use C locale
* lisp/gnus/gnus-search.el (gnus-search-imap-handle-date): The %b
needs to be the English month name for IMAP search.
2023-01-30 09:55:40 -08:00
Juri Linkov
2f3683cd4d * lisp/isearch.el (isearch-emoji-by-name): Disable derived emoji (bug#60740).
Let-bind emoji--derived to nil to avoid the subsequent selection
of derived emoji that fails in transient.el.
2023-01-30 19:39:33 +02:00
Po Lu
c53952164f Merge from origin/emacs-29
f67a9a12b7 Fix interactive use of `keymap-local-set' and `keymap-glo...
dda4baa58b ; Fix build and startup without tree-sitter
2023-01-30 21:47:39 +08:00