1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00
Commit Graph

165121 Commits

Author SHA1 Message Date
Simon Pugnet
b39821fdce
; Fix incorrect function name in treesit manual
An example in the documentation uses the function
'treesit-get-parser-create' which does not exist.  Replace this with
'treesit-parser-create'.

* admin/notes/tree-sitter/html-manual/Multiple-Languages.html:
* doc/lispref/parsing.texi (Multiple Languages):
Change example.

Copyright-paperwork-exempt: yes
2023-02-09 21:54:00 -08:00
Jim Porter
c53255f677 Ensure that deferred commands don't make Eshell forget let-bound values
* lisp/eshell/esh-cmd.el (Command evaluation macros): Expand this
documentation to list allowed special forms and caveats for working
with 'if' and 'while'.
(eshell-do-eval): Provide more detail in docstring.  Handle
'eshell-defer' inside 'let' forms.

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/let-rebinds-after-defer): New test (bug#59469).
2023-02-09 21:38:07 -08:00
Yuan Fu
5190173696
Add 'live' property to treesit-node-check (bug#61235)
* doc/lispref/parsing.texi (Accessing Node Information): Document.
* src/treesit.c (treesit_parser_live_p): New function.
(Ftreesit_node_check): Add 'live' property.
* test/src/treesit-tests.el (treesit-node-api): Add tests.
2023-02-09 16:51:25 -08:00
Jonas Bernoulli
56960a6558
Update to Transient v0.3.7-205-gb8ad0da 2023-02-09 23:53:33 +01:00
Dmitry Gutov
d6d25a3c22 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).
2023-02-09 21:57:54 +02:00
Juri Linkov
8784b9e817 * lisp/icomplete.el (icomplete-exhibit): Check validity of the current buffer.
This function is applicable only in buffers where functions like
icomplete--field-beg can be called, and they expects either non-nil
completion-in-region--data or window-minibuffer-p (bug#61308).
2023-02-09 20:08:15 +02:00
Eli Zaretskii
68a6b364d1 Fix 'rmail-summary-output'
* lisp/mail/rmailsum.el (rmail-summary-output): Fix deletion of
messages when 'rmail-output-reset-deleted-flag' is non-nil.
(Bug#61380)
2023-02-09 17:34:19 +02:00
Nicolas Martyanoff
67c6ec2559 lisp-mode: add docstring recognition for more common lisp symbols
* lisp/emacs-lisp/lisp-mode.el (define-compiler-macro)
(define-setf-expander, deftype): Add the 'doc-string-elt'
property for proper docstring highlighting in Common Lisp.
2023-02-09 16:09:28 +02:00
Eli Zaretskii
417a8ed8b0 ; Improve discoverability of empty file names handling
* doc/lispref/files.texi (Relative File Names)
(Testing Accessibility, File Name Expansion): Document and index
the behavior with empty strings as file names.
2023-02-09 16:06:55 +02:00
Jonas Bernoulli
e47cf6ca15
Update to Transient v0.3.7-204-gecff8c2 2023-02-09 13:28:05 +01:00
Eli Zaretskii
b04cce02ff Fix Scala entry in Eglot's DB of LSP servers
* lisp/progmodes/eglot.el (eglot-server-programs): Support Scala
LSP named "metals", in addition to "metals-emacs".  (Bug#61312)
2023-02-09 12:17:18 +02:00
Stefan Kangas
1518fc5d7c Merge from origin/emacs-29
973c1d24c6 ruby-ts-mode: Also don't reindent 'identifier' when insid...
a5651c0c40 ruby-ts-mode: Fix indentation inside empty if/unless/case...
0ec0a610ed * lisp/iimage.el (iimage-mode-buffer): Handle multiple re...
d11d7aee1a ; Fix memory leak in treesit.c
2023-02-09 06:30:12 +01:00
Stefan Kangas
083f7c753c ; Merge from origin/emacs-29
The following commit was skipped:

21f3c7ef26 * lisp/edmacro.el (edit-kbd-macro): Fix thinko (bug#61333)
2023-02-09 06:30:12 +01:00
Stefan Kangas
f0a6b64e9d Merge from origin/emacs-29
31bf35935f ; Fix doc strings in iimage.el
2023-02-09 06:30:12 +01:00
Dmitry Gutov
973c1d24c6 ruby-ts-mode: Also don't reindent 'identifier' when inside ERROR
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Also don't reindent 'identifier' when inside ERROR.
2023-02-09 04:48:25 +02:00
Dmitry Gutov
a5651c0c40 ruby-ts-mode: Fix indentation inside empty if/unless/case/def
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Add new rule.

* test/lisp/progmodes/ruby-ts-mode-tests.el
(ruby-ts-indent-empty-if-else): New test.
2023-02-09 04:16:15 +02:00
Gregory Heytings
2956e54b1d Add an extensive test for labeled (locked) narrowing
* test/src/buffer-tests.el (test-labeled-narrowing): New test.
2023-02-09 02:44:57 +01:00
Gregory Heytings
79ce185ad1 Update the documentation about labeled (locked) narrowing
* src/xdisp.c (syms_of_xdisp) <fontification-functions>: Update
docstring.

* src/keyboard.c (syms_of_keyboard) <pre-command-hook>:
(syms_of_keyboard) <post-command-hook>: Update docstring.

* src/editfns.c:
(narrowing_locks): Explain why an alist is used instead of a
buffer-local variable.
(reset_outermost_narrowings): Point to recipes that demonstrate
why it is necessary to restore the user narrowing bounds when
redisplay starts.
(Fwiden): Update docstring.
(Fnarrow_to_region): Update docstring.
(Finternal__lock_narrowing): Update docstring.
(Finternal__unlock_narrowing): Update docstring.
(Fsave_restriction): Update docstring.

* src/buffer.c (syms_of_buffer)
<long-line-optimizations-region-size>: Update docstring.
(syms_of_buffer) <long-line-optimizations-bol-search-limit>:
Update docstring.

* lisp/subr.el (with-narrowing): Update docstring.
(without-narrowing): Update docstring.

* etc/NEWS: Mention the 'long-line-optimizations-region-size' and
'long-line-optimizations-bol-search-limit' options.
Announce the 'with-narrowing' and 'without-narrowing' forms.

* doc/lispref/positions.texi (Narrowing): Update the documentation
of 'narrow-to-region', 'widen' and 'save-restriction'.  Document
the 'with-narrowing' and 'without-narrowing' special forms.

* doc/lispref/display.texi (Auto Faces): Update the documentation.

* doc/lispref/commands.texi (Command Overview): Document the fact
that the buffer is narrowed around 'pre-command-hook' and
'post-command-hook' when the buffer text includes very long lines.
2023-02-09 02:44:54 +01:00
Gregory Heytings
a6cd4553d4 Rename two long line optimizations variables
* src/buffer.c (syms_of_buffer): Rename two variables.

* src/xdisp.c (get_locked_narrowing_begv):
(get_locked_narrowing_zv):
(handle_fontified_prop): Use the new names.

* src/keyboard.c (safe_run_hooks_maybe_narrowed): Use the new
names.
2023-02-09 02:44:51 +01:00
Gregory Heytings
0d73e4aa26 Add specific symbols for narrowings
* src/xdisp.c (syms_of_xdisp): Define symbol.
(handle_fontified_prop): Use it.

* src/keyboard.c (syms_of_keyboard): Define symbol.
(safe_run_hooks_maybe_narrowed): Use it.
2023-02-09 02:44:44 +01:00
Gregory Heytings
d8438e2bb4 Add 'without-narrowing' macro
* lisp/subr.el (without-narrowing): New macro, companion (and
almost identical) to 'with-narrowing'.
2023-02-09 02:44:41 +01:00
Gregory Heytings
97314447e6 Make 'narrowing-lock' and 'narrowing-unlock' internal
* src/editfns.c (Finternal__lock_narrowing): Renamed from
'narrowing-lock'.
(Finternal__unlock_narrowing): Renamed from 'narrowing-unlock'.
(unwind_narrow_to_region_locked):
(narrow_to_region_locked):
(syms_of_editfns): Use the new names.

* lisp/subr.el (internal--with-narrowing): Use the new name.
2023-02-09 02:44:36 +01:00
Gregory Heytings
a4aa32bdff Fix 'save-restriction' for narrowing locks
* src/editfns.c (narrowing_locks_save):
(narrowing_locks_restore): Make them non-static.

* src/lisp.h: Make them externally visible.

* src/bytecode.c (exec_byte_code): Save and restore narrowing
locks.

* lisp/emacs-lisp/bytecomp.el (byte-compile-save-restriction):
Increment unbinding count.

* src/comp.c (helper_save_restriction): Save and restore narrowing
locks.
2023-02-09 02:44:32 +01:00
LensPlaysGames
0ec0a610ed * lisp/iimage.el (iimage-mode-buffer): Handle multiple regexps.
Go to the beginning of the buffer before searching every regexp in
iimage-mode-image-regex-alist.

Copyright-paperwork-exempt: yes
2023-02-08 20:56:48 +02:00
Eli Zaretskii
d11d7aee1a ; Fix memory leak in treesit.c
* src/treesit.c (treesit_load_language): Fix a memory leak.
Reported by Eric Gillespie <epg@pretzelnet.org>.
2023-02-08 18:40:50 +02:00
Stefan Monnier
21f3c7ef26 * lisp/edmacro.el (edit-kbd-macro): Fix thinko (bug#61333)
Backported from commit 2273cdb40e.
2023-02-08 09:09:25 -05:00
Eli Zaretskii
31bf35935f ; Fix doc strings in iimage.el
* lisp/iimage.el (iimage-mode-image-regex-alist)
(iimage-modification-hook): Doc fixes.
2023-02-08 14:56:42 +02:00
Mattias Engdegård
680bc20553 Flatten nested concat calls
* lisp/emacs-lisp/byte-opt.el (byte-optimize-concat):
Flatten nested forms; concat is associative.  This reduces the number
of calls and may coalesce adjacent constant strings.
2023-02-08 13:45:57 +01:00
Mattias Engdegård
f3fce3a71c Simplify and speed up parts of elisp optimiser
* lisp/emacs-lisp/byte-opt.el (byte-optimize-constant-args): Simplify.
(byte-optimize--constant-symbol-p): Speed up.
(byteopt--eval-const): New.
(byte-optimize-member, byte-optimize-concat, byte-optimize-append):
Use byteopt--eval-const instead of eval which is much slower.
2023-02-08 13:18:32 +01:00
Juri Linkov
643a11c6e5 * lisp/progmodes/xref.el (xref--insert-xrefs): Remove extra space (bug#61340). 2023-02-08 09:34:49 +02:00
Stefan Kangas
d492be400e Merge from origin/emacs-29
c9ba05af8d Fix crashes inside 'xfree' called from treesit.c
746748f5c2 Make java-ts-mode use the c-ts-common-indent-type-regexp-...
87d39a30b1 Fix c-ts-mode indentation
7cb92b5398 Fix c-ts-mode indentation
d68ff6016d Fix c-ts-mode indentation (bug#61291)
2ac8c4bbd6 (eglot-completion-at-point): Return correct values in :co...
321cbd9a60 Tighten and simplify typescript compilation-mode regexps ...
97533e73ad ; * lisp/progmodes/c-ts-common.el (treesit-node-prev-sibl...
9dfccb89fc Clarify bug-reference-auto-setup-functions docstring.
17ab426670 * lisp/treesit.el (treesit): Fix shortdoc example form (b...
5a6dfab1e4 Use c-ts-common-statement-offset in java-ts-mode (bug#61142)
c3262216ab Add array_initializer to java-ts-mode
79ab62e0bb go-ts-mode: Highlight variable declarations
1fab91d852 go-ts-mode: Fix highlighting of function name in call_exp...
07ffe902c6 c-ts-mode: Highlight "property functions" as functions
a529b0d646 rust-ts-mode: Fix highlighting of function name in call_e...
088425538f rust-ts-mode--font-lock-settings: Improve consistency
793c24a6ac Make sure 'M-x show-paren-local-mode' turns on right away
60089dcfe0 Add to bug-reference-auto-setup-functions after its decla...
26e947ccb1 * lisp/vc/vc.el (vc-find-revision-no-save): Fix parens (b...
948e343496 ; Fix byte-compilation warning
6568a1aaf9 Fix inability to turn show-paren-local-mode on manually (...
24085ba610 ; go-ts-mode--indent-rules: Indent to 0 at top level
0862a79fef Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
bb999df5d6 ; Fix whitespace of last change
929daafa1d ; Fix trivial mistake in emoji--choose-emoji
d7b4a8487f ; * lisp/isearch.el (emoji--read-emoji): Avoid compilatio...
e38ff00463 rust-ts-mode: Highlight variable declarations
d12727057d rust-ts-mode--indent-rules: Indent to 0 at top level
85705a7059 ; Move misplaces parenthesis in emoji--choose-emoji
18c43bb9d6 Ensure upper bound of font-lock region is less than point...
94f291d150 ; * lisp/paren.el (show-paren-predicate): Doc fix.  (Bug#...
3ffd0eddce Highlight more complex function parameters
58dc03ba7e No longer use transient in isearch-emoji-by-name
0c125fcc67 Make highlighting more regular across TS modes (bug#61205)
1dd751c3ac ; Improve documentation of 'proper-list-p'
96181ed3f0 Document 'plistp'
03d9d18513 Fix display of raised/lowered composed text
f13479d955 Fix installation of tree-sitter grammar on MS-Windows
0358267204 Update the Emacs FAQ for Emacs 29
2c33e2889b Fix byte-compilation of *-ts-mode.el files
b40a929a3f ; ruby-ts--syntax-propertize: Amend commentary
b80f36b88c Make c-ts-mode-set-style's effect local (bug#61245)
671e5d9fad ; * lisp/treesit.el (treesit--font-lock-level-setter): Mi...
69380a88e9 c-ts-mode: Highlight name in parameter declarations
89b550eac2 Fix switch statement indentation for go-ts-mode (bug#61238)
1a123feb18 Fix bidi reordering of sequence of whitespace characters ...
8870b54db9 Add tests for compilation support for TypeScript (bug#61104)
873a0a1508 Add support for TypeScript compilation to compile.el (bug...
3a64f81ebc Don't clobber match data in 'y-or-n-p'
4c765d93ab Refine the previous change
d99b5151f8 Add syntax-propertize-function to ruby-ts-mode
f25c15ceb7 ; Fix typos
35e238cae8 Improve documentation of 'header-line-indent-mode'
c3f58a6651 Don't casemap erc-sasl-user when set to :nick
e444115d02 Improve keymap-global-set and keymap-local-set interactiv...

# Conflicts:
#	etc/NEWS
2023-02-08 06:30:15 +01:00
Stefan Monnier
2273cdb40e * lisp/edmacro.el (edit-kbd-macro): Fix thinko (bug#61333) 2023-02-07 18:10:33 -05:00
Stefan Monnier
88d5327fe2 (cconv-convert): Fix regression
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form):
Since we can't always remove the wrapper, make sure the wrapper
accepts the expected calling convention (i.e. called with no args).
2023-02-07 18:03:22 -05:00
Eli Zaretskii
c9ba05af8d Fix crashes inside 'xfree' called from treesit.c
* src/treesit.c (treesit_load_language): Always xstrdup 'c_name',
to avoid crashes inside xfree.  (Bug#61351)
2023-02-07 21:53:05 +02:00
Mattias Engdegård
a98d0daac4 Remove unnecessary cons in lexical eval
* src/eval.c (list_of_t): New.
(Feval): Use list_of_t instead of consing every time.
(syms_of_eval): Set list_of_t to (t) and staticpro it.
2023-02-07 19:38:00 +01:00
Michael Albinus
22f0159c5a Fix last Tramp commit
* lisp/net/tramp.el (tramp-completion-file-name-handler): Run only
when `minibuffer-completing-file-name' is non-nil.

* test/lisp/net/tramp-tests.el (tramp-test26-file-name-completion):
Fix test.
2023-02-07 19:28:15 +01:00
Yuan Fu
746748f5c2
Make java-ts-mode use the c-ts-common-indent-type-regexp-alist
* lisp/progmodes/java-ts-mode.el:
(java-ts-mode): Setup c-ts-common-indent-type-regexp-alist.
2023-02-06 18:48:04 -08:00
Yuan Fu
87d39a30b1
Fix c-ts-mode indentation
Sign, ok, there's another edge case: else if statements.  Because
"else if" is usually implemented as just another if statement nested
in the else branch, this creates additional levels that indentation
needs to ignore.

I converted c-ts-common-indent-block-type-regexp +
c-ts-common-indent-bracketless-type-regexp into a new, more flexible
variable, c-ts-common-indent-type-regexp-alist, to avoid adding yet
more variables in order to recognize else and if statements.

* lisp/progmodes/c-ts-common.el:
(c-ts-common-indent-type-regexp-alist): New variable.
(c-ts-common-indent-block-type-regexp)
(c-ts-common-indent-bracketless-type-regexp): Remove variables.
(c-ts-common--node-is): New function.
(c-ts-common-statement-offset): Use the new variable, and add the
"else if" special case.  Also merge the code of
c-ts-mode--fix-bracketless-indent, because now the code is much more
succinct.
(c-ts-mode--fix-bracketless-indent): Merge into
c-ts-common-statement-offset.

* lisp/progmodes/c-ts-mode.el:
(c-ts-base-mode): Setup c-ts-common-indent-type-regexp-alist.

* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
2023-02-06 18:29:38 -08:00
Yuan Fu
7cb92b5398
Fix c-ts-mode indentation
Turns out I shouldn't have removed the explicit rules.  Anyway, now it
indents properly.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add rules.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add tests
2023-02-06 18:28:40 -08:00
Yuan Fu
d68ff6016d
Fix c-ts-mode indentation (bug#61291)
Fix indentation for the semicolon in

while (str_a[i++] == str_b[j++])
  ;

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
2023-02-06 18:28:39 -08:00
Dmitry Gutov
2ac8c4bbd6 (eglot-completion-at-point): Return correct values in :company-kind
* lisp/progmodes/eglot.el (eglot-completion-at-point): Return the
correct values in :company-kind for "EnumMember" and "TypeParameter".
The convention is to use kebab case rather than plain downcasing.
Reported in https://github.com/company-mode/company-mode/issues/1370.
2023-02-07 00:28:25 +02:00
Michael Albinus
907fd1f7ff Improve Tramp file name completion
This fixes Bug#51386, Bug#52758, Bug#53513, Bug#54042 and Bug#60505.

* doc/misc/tramp.texi (File name completion): Remove completion
styles restrictions.

* lisp/minibuffer.el (completion-styles): Fix docstring.

* lisp/net/tramp.el (tramp-methods) <->: Add.
(tramp-completion-file-name-handler-alist):
Add `expand-file-name', `file-exists-p', `file-name-directory' and
`file-name-nondirectory'.
(tramp-dissect-file-name): Do not extra check for
`tramp-default-method-marker'.
(tramp-completion-handle-expand-file-name)
(tramp-completion-handle-file-exists-p)
(tramp-completion-handle-file-name-directory)
(tramp-completion-handle-file-name-nondirectory): New defuns.
(tramp-completion-handle-file-name-all-completions): Remove duplicates.

* test/lisp/net/tramp-tests.el
(tramp-test26-interactive-file-name-completion): New test.
2023-02-06 18:13:22 +01:00
Mattias Engdegård
321cbd9a60 Tighten and simplify typescript compilation-mode regexps (bug#61104)
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Tighten regexps and simplify.  Translate to rx.
* etc/compilation.txt: Add examples.

In collaboration with Jostein Kjønigsen.
2023-02-06 17:47:00 +01:00
Eli Zaretskii
97533e73ad ; * lisp/progmodes/c-ts-common.el (treesit-node-prev-sibling): Declare. 2023-02-06 18:34:39 +02:00
Eli Zaretskii
7f8f19da24 Fix 'hack-local-variables' when EOL conversion is inhibited
* lisp/files.el (hack-local-variables--find-variables): Replace
CRs with newlines only if the original buffer is under explicit
selective-display.  (Bug#61321)
2023-02-06 18:28:21 +02:00
Tassilo Horn
9dfccb89fc Clarify bug-reference-auto-setup-functions docstring.
* lisp/progmodes/bug-reference.el (bug-reference-auto-setup-functions):
Add clarification to docstring that this variable is for packages, not
for users.
2023-02-06 17:09:40 +01:00
Aleksandr Vityazev
17ab426670 * lisp/treesit.el (treesit): Fix shortdoc example form (bug#61318). 2023-02-06 16:37:32 +02:00
Theodor Thornhill
5a6dfab1e4 Use c-ts-common-statement-offset in java-ts-mode (bug#61142)
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Add new
matchers to enable c-ts-common machinery.
(java-ts-mode): Add regexps.
* lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset): Fix
typo in documentation and use the new if statement helpers.
(c-ts-common-if-statement-regexp): New defvar.
(c-ts-common-nestable-if-statement-p): New defvar.
(c-ts-common--fix-nestable-if-statement): New helper.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add test for
complicated bracket matching indentation.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add indent
rules for bracketless statements.
2023-02-06 07:43:37 +01:00
Theodor Thornhill
c3262216ab Add array_initializer to java-ts-mode
Indent strings inside arrray_initializer one step:

public class Java {
    void foo() {
        return new String[]{
            "foo", // These
            "bar"
        }
    }
}

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New
matcher.
2023-02-06 07:43:37 +01:00
Dmitry Gutov
79ab62e0bb go-ts-mode: Highlight variable declarations
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Highlight variable declarations in 'definition' feature.
2023-02-06 04:42:12 +02:00