]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoDocument 'plistp'
Eli Zaretskii [Sun, 5 Feb 2023 12:09:35 +0000 (14:09 +0200)]
Document 'plistp'

* doc/lispref/lists.texi (Property Lists): Document 'plistp'.
(Bug#61293)

2 years agoFix display of raised/lowered composed text
Eli Zaretskii [Sun, 5 Feb 2023 11:57:10 +0000 (13:57 +0200)]
Fix display of raised/lowered composed text

* src/xdisp.c (fill_gstring_glyph_string): Adjust the base line of
the glyph string due to subscript/superscript.  (Bug#61290)

2 years agoFix installation of tree-sitter grammar on MS-Windows
Eli Zaretskii [Sun, 5 Feb 2023 09:14:25 +0000 (11:14 +0200)]
Fix installation of tree-sitter grammar on MS-Windows

* lisp/treesit.el (treesit--install-language-grammar-1): Fix a
failure on MS-Windows when the old DLL is still being used.
(Bug#61289)

2 years agoUpdate the Emacs FAQ for Emacs 29
Eli Zaretskii [Sun, 5 Feb 2023 08:50:12 +0000 (10:50 +0200)]
Update the Emacs FAQ for Emacs 29

* doc/misc/efaq.texi (New in Emacs 29, History of Emacs): Add new
section about Emacs 29.

2 years agoFix byte-compilation of *-ts-mode.el files
Eli Zaretskii [Sun, 5 Feb 2023 06:24:32 +0000 (08:24 +0200)]
Fix byte-compilation of *-ts-mode.el files

* lisp/treesit.el (treesit-font-lock-settings): Move to before
use, to prevent failure in byte-compiling modes which require this
file.  (Bug#61282)

2 years ago; ruby-ts--syntax-propertize: Amend commentary
Dmitry Gutov [Sun, 5 Feb 2023 00:42:52 +0000 (02:42 +0200)]
; ruby-ts--syntax-propertize: Amend commentary

2 years agoMake c-ts-mode-set-style's effect local (bug#61245)
Yuan Fu [Sat, 4 Feb 2023 02:35:33 +0000 (18:35 -0800)]
Make c-ts-mode-set-style's effect local (bug#61245)

Now c-ts-mode-set-style's effect is local, and there is a new function
c-ts-mode-set-global-style that changes the global setting.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-style-setter): Use c-ts-mode-set-style.
(c-ts-mode-indent-style)
(c-ts-mode--prompt-for-style): Minor change in docstring.
(c-ts-mode-set-global-style): New function (from c-ts-mode-set-style).
(c-ts-mode-set-local-style): Remove function (became c-ts-mode-set-style).
(c-ts-mode-set-style): Renamed from c-ts-mode-set-local-style.
* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts:
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Use
c-ts-mode-set-style.

2 years ago; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change.
Yuan Fu [Fri, 3 Feb 2023 02:54:49 +0000 (18:54 -0800)]
; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change.

2 years agoc-ts-mode: Highlight name in parameter declarations
Dmitry Gutov [Sat, 4 Feb 2023 20:46:41 +0000 (22:46 +0200)]
c-ts-mode: Highlight name in parameter declarations

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Uncomment parameter declaration highlighting (bug#61275).
(c-ts-mode--fontify-declarator): Check that identifier was found.
Some declarations can miss identifier name.

2 years agoFix switch statement indentation for go-ts-mode (bug#61238)
Davide Masserut [Thu, 2 Feb 2023 20:00:02 +0000 (21:00 +0100)]
Fix switch statement indentation for go-ts-mode (bug#61238)

* lisp/progmodes/go-ts-mode.el (go-ts-mode--indent-rules): Add
indentation for type switch and select case blocks
* test/lisp/progmodes/go-ts-mode-resources/indent.erts: New .erts file
to test indentation of Go constructs and prevent regression of bug
fixes.
* test/lisp/progmodes/go-ts-mode-tests.el: New file with go-ts-mode
tests.

2 years agoFix bidi reordering of sequence of whitespace characters before a TAB
Eli Zaretskii [Sat, 4 Feb 2023 11:34:42 +0000 (13:34 +0200)]
Fix bidi reordering of sequence of whitespace characters before a TAB

* src/bidi.c (bidi_level_of_next_char): Test the current level
only for characters whose original type is BN.  (Bug#61269)

2 years agoAdd tests for compilation support for TypeScript (bug#61104)
Theodor Thornhill [Fri, 3 Feb 2023 08:05:13 +0000 (09:05 +0100)]
Add tests for compilation support for TypeScript (bug#61104)

* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): Add new test-cases.
(compile-test-error-regexps): Increase expected errors

2 years agoAdd support for TypeScript compilation to compile.el (bug#61104)
Jostein Kjønigsen [Sat, 28 Jan 2023 14:23:11 +0000 (15:23 +0100)]
Add support for TypeScript compilation to compile.el (bug#61104)

* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Add regexps.

2 years agoDon't clobber match data in 'y-or-n-p'
Eli Zaretskii [Sat, 4 Feb 2023 08:15:18 +0000 (10:15 +0200)]
Don't clobber match data in 'y-or-n-p'

* lisp/subr.el (y-or-n-p): Avoid clobbering caller's match data.
(Bug#61091)

2 years agoRefine the previous change
Dmitry Gutov [Sat, 4 Feb 2023 02:16:55 +0000 (04:16 +0200)]
Refine the previous change

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Fix a typo.
(ruby-ts--syntax-propertize): Use pcase-exhaustive to avoid typos.
Put the last s-t property after heredoc's end (apparently
parse-partial-sexp likes that more).  Move first s-t property on
percent literals to the very beginning (to be refined later).
Differentiate the %r{} literals from /.../ ones -- tree-sitter
parses them exactly the same.

2 years agoAdd syntax-propertize-function to ruby-ts-mode
Dmitry Gutov [Sat, 4 Feb 2023 01:34:22 +0000 (03:34 +0200)]
Add syntax-propertize-function to ruby-ts-mode

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query):
New variable.
(ruby-ts--syntax-propertize): New function.
(ruby-ts--parser-after-change): New function.
(ruby-ts-mode): Use both of them.

2 years ago; Fix typos
Stefan Kangas [Fri, 3 Feb 2023 17:02:53 +0000 (18:02 +0100)]
; Fix typos

2 years agoImprove documentation of 'header-line-indent-mode'
Eli Zaretskii [Fri, 3 Feb 2023 14:45:56 +0000 (16:45 +0200)]
Improve documentation of 'header-line-indent-mode'

* doc/lispref/modes.texi (Header Lines): Rewrite the documentation
of 'header-line-indent-mode' and its two variables.  Fix the
example.
* doc/lispref/display.texi (Pixel Specification): More accurate
description of what happens with :align-to in header-lines.
Improve indexing.  (Bug#61239)

* src/buffer.c (syms_of_buffer) <header-line-format>:
* lisp/display-line-numbers.el (header-line-indent)
(header-line-indent-width, header-line-indent-mode): Doc fixes.

* etc/NEWS: Enhance the announcement of 'header-line-indent-mode'.

2 years agoDon't casemap erc-sasl-user when set to :nick
F. Jason Park [Fri, 3 Feb 2023 14:01:04 +0000 (06:01 -0800)]
Don't casemap erc-sasl-user when set to :nick

* lisp/erc/erc-sasl.el (erc-sasl-user): Fix doc string.
(erc-sasl--get-user): Don't apply casemapping when the option
`erc-sasl-user' is set to `:nick'.  While many servers and
auth-services providers perform case-folding when comparing SASL
usernames, only some recognize RFC1459 mappings, which ERC previously
applied blindly.  Instead, ERC now behaves like other clients in
leaving such preparation in the hands of the server.  This bug was
introduced with changes new to ERC 5.5 and Emacs 29 (bug#29108).

2 years agoImprove keymap-global-set and keymap-local-set interactive use fix
Robert Pluim [Thu, 2 Feb 2023 10:37:45 +0000 (11:37 +0100)]
Improve keymap-global-set and keymap-local-set interactive use fix

* lisp/keymap.el (keymap-global-set, keymap-local-set): Add optional
`interactive' arg and use it to decide when to convert the key
specification to a string.  Add `advertised-calling-convention'
declarations.  (Bug#61149)

2 years ago; Fix c-ts-mode indent test
Yuan Fu [Fri, 3 Feb 2023 02:30:11 +0000 (18:30 -0800)]
; Fix c-ts-mode indent test

* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Move the linux
style test case down.

2 years agoMake c-ts-mode indent tests side-effect-free
Yuan Fu [Fri, 3 Feb 2023 02:23:21 +0000 (18:23 -0800)]
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.

2 years agoCall treesit_record_change in insert_from_gap_1
Yuan Fu [Fri, 3 Feb 2023 01:22:22 +0000 (17:22 -0800)]
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.

2 years agoUse c-ts-common-statement-offset for closing brackets too
Yuan Fu [Thu, 2 Feb 2023 22:57:41 +0000 (14:57 -0800)]
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.

2 years ago; Go back to original point when filling comments in c-ts-mode
Yuan Fu [Thu, 2 Feb 2023 22:48:22 +0000 (14:48 -0800)]
; 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.

2 years ago; Fix error where we pass t to treesit-node-type in c-ts-common.el
Yuan Fu [Thu, 2 Feb 2023 22:42:42 +0000 (14:42 -0800)]
; 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.

2 years ago; * src/treesit.c (treesit_predicate_match): Simplify last change.
Eli Zaretskii [Thu, 2 Feb 2023 19:54:15 +0000 (21:54 +0200)]
; * src/treesit.c (treesit_predicate_match): Simplify last change.

2 years agoMinor improvements in sqlite.c
Eli Zaretskii [Thu, 2 Feb 2023 19:45:44 +0000 (21:45 +0200)]
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)

2 years ago(treesit_predicate_match): Match node text against regexp without consing
Dmitry Gutov [Thu, 2 Feb 2023 11:32:41 +0000 (13:32 +0200)]
(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.

2 years agoImprove documentation of gdb-mi's dedicated windows
Eli Zaretskii [Thu, 2 Feb 2023 18:49:15 +0000 (20:49 +0200)]
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.

2 years agoAvoid spurious pause in kill-ring-save (Bug#60841)
Kévin Le Gouguec [Sun, 29 Jan 2023 10:23:01 +0000 (11:23 +0100)]
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.

2 years agoChange the default of 'treesit-defun-tactic' for 'c-ts-mode'
Eli Zaretskii [Thu, 2 Feb 2023 18:21:02 +0000 (20:21 +0200)]
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)

2 years agoFix docstring fontification of CL's 'defstruct'
Eli Zaretskii [Thu, 2 Feb 2023 18:12:02 +0000 (20:12 +0200)]
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

2 years agoTeach 'hs-minor-mode' about tree-sitter based modes
Eli Zaretskii [Thu, 2 Feb 2023 17:41:09 +0000 (19:41 +0200)]
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)

2 years ago; Doc fixes in keymap.el
Eli Zaretskii [Thu, 2 Feb 2023 14:14:15 +0000 (16:14 +0200)]
; Doc fixes in keymap.el

* lisp/keymap.el (key-valid-p, key-translate, keymap-lookup)
(define-keymap): Doc fixes.

2 years agoImprove documentation of 'repeat-mode' and related variables
Eli Zaretskii [Thu, 2 Feb 2023 13:34:58 +0000 (15:34 +0200)]
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.

2 years ago; * etc/NEWS: Mention the 'utf-8-auto' bugfix (bug#60750).
Eli Zaretskii [Thu, 2 Feb 2023 10:35:16 +0000 (12:35 +0200)]
; * etc/NEWS: Mention the 'utf-8-auto' bugfix (bug#60750).

2 years ago(eshell--complete-commands-list): Fix regression in fix to bug#48995
Nicolas Martyanoff [Thu, 2 Feb 2023 03:17:57 +0000 (22:17 -0500)]
(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.

2 years ago* doc/emacs/basic.texi (Repeating): Mention describe-repeat-maps (bug#61183).
Juri Linkov [Wed, 1 Feb 2023 18:05:52 +0000 (20:05 +0200)]
* 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>.

2 years agoUnbreak the MS-Windows build
Eli Zaretskii [Wed, 1 Feb 2023 12:13:54 +0000 (14:13 +0200)]
Unbreak the MS-Windows build

* src/treesit.c (ts_query_pattern_count) [WINDOWSNT]: Load from
the library and define as macro.

2 years ago; Auto-commit of loaddefs files.
Stefan Kangas [Wed, 1 Feb 2023 04:08:25 +0000 (05:08 +0100)]
; Auto-commit of loaddefs files.

2 years ago; (Ftreesit_query_capture): Fix typo
Dmitry Gutov [Wed, 1 Feb 2023 01:53:38 +0000 (03:53 +0200)]
; (Ftreesit_query_capture): Fix typo

2 years ago(Ftreesit_query_capture): Cache list of predicates for given pattern index
Dmitry Gutov [Wed, 1 Feb 2023 01:45:55 +0000 (03:45 +0200)]
(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).

2 years ago* lisp/keymap.el (keymap-global-unset): Correct prompt
Robert Pluim [Tue, 31 Jan 2023 17:17:41 +0000 (18:17 +0100)]
* lisp/keymap.el (keymap-global-unset): Correct prompt

2 years agoFix cursor-in-echo-area on TTY frames
Eli Zaretskii [Tue, 31 Jan 2023 16:03:28 +0000 (18:03 +0200)]
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)

2 years agoUpdate to Transient v0.3.7-196-gb91f509
Jonas Bernoulli [Mon, 30 Jan 2023 21:39:38 +0000 (22:39 +0100)]
Update to Transient v0.3.7-196-gb91f509

2 years agoCC Mode: Fix a coding bug in c-make-keywords-re. This should fix bug #61135
Alan Mackenzie [Mon, 30 Jan 2023 20:02:36 +0000 (20:02 +0000)]
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.

2 years ago* lisp/isearch.el (isearch-emoji-by-name): Disable derived emoji (bug#60740).
Juri Linkov [Mon, 30 Jan 2023 17:39:33 +0000 (19:39 +0200)]
* 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.

2 years agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Mon, 30 Jan 2023 13:45:54 +0000 (15:45 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

2 years agoFix keymap inheritance in descendants of 'c-ts-base-mode'
Eli Zaretskii [Mon, 30 Jan 2023 13:42:06 +0000 (15:42 +0200)]
Fix keymap inheritance in descendants of 'c-ts-base-mode'

* lisp/progmodes/c-ts-mode.el (c-ts-base-mode-map): Rename from
'c-ts-mode-map'.
(c-ts-base-mode): Adjust accordingly.  (Bug#60983)

2 years agoFix interactive use of `keymap-local-set' and `keymap-global-set'
Robert Pluim [Mon, 30 Jan 2023 09:51:30 +0000 (10:51 +0100)]
Fix interactive use of `keymap-local-set' and `keymap-global-set'

* lisp/keymap.el (keymap-global-set, keymap-local-set): Convert the
read key sequence to a string when called interactively.  Based on a
patch from Stephen Berman <stephen.berman@gmx.net>.  (Bug#61149)

2 years ago; Fix build and startup without tree-sitter
Eli Zaretskii [Mon, 30 Jan 2023 12:22:19 +0000 (14:22 +0200)]
; 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.

2 years agoFix password prompt in Tramp (do not merge)
Michael Albinus [Mon, 30 Jan 2023 10:43:04 +0000 (11:43 +0100)]
Fix password prompt in Tramp (do not merge)

* lisp/net/tramp.el (tramp-password-prompt-regexp):
Allow alternative trailing colons.  (Bug#61168)

2 years agoUpdate to Org 9.6.1-23-gc45a05
Kyle Meyer [Mon, 30 Jan 2023 02:42:17 +0000 (21:42 -0500)]
Update to Org 9.6.1-23-gc45a05

2 years ago; * doc/emacs/misc.texi (Document View): Remove @footnote (bug#61152).
Eli Zaretskii [Sun, 29 Jan 2023 17:00:59 +0000 (19:00 +0200)]
; * doc/emacs/misc.texi (Document View): Remove @footnote (bug#61152).

2 years agoDocument tree-sitter features in the user manual
Eli Zaretskii [Sun, 29 Jan 2023 13:22:20 +0000 (15:22 +0200)]
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.

2 years ago; Remove treesit--font-lock-fast-mode-grace-count
Yuan Fu [Sun, 29 Jan 2023 08:30:53 +0000 (00:30 -0800)]
; 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.

2 years agoFix dockerfile-ts-mode line continuation indentation (bug#61131)
Randy Taylor [Sun, 29 Jan 2023 02:21:29 +0000 (21:21 -0500)]
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.

2 years agoUse treesit-subtree-stat to determine treesit--font-lock-fast-mode
Yuan Fu [Sun, 29 Jan 2023 08:07:46 +0000 (00:07 -0800)]
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.

2 years agoAdd treesit-subtree-stat
Yuan Fu [Sun, 29 Jan 2023 08:06:09 +0000 (00:06 -0800)]
Add treesit-subtree-stat

* src/treesit.c (Ftreesit_subtree_stat): New function.
* lisp/treesit.el (treesit): Add to shortdoc.

2 years agoMove c-ts-mode--statement-offset to c-ts-common.el
Yuan Fu [Sun, 29 Jan 2023 01:08:53 +0000 (17:08 -0800)]
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.

2 years ago; Fix byte-compile warnings in c-ts-mode.el
Yuan Fu [Sun, 29 Jan 2023 00:25:23 +0000 (16:25 -0800)]
; 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.

2 years ago; Improve docstring of c-ts-mode--indent-style-setter
Yuan Fu [Sun, 29 Jan 2023 00:20:29 +0000 (16:20 -0800)]
; Improve docstring of c-ts-mode--indent-style-setter

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-style-setter): Improve docstring.

2 years agoFix <> syntax in rust-ts-mode
Yuan Fu [Fri, 27 Jan 2023 01:49:45 +0000 (17:49 -0800)]
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.

2 years agoFix spurious errors on Windows when deleting temporary *.eln files
Eli Zaretskii [Sun, 29 Jan 2023 07:44:53 +0000 (09:44 +0200)]
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)

2 years agoFix java class member without access modifier (bug#61115)
Theodor Thornhill [Sat, 28 Jan 2023 18:51:08 +0000 (19:51 +0100)]
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.

2 years agoMake treesit-font-lock-level a defcustom
Theodor Thornhill [Sat, 28 Jan 2023 12:57:01 +0000 (13:57 +0100)]
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.

2 years agoAdd c-ts-mode-set-style and :set for c-ts-mode-indent-style
Theodor Thornhill [Wed, 25 Jan 2023 20:04:00 +0000 (21:04 +0100)]
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'.

2 years agoMinor documentation improvements for outline-minor-mode (bug#61062)
Juri Linkov [Sat, 28 Jan 2023 17:59:22 +0000 (19:59 +0200)]
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.

2 years ago; * doc/lispref/variables.texi (File Local Variables): Improve indexing.
Eli Zaretskii [Sat, 28 Jan 2023 14:59:17 +0000 (16:59 +0200)]
; * doc/lispref/variables.texi (File Local Variables): Improve indexing.

2 years ago; * src/comp.c: Remove Local Variables section to avoid warnings.
Eli Zaretskii [Sat, 28 Jan 2023 14:52:44 +0000 (16:52 +0200)]
; * src/comp.c: Remove Local Variables section to avoid warnings.

2 years agopython.el: Use correct regexp when enabling python-ts-mode
Brian Leung [Fri, 27 Jan 2023 01:36:42 +0000 (17:36 -0800)]
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)

2 years ago; * doc/emacs/frames.texi (Mouse References): Improve indexing.
Eli Zaretskii [Sat, 28 Jan 2023 07:49:53 +0000 (09:49 +0200)]
; * doc/emacs/frames.texi (Mouse References): Improve indexing.

2 years agoMake project-current not error out inside non-existent dirs
Dmitry Gutov [Sat, 28 Jan 2023 01:17:39 +0000 (03:17 +0200)]
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.

2 years agoImprove documentation of 'shell-command-dont-erase-buffer'
Eli Zaretskii [Fri, 27 Jan 2023 17:01:49 +0000 (19:01 +0200)]
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)

2 years agoFix errors in fontification of JavaScript import-statements (bug#61083)
Jostein Kjønigsen [Thu, 26 Jan 2023 19:32:18 +0000 (20:32 +0100)]
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.

2 years agoFix fontification TypeScript of import-statements (bug#61081)
Jostein Kjønigsen [Thu, 26 Jan 2023 18:54:27 +0000 (19:54 +0100)]
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.

2 years ago; Fix typos
Stefan Kangas [Mon, 23 Jan 2023 01:27:15 +0000 (02:27 +0100)]
; Fix typos

2 years ago; * lisp/progmodes/cc-engine.el: Delete trailing whitespace.
Stefan Kangas [Fri, 27 Jan 2023 10:25:08 +0000 (11:25 +0100)]
; * lisp/progmodes/cc-engine.el: Delete trailing whitespace.

This was holding up the automatic merges due to commit hooks.

2 years agoWork around package.el transitive dependency bug
Basil L. Contovounesios [Fri, 27 Jan 2023 00:27:26 +0000 (00:27 +0000)]
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).

2 years ago; Fix issues with processing out-of-order IRC messages
Philip Kaludercic [Thu, 26 Jan 2023 18:39:16 +0000 (19:39 +0100)]
; 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.

2 years agoFix xt-mouse on terminals that report UTF-8 encoded coordinates
Eli Zaretskii [Thu, 26 Jan 2023 08:54:43 +0000 (10:54 +0200)]
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)

2 years agoFix go-ts-mode indentation and set indent offset to 8 (Bug#61006)
Randy Taylor [Wed, 25 Jan 2023 02:20:48 +0000 (21:20 -0500)]
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.

2 years ago; * src/insdel.c (insert_from_buffer): Fix assertions.
Eli Zaretskii [Thu, 26 Jan 2023 08:23:58 +0000 (10:23 +0200)]
; * src/insdel.c (insert_from_buffer): Fix assertions.

2 years agoFix doc strings of window-splitting commands
Eli Zaretskii [Thu, 26 Jan 2023 07:59:58 +0000 (09:59 +0200)]
Fix doc strings of window-splitting commands

* lisp/window.el (split-window-below, split-window-right): Doc
fixes.  (Bug#60886)

2 years agoFix indentation for c-ts-mode (bug#61026)
Yuan Fu [Thu, 26 Jan 2023 07:47:27 +0000 (23:47 -0800)]
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.

2 years agoFix call to treesit_record_change in insdel.c
Yuan Fu [Thu, 26 Jan 2023 07:12:41 +0000 (23:12 -0800)]
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.

2 years agoAdd support for building tree-sitter modules with MinGW
Randy Taylor [Thu, 19 Jan 2023 14:16:55 +0000 (09:16 -0500)]
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.

2 years ago* lisp/net/tramp.el (tramp-wrong-passwd-regexp): Fix regexp.
Michael Albinus [Wed, 25 Jan 2023 19:14:12 +0000 (20:14 +0100)]
* lisp/net/tramp.el (tramp-wrong-passwd-regexp): Fix regexp.

2 years ago* doc/emacs/text.texi (Outline Minor Mode): New node split from "Outline Mode"
Juri Linkov [Wed, 25 Jan 2023 18:19:44 +0000 (20:19 +0200)]
* 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).

2 years ago; * etc/NEWS: Minor reordering.
Juri Linkov [Wed, 25 Jan 2023 17:38:01 +0000 (19:38 +0200)]
; * etc/NEWS: Minor reordering.

Move Exif section closer to Image changes, define-keymap/defvar-keymap
and lookup-key closer to Keymaps section.

2 years agoruby-ts-mode: Don't reindent when "class" or "def" is under "ERROR"
Dmitry Gutov [Wed, 25 Jan 2023 15:21:49 +0000 (17:21 +0200)]
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).

2 years agotreesit-install-language-grammar: Provide default repo url
Dmitry Gutov [Wed, 25 Jan 2023 15:01:28 +0000 (17:01 +0200)]
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).

2 years agoFix Dired face for directory symlinks
Basil L. Contovounesios [Wed, 25 Jan 2023 14:24:39 +0000 (14:24 +0000)]
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).

2 years agoPacify --without-x unused function warning
Basil L. Contovounesios [Wed, 25 Jan 2023 01:02:30 +0000 (01:02 +0000)]
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).

2 years ago; * etc/NEWS: Fix typos.
Michael Albinus [Wed, 25 Jan 2023 14:31:33 +0000 (15:31 +0100)]
; * etc/NEWS: Fix typos.

2 years agoAnnounce outline.el keymaps
Robert Pluim [Wed, 25 Jan 2023 13:23:44 +0000 (14:23 +0100)]
Announce outline.el keymaps

* etc/NEWS: Announce new keymaps.

2 years ago; Don't mention in the Gnus manual user options that were removed
Arash Esbati [Wed, 25 Jan 2023 10:02:24 +0000 (11:02 +0100)]
; 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)

2 years agoFix fontification of function-valued variables (bug#61053)
Jostein Kjønigsen [Wed, 25 Jan 2023 09:38:09 +0000 (10:38 +0100)]
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.

2 years agoAdd new java indent rules
Theodor Thornhill [Wed, 25 Jan 2023 12:00:33 +0000 (13:00 +0100)]
Add new java indent rules

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Check
for enum_body_declarations and switch_label.