1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00
Commit Graph

164460 Commits

Author SHA1 Message Date
Eli Zaretskii
dda4baa58b ; Fix build and startup without tree-sitter
* lisp/treesit.el (treesit--font-lock-level-setter): Don't loop
over all the buffers if tree-sitter is not built-in, or else
initialization of defcustom will fail.  (Bug#61155)
* lisp/progmodes/rust-ts-mode.el (treesit-node-parent):
* lisp/progmodes/c-ts-common.el (treesit-node-parent): Declare, to
* avoid byte-compilation warnings.
2023-01-30 14:22:19 +02:00
Michael Albinus
99e40959f4 Fix password prompt in Tramp (do not merge)
* lisp/net/tramp.el (tramp-password-prompt-regexp):
Allow alternative trailing colons.  (Bug#61168)
2023-01-30 11:43:04 +01:00
Kyle Meyer
8360e12f0e Update to Org 9.6.1-23-gc45a05 2023-01-29 21:42:17 -05:00
Eli Zaretskii
9058601308 ; * doc/emacs/misc.texi (Document View): Remove @footnote (bug#61152). 2023-01-29 19:00:59 +02:00
Eli Zaretskii
197f994384 Document tree-sitter features in the user manual
* lisp/progmodes/c-ts-mode.el (c-ts-mode-map): Bind "C-c .", for
consistency with CC mode.
* lisp/treesit.el (treesit-font-lock-level): Doc fix.

* doc/emacs/programs.texi (C Indent, Custom C Indent): Document
the indentation features of 'c-ts-mode'.
(Moving by Defuns): Document 'treesit-defun-tactic'.
* doc/emacs/files.texi (Visiting): Document
'treesit-max-buffer-size'.
* doc/emacs/display.texi (Traditional Font Lock)
(Parser-based Font Lock): New subsections.
* doc/emacs/emacs.texi (Top): Update top-level menu.
2023-01-29 15:22:20 +02:00
Yuan Fu
b73539832d
; Remove treesit--font-lock-fast-mode-grace-count
* lisp/treesit.el:
(treesit--font-lock-fast-mode-grace-count): Remove. Should've been
removed in the last change.
2023-01-29 00:30:53 -08:00
Randy Taylor
64fee21d5f
Fix dockerfile-ts-mode line continuation indentation (bug#61131)
Without this rule, line continuations are only indented after entering
the contents for the line and hitting TAB or RET.

For example:
```
EXPOSE 1 \
```

After hitting RET to go to the next line, point would end up at BOL
instead of lining up with the previous entry, like so:
```
EXPOSE 1 \
2
```

The new rule will indent it as so:
```
EXPOSE 1 \
       2
```

* lisp/progmodes/dockerfile-ts-mode.el:
(dockerfile-ts-mode--indent-rules): New rule.
(dockerfile-ts-mode--line-continuation-p)
(dockerfile-ts-mode--line-continuation-anchor): New functions.
2023-01-29 00:28:48 -08:00
Yuan Fu
1970726e26
Use treesit-subtree-stat to determine treesit--font-lock-fast-mode
* lisp/treesit.el:
(treesit--children-covering-range-recurse): Return nil if LIMIT is
exceeded.
(treesit--font-lock-fast-mode): Change to a ternary value.
(treesit-font-lock-fontify-region): Enable fast mode based on the
result of treesit-subtree-stat.
2023-01-29 00:12:57 -08:00
Yuan Fu
382e018856
Add treesit-subtree-stat
* src/treesit.c (Ftreesit_subtree_stat): New function.
* lisp/treesit.el (treesit): Add to shortdoc.
2023-01-29 00:12:57 -08:00
Yuan Fu
a3003492ac
Move c-ts-mode--statement-offset to c-ts-common.el
Now it can be used by other C-like languages.

* lisp/progmodes/c-ts-common.el (c-ts-common-indent-offset):
(c-ts-common-indent-block-type-regexp):
(c-ts-common-indent-bracketless-type-regexp): New variables.
(c-ts-common-statement-offset):
(c-ts-mode--fix-bracketless-indent):
(c-ts-mode--close-bracket-offset): New functions.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Change
c-ts-mode--statement-offset to c-ts-common-statement-offset.
The (parent-is "if_statement") rules are now handled by (node-is
"compound_statement").

(c-ts-mode--statement-offset-post-processr):
(c-ts-mode--statement-offset):
(c-ts-mode--fix-bracketless-indent): Move to c-ts-common.el.

(c-ts-base-mode): Setup c-ts-common stuff.

* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Make the test
more challenging.
2023-01-29 00:12:56 -08:00
Yuan Fu
4b1714571c
; Fix byte-compile warnings in c-ts-mode.el
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--get-indent-style): Move down.
(c-ts-mode-set-style): Add docstring.
2023-01-29 00:12:56 -08:00
Yuan Fu
f50cb7d7c4
; Improve docstring of c-ts-mode--indent-style-setter
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-style-setter): Improve docstring.
2023-01-29 00:12:56 -08:00
Yuan Fu
1c3ca3bb64
Fix <> syntax in rust-ts-mode
Similar to bug#60351, the angle brackets in rust-ts-mode are not
recognized as pairs when they should be.  This change copies the
function used by c++-ts-mode and adapts it to rust-ts-mode.

* lisp/progmodes/rust-ts-mode.el:
(rust-ts-mode--syntax-propertize): New function.
(rust-ts-mode): Set up syntax-propertize-function.
2023-01-29 00:12:56 -08:00
Eli Zaretskii
56e8607dc9 Fix spurious errors on Windows when deleting temporary *.eln files
* lisp/emacs-lisp/comp.el (comp--native-compile): On MS-Windows,
ignore errors when deleting a temporary .eln file.  (Bug#60996)
2023-01-29 09:44:53 +02:00
Theodor Thornhill
2bd0b94753 Fix java class member without access modifier (bug#61115)
This

```
public class T {
    @Autowired
        String a;
}
```

Should be indented as:

```
public class T {
    @Autowired
    String a;
}
````

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Add new
rule to match edge case of field_declaration indentation.
2023-01-28 19:51:08 +01:00
Theodor Thornhill
1de6ebf287 Make treesit-font-lock-level a defcustom
* lisp/treesit.el (treesit--font-lock-level-setter): Setter for the
new defcustom.
(treesit-font-lock-level): Turn it into a defcustom.
2023-01-28 19:40:04 +01:00
Theodor Thornhill
6e50ee8bbb Add c-ts-mode-set-style and :set for c-ts-mode-indent-style
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-style-setter): New
setter for the indent style defcustom.
(c-ts-mode-indent-style): Don't quote the values and refer to the
setter.
(c-ts-mode-set-style): New command to interactively set the indent
style.
(c-ts-mode--get-indent-style): New function renamed from
'c-ts-mode--set-indent-style'.
2023-01-28 19:39:23 +01:00
Juri Linkov
450db0587a Minor documentation improvements for outline-minor-mode (bug#61062)
* doc/emacs/text.texi (Outline Minor Mode, Outline Minor Mode):
Add pxrefs to "Icons" and "Outline Visibility".

* etc/NEWS: Mention outline-minor-mode for two modes.
2023-01-28 19:59:22 +02:00
Eli Zaretskii
578e892671 ; * doc/lispref/variables.texi (File Local Variables): Improve indexing. 2023-01-28 16:59:17 +02:00
Eli Zaretskii
bc5ee2b7bf ; * src/comp.c: Remove Local Variables section to avoid warnings. 2023-01-28 16:52:44 +02:00
Brian Leung
362678d90e python.el: Use correct regexp when enabling python-ts-mode
* lisp/progmodes/python.el: Use "python[0-9.]*" regexp for
'interpreter-mode-alist', and not 'auto-mode-alist'.  (Bug#61090)
2023-01-28 13:26:53 +02:00
Eli Zaretskii
76bb46db9d ; * doc/emacs/frames.texi (Mouse References): Improve indexing. 2023-01-28 09:49:53 +02:00
Dmitry Gutov
128a999bfe Make project-current not error out inside non-existent dirs
* lisp/progmodes/project.el (project-try-vc):
Use condition-case to catch 'file-missing' (bug#61107).

* test/lisp/progmodes/project-tests.el
(project-vc-nonexistent-directory-no-error): New test.
2023-01-28 03:20:29 +02:00
Eli Zaretskii
194bc97879 Improve documentation of 'shell-command-dont-erase-buffer'
* doc/emacs/misc.texi (Single Shell):
* lisp/simple.el (shell-command, shell-command-on-region):
Document that non-nil value of 'shell-command-dont-erase-buffer'
affects what is displayed in the echo area after the command.
(Bug#61100)
2023-01-27 19:01:49 +02:00
Jostein Kjønigsen
00629c0396 Fix errors in fontification of JavaScript import-statements (bug#61083)
Currently js-ts-mode handles imports with aliases incorrectly. To be
consistent with how we otherwise do things, we should only highlight
the variable which is new and/or introduced, in this case "someAlias".

Attached is a patch which fontifies import-declarations somewhat more
correctly.

The following cases have been tested and all fontify properly:

import gnu from "fsf";              // highlights gnu
import { gnu2 } from "fsf2";        // highlights gnu2
import { gnu as gnu3 } from "fsf3"; // highlights gnu3
import * as gnu4 from "fsf4";       // highlights gnu4

* lisp/progmodes/js.el (js--treesit-font-lock-settings): Add new
import_clause rules that adhere to the comment above.
2023-01-27 13:50:13 +01:00
Jostein Kjønigsen
fd145499bb Fix fontification TypeScript of import-statements (bug#61081)
Currently typescript-ts-mode and tsx-ts-mode handles imports with
aliases incorrectly.

Consider the following case:

import { someFunc as someAlias } from "module";

In this case the entire import ("someFunc as someAlias") will be
highlighted as a variable name. "as" is also highlighted as a
variable, rather than a reserved keyword.

To be consistent with how we otherwise do things, we should only
highlight the variable which is new and/or introduced, in this case
"someAlias".

Attached is a patch which fontifies import-declarations somewhat more
correctly.

The following cases have been tested and all fontify properly:

import gnu from "fsf";              // highlights gnu
import { gnu2 } from "fsf2";        // highlights gnu2
import { gnu as gnu3 } from "fsf3"; // highlights gnu3
import * as gnu4 from "fsf4";       // highlights gnu4

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Tweak import_clause rules to
adhere to the comment above.
2023-01-27 13:50:13 +01:00
Stefan Kangas
752c526585 ; Fix typos 2023-01-27 11:33:35 +01:00
Stefan Kangas
5859413df2 ; * lisp/progmodes/cc-engine.el: Delete trailing whitespace.
This was holding up the automatic merges due to commit hooks.
2023-01-27 11:25:08 +01:00
Basil L. Contovounesios
f72a394716 Work around package.el transitive dependency bug
Eglot already depends transitively on Xref 1.4.0 via Project,
but package.el doesn't pick up on this in Emacs 28
(which has Xref 1.3.0).

* lisp/progmodes/eglot.el (Version): Bump to 1.11.
(Package-Requires): Explicitly require Xref 1.4.0, which is
the version already required by Project, for the benefit of
Emacs 28 (bug#61048).
2023-01-27 00:36:55 +00:00
Philip Kaludercic
3766a666b5 ; Fix issues with processing out-of-order IRC messages
* lisp/net/rcirc.el (rcirc-print): Always move to the beginning of the
line, before setting any markers.
2023-01-26 19:41:25 +01:00
Eli Zaretskii
f8c95d1a76 Fix xt-mouse on terminals that report UTF-8 encoded coordinates
* lisp/xt-mouse.el (xterm-mouse--read-coordinate): Fix conversion
of mouse coordinates in rxvt-unicode.  Patches by Vladimir
Panteleev <git@cy.md> and Jared Finder <jared@finder.org>.
(Bug#61022)
2023-01-26 10:54:43 +02:00
Randy Taylor
4bf7cb71ed Fix go-ts-mode indentation and set indent offset to 8 (Bug#61006)
* lisp/progmodes/go-ts-mode.el (go-ts-mode-indent-offset): Change
default value to 8.
(go-ts-mode--indent-rules): Add indentation for parameters and
interfaces.
2023-01-26 10:29:07 +02:00
Eli Zaretskii
ff9498624f ; * src/insdel.c (insert_from_buffer): Fix assertions. 2023-01-26 10:23:58 +02:00
Eli Zaretskii
41f497c8be Fix doc strings of window-splitting commands
* lisp/window.el (split-window-below, split-window-right): Doc
fixes.  (Bug#60886)
2023-01-26 09:59:58 +02:00
Yuan Fu
cdf74254ff
Fix indentation for c-ts-mode (bug#61026)
Fix indentation for things like

  while (true)
    if (true)
      {
        puts ("Hello");
      }

Note that the outer while loop omits brackets.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--statement-offset-post-processr): New variable.
(c-ts-mode--statement-offset): Use the new function.
(c-ts-mode--fix-bracketless-indent): New function.
(c-ts-base-mode): Use the new function.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New tests.
2023-01-25 23:47:27 -08:00
Yuan Fu
4bd06ce2a9
Fix call to treesit_record_change in insdel.c
The start position of the change shouldn't be PT_BYTE, IIUC PT_BYTE is
actually the end position.

* src/insdel.c (insert_from_buffer): Move to here.
(insert_from_buffer_1): Remove call to treesit_record_change.
2023-01-25 23:14:35 -08:00
Randy Taylor
00675aa724
Add support for building tree-sitter modules with MinGW
* admin/notes/tree-sitter/build-module/build.sh: Add support for
building tree-sitter modules with MinGW.
2023-01-25 23:14:35 -08:00
Michael Albinus
af28191b04 * lisp/net/tramp.el (tramp-wrong-passwd-regexp): Fix regexp. 2023-01-25 20:14:12 +01:00
Juri Linkov
42e02480c2 * doc/emacs/text.texi (Outline Minor Mode): New node split from "Outline Mode"
(Outline Mode): Move all outline-minor-mode related information to the
new node "Outline Minor Mode" (bug#61062).
2023-01-25 20:19:44 +02:00
Juri Linkov
37c1c92466 ; * etc/NEWS: Minor reordering.
Move Exif section closer to Image changes, define-keymap/defvar-keymap
and lookup-key closer to Keymaps section.
2023-01-25 19:38:01 +02:00
Dmitry Gutov
cfb180329b ruby-ts-mode: Don't reindent when "class" or "def" is under "ERROR"
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Don't reindent when "class" or "def" is under "ERROR" (bug#61017).
2023-01-25 17:22:31 +02:00
Dmitry Gutov
abb3becb9f treesit-install-language-grammar: Provide default repo url
* lisp/treesit.el (treesit--check-repo-url): New function.
(treesit--install-language-grammar-build-recipe): Use it (bug#61051).
2023-01-25 17:22:31 +02:00
Basil L. Contovounesios
c6613403e5 Fix Dired face for directory symlinks
* lisp/dired.el (dired-font-lock-keywords): Fontify directory
symlinks with the value of dired-directory-face rather than its name
as a (nonexistent) face (bug#60977).
2023-01-25 14:32:42 +00:00
Basil L. Contovounesios
37454de0c8 Pacify --without-x unused function warning
* src/xfaces.c (font_maybe_unset_attribute): Move definition...
[HAVE_WINDOW_SYSTEM] (font_maybe_unset_attribute): ...to here, since
the function is used only when we HAVE_WINDOW_SYSTEM (bug#61049).
2023-01-25 14:32:42 +00:00
Michael Albinus
9a21cb1075 ; * etc/NEWS: Fix typos. 2023-01-25 15:31:33 +01:00
Robert Pluim
f30a4f51fe Announce outline.el keymaps
* etc/NEWS: Announce new keymaps.
2023-01-25 14:23:44 +01:00
Arash Esbati
8198803f66 ; Don't mention in the Gnus manual user options that were removed
* doc/misc/gnus.texi (HTML): Delete entries for custom variables
removed in commit 2c8b2fc8d5.  (Bug#61054)
2023-01-25 15:09:10 +02:00
Jostein Kjønigsen
8a1498c01f Fix fontification of function-valued variables (bug#61053)
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Remove overrides and reorder
the variable_declarator rule.
2023-01-25 13:04:49 +01:00
Theodor Thornhill
cfe26f3189 Add new java indent rules
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Check
for enum_body_declarations and switch_label.
2023-01-25 13:04:49 +01:00
F. Jason Park
987e53f3e2 ; * doc/misc/erc.texi: Improve Local Modules section. 2023-01-24 20:19:28 -08:00