]> git.eshelyaron.com Git - emacs.git/log
emacs.git
20 months ago; Update copyright notice in tramp-sh.el
Michael Albinus [Mon, 2 Jan 2023 18:50:07 +0000 (19:50 +0100)]
; Update copyright notice in tramp-sh.el

* lisp/net/tramp-sh.el (tramp-perl-encode, tramp-perl-decode):
Remove copyright notice, Tramp is copyrighted by FSF anyway.

20 months ago(typescript/tsx-ts-mode): Split font-lock feature list into 4 values
Dmitry Gutov [Mon, 2 Jan 2023 18:42:52 +0000 (20:42 +0200)]
(typescript/tsx-ts-mode): Split font-lock feature list into 4 values

* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode)
(tsx-ts-mode): Split font-lock feature list into 4 values.

20 months agojs-ts-mode: Move 'string-interpolation' to font-lock level 3
Dmitry Gutov [Mon, 2 Jan 2023 17:59:50 +0000 (19:59 +0200)]
js-ts-mode: Move 'string-interpolation' to font-lock level 3

* lisp/progmodes/js.el (js-ts-mode):
Move 'string-interpolation' to font-lock level 3.

20 months agoFix shrinking of the tab-bar
Eli Zaretskii [Mon, 2 Jan 2023 15:02:05 +0000 (17:02 +0200)]
Fix shrinking of the tab-bar

* src/haikufns.c (haiku_change_tab_bar_height):
* src/pgtkfns.c (pgtk_change_tab_bar_height):
* src/nsfns.m (ns_change_tab_bar_height):
* src/w32fns.c (w32_change_tab_bar_height):
* src/xfns.c (x_change_tab_bar_height): Don't let the number of
tab-bar lines degenerate to zero due to integer division.
(Bug#60210)

20 months ago; Fix typos in ruby-ts-mode.el
Stefan Kangas [Mon, 2 Jan 2023 14:17:59 +0000 (15:17 +0100)]
; Fix typos in ruby-ts-mode.el

20 months ago; Skip ruby-ts tests if grammar is not available
Stefan Kangas [Mon, 2 Jan 2023 13:58:37 +0000 (14:58 +0100)]
; Skip ruby-ts tests if grammar is not available

* test/lisp/progmodes/ruby-ts-mode-tests.el: Properly skip tests if
there is no grammar for ruby.

20 months agoFix default-port regression in erc-select-read-args
F. Jason Park [Thu, 29 Dec 2022 14:43:19 +0000 (06:43 -0800)]
Fix default-port regression in erc-select-read-args

* lisp/erc/erc.el (erc--warn-unencrypted): New function, likely
temporary, to warn new users connecting interactively to the default
server, "irc.libara.chat", via the default non-TLS port, 6667.
(erc-select-read-args): Remove stray code from incomplete feature
introduced by bug#56514.  Ensure connecting always works with default
port, which is non-TLS.  Respect `erc-prompt-for-password' when user
pastes URL containing password component into "server" prompt.  Maybe
add `erc--warn-unencrypted' as one-off hook for impending connection.
* test/lisp/erc/erc-tests.el (erc-select-read-args): Always expect
password prompt and sometimes a non-TLS port when `erc' called
interactively.  (Bug#60428.)

20 months ago; Clarify doc strings of 'call-process' and 'call-process-region'
Eli Zaretskii [Mon, 2 Jan 2023 11:52:25 +0000 (13:52 +0200)]
; Clarify doc strings of 'call-process' and 'call-process-region'

* src/callproc.c (Fcall_process, Fcall_process_region): Document
that the destination buffer can be specified by its name.
(Bug#60477)

20 months ago; * admin/git-bisect-start: Update failing commits
Gregory Heytings [Mon, 2 Jan 2023 09:58:23 +0000 (09:58 +0000)]
; * admin/git-bisect-start: Update failing commits

20 months agoUpdate to Org 9.6-81-g563a43
Kyle Meyer [Mon, 2 Jan 2023 03:24:28 +0000 (22:24 -0500)]
Update to Org 9.6-81-g563a43

20 months agoruby-ts-mode: Remove some currently unused functions
Dmitry Gutov [Mon, 2 Jan 2023 01:51:11 +0000 (03:51 +0200)]
ruby-ts-mode: Remove some currently unused functions

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--grand-parent-is)
(ruby-ts--ancestor-start, ruby-ts--ancestor-is):
Remove some currently unused functions.

20 months agoruby-ts-mode: Highlight singleton method definitions and setters
Dmitry Gutov [Mon, 2 Jan 2023 01:29:15 +0000 (03:29 +0200)]
ruby-ts-mode: Highlight singleton method definitions and setters

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Highlight singleton method definitions and setters.

20 months agoAdd ruby-ts-mode
Perry Smith [Mon, 2 Jan 2023 00:57:38 +0000 (02:57 +0200)]
Add ruby-ts-mode

* etc/NEWS: Mention the new mode.

* lisp/progmodes/ruby-ts-mode.el: New file.

* test/lisp/progmodes/ruby-ts-mode-tests.el: New file.

* lisp/progmodes/eglot.el (eglot-server-programs):
Add ruby-ts-mode to the Ruby entry.

Co-authored-by: Dmitry Gutov <dgutov@yandex.ru>
20 months agoFix fontification of C++ reference return types (bug#60441)
Daniel Martín [Sat, 31 Dec 2022 00:45:27 +0000 (01:45 +0100)]
Fix fontification of C++ reference return types (bug#60441)

* lisp/progmodes/c-ts-mode.el (c-ts-fontify-error): Treat
reference_declarator nodes the same as pointer_declarator nodes when
calculating the identifier to fontify.

20 months ago; Minor fix for treesit--install-language-grammar-1 (bug#60465)
Yuan Fu [Mon, 2 Jan 2023 00:15:02 +0000 (16:15 -0800)]
; Minor fix for treesit--install-language-grammar-1 (bug#60465)

* lisp/treesit.el (treesit--install-language-grammar-1): Fix.

20 months agoAdjust function-call fontification in csharp-ts-mode (bug#60376)
Jostein Kjønigsen [Sun, 1 Jan 2023 16:27:06 +0000 (17:27 +0100)]
Adjust function-call fontification in csharp-ts-mode (bug#60376)

- Ensure method-invocations are highlighted only on level 4.
- Ensure consistent fontification of variable declarations
  (don't highlight usage of all variables).
- Fix issues with highlighting types in new() expressions.
- Fix issues with generic types in variable-declarations not using "var".
- Use fewer, more general queries for function-invocations. simplify code.

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Change rules.
(csharp-ts-mode): Update feature list.

20 months ago; Fix NEWS.
Eli Zaretskii [Sun, 1 Jan 2023 17:38:24 +0000 (19:38 +0200)]
; Fix NEWS.

20 months agoRewrite Antinews in ELisp manual for Emacs 29
Eli Zaretskii [Sun, 1 Jan 2023 17:37:22 +0000 (19:37 +0200)]
Rewrite Antinews in ELisp manual for Emacs 29

* doc/lispref/anti.texi (Antinews): Rewrite for Emacs 29.
* doc/lispref/elisp.texi (Top): Update the top-level menu for
Antinews.

20 months ago; * lisp/simple.el (primitive-undo): Clarify error message (bug#60467)
Eli Zaretskii [Sun, 1 Jan 2023 15:49:10 +0000 (17:49 +0200)]
; * lisp/simple.el (primitive-undo): Clarify error message (bug#60467)

20 months agoUpdate Antinews in the user manual for Emacs 29
Eli Zaretskii [Sun, 1 Jan 2023 15:38:23 +0000 (17:38 +0200)]
Update Antinews in the user manual for Emacs 29

* doc/emacs/anti.texi (Antinews): Rewrite for Emacs 29.
* doc/emacs/emacs.texi (Top): Adjust the top-level menu.

20 months ago; * test/lisp/emacs-lisp/copyright-tests.el: Fix and future-safe.
Mattias Engdegård [Sun, 1 Jan 2023 12:18:50 +0000 (13:18 +0100)]
; * test/lisp/emacs-lisp/copyright-tests.el: Fix and future-safe.

20 months agoFix shortdoc-tests failure with respect to regexp-opt-charset
Mattias Engdegård [Sun, 1 Jan 2023 11:52:47 +0000 (12:52 +0100)]
Fix shortdoc-tests failure with respect to regexp-opt-charset

* test/lisp/emacs-lisp/shortdoc-tests.el (regexp-opt): Require.
`regexp-opt-charset` is not autoloaded, and whether `regexp-opt` is
preloaded is configuration-dependent.

20 months ago; Fix copyright years in 2 more files.
Eli Zaretskii [Sun, 1 Jan 2023 11:08:15 +0000 (13:08 +0200)]
; Fix copyright years in 2 more files.

20 months ago; Add 2023 to copyright years.
Eli Zaretskii [Sun, 1 Jan 2023 10:31:12 +0000 (05:31 -0500)]
; Add 2023 to copyright years.

20 months agoImprove documentation of 'isearch-open-overlay-temporary'
Eli Zaretskii [Sun, 1 Jan 2023 09:04:22 +0000 (11:04 +0200)]
Improve documentation of 'isearch-open-overlay-temporary'

* lisp/isearch.el (isearch-open-overlay-temporary): Document that
the overlay passed to the 'isearch-open-invisible-temporary'
function cannot be deleted too early.  (Bug#60399)

20 months agoDocument 'use-package' in the 2 main manuals
Eli Zaretskii [Sun, 1 Jan 2023 08:38:11 +0000 (10:38 +0200)]
Document 'use-package' in the 2 main manuals

* doc/emacs/custom.texi (Init Examples):
* doc/lispref/loading.texi (Named Features): Document 'use-package'
and its most important features.

20 months ago; Auto-commit of loaddefs files.
Stefan Kangas [Sun, 1 Jan 2023 04:08:26 +0000 (05:08 +0100)]
; Auto-commit of loaddefs files.

20 months ago; * lisp/treesit.el (treesit-simple-indent-presets): Fix typo.
Yuan Fu [Sun, 1 Jan 2023 01:10:50 +0000 (17:10 -0800)]
; * lisp/treesit.el (treesit-simple-indent-presets): Fix typo.

Well it's sort of a typo :-)

20 months agoBuild recipe interactively in treesit-install-language-grammar
Yuan Fu [Sat, 31 Dec 2022 23:13:50 +0000 (15:13 -0800)]
Build recipe interactively in treesit-install-language-grammar

If there is not existing recipe for a language, prompt to build the
recipe interactively.

* lisp/treesit.el (treesit--install-language-grammar-build-recipe):
New functions.
(treesit-install-language-grammar): Use the new function.

20 months ago; Add REVISION to treesit-language-source-alist
Yuan Fu [Sat, 31 Dec 2022 22:55:10 +0000 (14:55 -0800)]
; Add REVISION to treesit-language-source-alist

This allows users to install a particular version or branch.  Prompted
by bug#60427 and bug#60223.

* lisp/treesit.el (treesit-language-source-alist)
(treesit--install-language-grammar-1): Add REVISION.

20 months ago; Remove GRAMMAR-DIR from treesit-language-source-alist
Yuan Fu [Sat, 31 Dec 2022 22:27:51 +0000 (14:27 -0800)]
; Remove GRAMMAR-DIR from treesit-language-source-alist

Removing it doesn't affect building all the language grammars in
batch.sh, so it must be an artifact I added for something else and
later forgot to remove.

* lisp/treesit.el (treesit-language-source-alist)
(treesit--install-language-grammar-1): Remove GRAMMAR-DIR.

20 months agoTweak csharp-mode font-lock-settings (bug#60376)
Theodor Thornhill [Fri, 30 Dec 2022 19:26:09 +0000 (20:26 +0100)]
Tweak csharp-mode font-lock-settings (bug#60376)

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Rearrange features.
(csharp-ts-mode): Rearrange features.

20 months ago; * doc/lispref/tips.texi (Documentation Tips): Add indexing.
Eli Zaretskii [Sat, 31 Dec 2022 16:47:51 +0000 (18:47 +0200)]
; * doc/lispref/tips.texi (Documentation Tips): Add indexing.

20 months agoRevert a recent change which causes errors
Eli Zaretskii [Sat, 31 Dec 2022 16:32:54 +0000 (18:32 +0200)]
Revert a recent change which causes errors

* lisp/subr.el (buffer-match-p): Undo last change, as it causes an
error in a timer function of show-paren-mode.

20 months ago; More fixes for documentation of 'defalias'
Eli Zaretskii [Sat, 31 Dec 2022 15:01:22 +0000 (17:01 +0200)]
; More fixes for documentation of 'defalias'

* doc/lispref/functions.texi (Defining Functions): Document
other possible values of DEFINITION in a defalias.
(Bug#60432)

20 months ago; Fix handling of 'not' by 'buffer-match-p'
Philip Kaludercic [Sat, 31 Dec 2022 14:04:18 +0000 (15:04 +0100)]
; Fix handling of 'not' by 'buffer-match-p'

* lisp/subr.el (buffer-match-p): Look up the cadr instead of the cdr
for the negation in 'not'.
* doc/lispref/buffers.texi (Buffer List): Update documentation.
(Bug#58951)

20 months ago; Fix typos
Stefan Kangas [Mon, 26 Dec 2022 09:43:57 +0000 (10:43 +0100)]
; Fix typos

20 months agoFix misspelled functions in shortdoc groups
Stefan Kangas [Sat, 31 Dec 2022 11:31:13 +0000 (12:31 +0100)]
Fix misspelled functions in shortdoc groups

* lisp/emacs-lisp/shortdoc.el (file, list): Fix misspelled function
names: 'file-writable-p' and 'seq-reduce'.
* test/lisp/emacs-lisp/shortdoc-tests.el (subr-x): Require.
(shortdoc-all-functions-fboundp): New test.

20 months agoSimplify introduction of use-package manual
Kévin Le Gouguec [Tue, 27 Dec 2022 14:40:43 +0000 (15:40 +0100)]
Simplify introduction of use-package manual

* doc/misc/use-package.texi (Getting Started): Do not advise requiring
the package, since the macro is autoloaded; also correct the macro's
name.  (Bug#60366)

20 months ago; Fix documentation of 'defalias'
Eli Zaretskii [Sat, 31 Dec 2022 08:44:53 +0000 (10:44 +0200)]
; Fix documentation of 'defalias'

* doc/lispref/functions.texi (Defining Functions): Document that a
defalias's DEFINITION can be a macro.  (Bug#60432)

20 months agoFix python-shell-buffer-substring when retrieving a single statement
kobarity [Thu, 22 Dec 2022 14:08:40 +0000 (23:08 +0900)]
Fix python-shell-buffer-substring when retrieving a single statement

* lisp/progmodes/python.el (python-shell-buffer-substring): Do not add
"if True:" line when retrieving a single statement.
(python-shell-send-region): Add a reference to
`python-shell-buffer-substring' in docstring.
* test/lisp/progmodes/python-tests.el (python-shell-buffer-substring-13)
(python-shell-buffer-substring-14, python-shell-buffer-substring-15)
(python-shell-buffer-substring-16, python-shell-buffer-substring-17):
New tests. (Bug#60142)

20 months ago; Fix recent treesit-related changes
Eli Zaretskii [Sat, 31 Dec 2022 08:13:15 +0000 (10:13 +0200)]
; Fix recent treesit-related changes

* lisp/treesit.el (treesit-language-source-alist)
(treesit--install-language-grammar-1): Doc fixes.

* src/treesit.c (Ftreesit_language_abi_version): Fix a typo in
function's Lisp name.  Doc fix.
(Ftreesit_language_available_p): Fix a typo in the function's C
name.

* doc/lispref/parsing.texi (Language Grammar): Fix wording.

20 months agoShow tree-sitter query source when signaling query error
Yuan Fu [Sat, 31 Dec 2022 00:57:45 +0000 (16:57 -0800)]
Show tree-sitter query source when signaling query error

* src/treesit.c (treesit_compose_query_signal_data): Add QUERY_SOURCE
parameter.
(treesit_ensure_query_compiled)
(Ftreesit_query_capture): Add query source.

20 months ago; * lisp/treesit.el (treesit--install-language-grammar-1): Minor fix.
Yuan Fu [Sat, 31 Dec 2022 00:23:39 +0000 (16:23 -0800)]
; * lisp/treesit.el (treesit--install-language-grammar-1): Minor fix.

20 months agoAdd version tags and mention the new options in NEWS
Dmitry Gutov [Fri, 30 Dec 2022 22:12:51 +0000 (00:12 +0200)]
Add version tags and mention the new options in NEWS

* etc/NEWS: Mention the new options (bug#60186).

* lisp/progmodes/ruby-mode.el (ruby-block-indent)
(ruby-after-operator-indent, ruby-method-call-indent)
(ruby-parenless-call-arguments-indent): Add version tags.

20 months agoAdd new options for Ruby code indentation
Dmitry Gutov [Fri, 30 Dec 2022 21:58:26 +0000 (23:58 +0200)]
Add new options for Ruby code indentation

* lisp/progmodes/ruby-mode.el (ruby-block-indent)
(ruby-after-operator-indent, ruby-method-call-indent)
(ruby-parenless-call-arguments-indent): New options (bug#60186).
(ruby-smie-grammar): Specify associativity for "?".
(ruby-smie--indent-to-stmt): Add optional argument.

* test/lisp/progmodes/ruby-mode-resources/ruby.rb: New cases.

* test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb:
* test/lisp/progmodes/ruby-mode-resources/ruby-block-indent.rb:
* test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb:
* test/lisp/progmodes/ruby-mode-resources/
ruby-parenless-call-arguments-indent.rb: New files.

* test/lisp/progmodes/ruby-mode-tests.el: Add indentation tests for new files.

20 months ago; Fix doc strings of 'treesit-install-language-grammar'
Eli Zaretskii [Fri, 30 Dec 2022 15:10:22 +0000 (17:10 +0200)]
; Fix doc strings of 'treesit-install-language-grammar'

* lisp/treesit.el (treesit-install-language-grammar)
(treesit--install-language-grammar-1): Doc fixes.

20 months ago; Fix recently modified docs of 'set-face-attribute' (bug#52493)
Eli Zaretskii [Fri, 30 Dec 2022 14:43:38 +0000 (16:43 +0200)]
; Fix recently modified docs of 'set-face-attribute' (bug#52493)

* doc/lispref/display.texi (Attribute Functions): Clarify wording
and restore removed information about resetting attributes to
'unspecified' for future frames.

* lisp/faces.el (set-face-attribute): Minor copyedit of doc
string.

20 months agoAdd treesit-install-language-grammar
Yuan Fu [Fri, 30 Dec 2022 10:56:26 +0000 (02:56 -0800)]
Add treesit-install-language-grammar

Per discussion on emacs-devel, I added function to install and compile
language grammars.

* lisp/treesit.el (treesit-language-source-alist): New variable.
(treesit-install-language-grammar)
(treesit--call-process-signal)
(treesit--install-language-grammar-1): New functions.

20 months agoAdd treesit-language-abi-version
Yuan Fu [Fri, 30 Dec 2022 10:54:13 +0000 (02:54 -0800)]
Add treesit-language-abi-version

Also rename treesit-language-version to treesit-library-abi-version,
because the old name is somewhat misleading.

* doc/lispref/parsing.texi (Language Grammar): Update.
* src/treesit.c (Ftreesit_library_abi_version): Rename.
(Ftreesit_language_abi_version): New function.

20 months agoChange "language definition" to "language grammar" in manual.
Yuan Fu [Fri, 30 Dec 2022 08:47:22 +0000 (00:47 -0800)]
Change "language definition" to "language grammar" in manual.

"Language grammar" is apparently the more widely used term among
people talking about tree-sitter.  To avoid confusion, I think it's
good to use that rather than "language definition", which is a term
that I made up :-)

Feel free to revert this if it is too much change.

* doc/lispref/elisp.texi:
* doc/lispref/modes.texi:
* doc/lispref/parsing.texi:
* lisp/treesit.el: Change "language definition" to "language grammar".

20 months ago; * lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragraph): Fix.
Yuan Fu [Fri, 30 Dec 2022 08:34:42 +0000 (00:34 -0800)]
; * lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragraph): Fix.

20 months ago; * doc/lispref/parsing.texi (Accessing Node Information): Fix typo.
Yuan Fu [Fri, 30 Dec 2022 04:54:42 +0000 (20:54 -0800)]
; * doc/lispref/parsing.texi (Accessing Node Information): Fix typo.

20 months ago* test/lisp/net/tramp-tests.el (tramp-test32-shell-command): Fix test.
Michael Albinus [Fri, 30 Dec 2022 08:26:56 +0000 (09:26 +0100)]
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command): Fix test.

20 months ago* lisp/eshell/em-tramp.el (tramp): Require also at runtime. (Bug#60402)
Michael Albinus [Fri, 30 Dec 2022 08:26:41 +0000 (09:26 +0100)]
* lisp/eshell/em-tramp.el (tramp): Require also at runtime.  (Bug#60402)

20 months agolisp/textmodes/bibtex.el: fix bibtex-beginning-of-entry (bug#56636)
Roland Winkler [Fri, 30 Dec 2022 05:31:08 +0000 (23:31 -0600)]
lisp/textmodes/bibtex.el: fix bibtex-beginning-of-entry (bug#56636)

lisp/textmodes/bibtex.el (bibtex-beginning-of-entry):
use bibtex-any-entry-maybe-empty-head (bug#56636)

20 months agolisp/textmodes/bibtex.el: Treat $ as punctuation in BibTeX fields (bug#50202)
Roland Winkler [Fri, 30 Dec 2022 05:22:48 +0000 (23:22 -0600)]
lisp/textmodes/bibtex.el: Treat $ as punctuation in BibTeX fields (bug#50202)

20 months agoClarify the documentation of 'set-face-attribute'
Gregory Heytings [Thu, 29 Dec 2022 22:41:58 +0000 (22:41 +0000)]
Clarify the documentation of 'set-face-attribute'

* lisp/faces.el (set-face-attribute): Mention the evaluation order
of attribute-value pairs in the docstring.

* doc/lispref/display.texi (Attribute Functions): Likewise, and
explain with an example that a different argument order might give
different results.  Also align the documentation in the manual
with that of the docstring, whose changes were discussed in
bug#57499 but not included in the manual.

20 months agoHandle non-string values in pcomplete
Gregory Heytings [Mon, 19 Dec 2022 22:18:22 +0000 (22:18 +0000)]
Handle non-string values in pcomplete

* lisp/pcomplete.el (pcomplete-arg): When
pcomplete-parse-arguments-function returns a non-string value,
return the string the user typed in, and attach the value as a
text property to that string.  Fixes bug#59956 and bug#60021.

20 months agoFix completion when completion-auto-select is set
Gregory Heytings [Thu, 29 Dec 2022 21:50:26 +0000 (21:50 +0000)]
Fix completion when completion-auto-select is set

* lisp/minibuffer.el (completion--do-completion): Do not display
"Complete, but not unique" messages when completion-auto-select is
set.  Fixes bug#60359.

20 months ago; * etc/DEBUG: Update MS-Windows specifics for GDB 13 and later.
Eli Zaretskii [Thu, 29 Dec 2022 20:04:44 +0000 (22:04 +0200)]
; * etc/DEBUG: Update MS-Windows specifics for GDB 13 and later.

20 months agoAdd color fontification in css-ts-mode (bug#60405)
Yuan Fu [Thu, 29 Dec 2022 19:52:06 +0000 (11:52 -0800)]
Add color fontification in css-ts-mode (bug#60405)

* lisp/textmodes/css-mode.el (css-ts-mode): Add color fontification
and syntax-propertize-function.

20 months ago; * lisp/textmodes/css-mode.el (css-ts-mode): Fix imenu setup.
Yuan Fu [Thu, 29 Dec 2022 19:41:26 +0000 (11:41 -0800)]
; * lisp/textmodes/css-mode.el (css-ts-mode): Fix imenu setup.

20 months ago; * lisp/progmodes/js.el: Fix byte-compile warning.
Yuan Fu [Thu, 29 Dec 2022 19:34:28 +0000 (11:34 -0800)]
; * lisp/progmodes/js.el: Fix byte-compile warning.

20 months ago* lisp/hi-lock.el (hi-lock--regexps-at-point): Fix bug (bug#60241).
Juri Linkov [Thu, 29 Dec 2022 17:45:12 +0000 (19:45 +0200)]
* lisp/hi-lock.el (hi-lock--regexps-at-point): Fix bug (bug#60241).

Handle two cases: when a pattern is a regexp or a function.

20 months ago* src/keyboard.c (echo_add_key): Use recently rebound C-h key C-q (bug#60249)
Juri Linkov [Thu, 29 Dec 2022 17:41:41 +0000 (19:41 +0200)]
* src/keyboard.c (echo_add_key): Use recently rebound C-h key C-q (bug#60249)

20 months agoAvoid assertion violations in treesit.c with --enable-checking
Eli Zaretskii [Thu, 29 Dec 2022 11:52:09 +0000 (13:52 +0200)]
Avoid assertion violations in treesit.c with --enable-checking

* src/treesit.c (Ftreesit_node_first_child_for_pos)
(Ftreesit_node_descendant_for_range): Check validity of buffer
positions before converting them to byte-positions, to avoid
assertion violations in buf_charpos_to_bytepos.

20 months agoClean up treesit-default-defun-skipper and add comments
Yuan Fu [Thu, 29 Dec 2022 09:28:25 +0000 (01:28 -0800)]
Clean up treesit-default-defun-skipper and add comments

* lisp/treesit.el (treesit-default-defun-skipper): Clean up, fix some
small issue, add comment.

20 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Thu, 29 Dec 2022 09:11:58 +0000 (11:11 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

20 months ago; whitespace.el: Use the new 'ert-with-buffer-selected' in tests
Richard Hansen [Sun, 18 Dec 2022 05:24:16 +0000 (00:24 -0500)]
; whitespace.el: Use the new 'ert-with-buffer-selected' in tests

Commit 286c48137f69fa96b80d197da90c69a42df604a3 added a new
`ert-with-test-buffer-selected' macro.  Use that macro in
'whitespace-mode' tests to avoid code duplication.  (Bug#60332)
* test/lisp/whitespace-tests.el (whitespace--with-buffer-selected):
Macro deleted.
(whitespace-tests--indirect-clone-breaks-base-markers)
(whitespace-tests--indirect-clone-markers)
(whitespace-tests--regular-clone-markers): Use
'ert-with-buffer-selected'.

20 months agoFix c-ts-mode bracket indentation (bug#60398)
Yuan Fu [Thu, 29 Dec 2022 08:58:50 +0000 (00:58 -0800)]
Fix c-ts-mode bracket indentation (bug#60398)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Use new
anchor.
(c-ts-mode--bracket-children-anchor): New anchor function.

20 months ago; Minor cleanup for tree-sitter font-lock rules in js-ts-mode
Yuan Fu [Thu, 29 Dec 2022 00:57:21 +0000 (16:57 -0800)]
; Minor cleanup for tree-sitter font-lock rules in js-ts-mode

* lisp/progmodes/js.el (js--treesit-font-lock-settings): Minor cleanup.

20 months agoClean up font-lock rules in js-ts-mode
Yuan Fu [Thu, 29 Dec 2022 00:52:47 +0000 (16:52 -0800)]
Clean up font-lock rules in js-ts-mode

Changes for each feature:

- string: Take out string-interpolation bits.
- string-interpolation: New.
- declaration: Rename to definition.
- identifier: Remove.
- property: Use a pred to filter out methods.
- expression: Rename to assignment.
- function: New.
- pattern: Merge into assignment.

* lisp/progmodes/js.el (js--treesit-font-lock-settings): See above.
(js--treesit-property-not-function-p)
(js--treesit-lhs-identifier-query): New variable.
(js--treesit-fontify-assignment-lhs): New functions.
(js-ts-mode): Update feature list.

20 months ago; * doc/lispref/parsing.texi (Using Parser): Minor improvement.
Yuan Fu [Wed, 28 Dec 2022 23:54:51 +0000 (15:54 -0800)]
; * doc/lispref/parsing.texi (Using Parser): Minor improvement.

20 months ago; * lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragraph): Fix.
Yuan Fu [Wed, 28 Dec 2022 23:47:14 +0000 (15:47 -0800)]
; * lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragraph): Fix.

20 months agoFix syntax for < and > in c++-ts-mode (bug#60351)
Yuan Fu [Wed, 28 Dec 2022 23:44:26 +0000 (15:44 -0800)]
Fix syntax for < and > in c++-ts-mode (bug#60351)

< and > are usually punctuation, e.g., in ->.  But when used for
templates, they should be considered pairs.  Right now we always
consider them as pairs which is incorrect.

* lisp/progmodes/c-ts-mode.el (c++-ts-mode--syntax-table): Remove
variable.
(c-ts-mode--syntax-propertize): New function.
(c++-ts-mode): Remove syntax table.  Setup syntax-propertize-function.

20 months agoCall tree-sitter parser notifier on the first parse
Yuan Fu [Wed, 28 Dec 2022 23:30:10 +0000 (15:30 -0800)]
Call tree-sitter parser notifier on the first parse

* src/treesit.c (treesit_call_after_change_functions): Handle NULL
old_tree.
(treesit_ensure_parsed): Remove check for NULL tree.

20 months agoFix tree-sitter parser notifier recursion
Yuan Fu [Wed, 28 Dec 2022 23:19:34 +0000 (15:19 -0800)]
Fix tree-sitter parser notifier recursion

See the comment for detail.

* src/treesit.c (treesit_ensure_parsed): Move the need_reparse short
circuit to the very beginning.  Move the call to
treesit_call_after_change_functions to the very end.

20 months ago* lisp/help.el: Use 'C-h C-q' to toggle 'help-quick' window (bug#60249).
Juri Linkov [Wed, 28 Dec 2022 18:48:40 +0000 (20:48 +0200)]
* lisp/help.el: Use 'C-h C-q' to toggle 'help-quick' window (bug#60249).

(help-map): Bind "C-q" to 'help-quick-toggle'.  Rebind "q" to 'help-quit'.
(help-quick): Replace help-quit-or-quick with help-quick-toggle.
(help-quick-toggle): New command.
(help-quit-or-quick): Remove command.
(help-for-help): Replace help-quick-or-quit with help-quick-toggle.

20 months ago; Improve markup of long key sequences
Eli Zaretskii [Wed, 28 Dec 2022 18:33:58 +0000 (20:33 +0200)]
; Improve markup of long key sequences

* doc/emacs/display.texi (Text Scale): Avoid breaking key
sequences between lines by using @w{..}.

20 months ago; * etc/NEWS: Fix wording of a recently edited entry.
Eli Zaretskii [Wed, 28 Dec 2022 18:30:56 +0000 (20:30 +0200)]
; * etc/NEWS: Fix wording of a recently edited entry.

20 months ago* lisp/isearch.el: Small fixes.
Juri Linkov [Wed, 28 Dec 2022 18:27:07 +0000 (20:27 +0200)]
* lisp/isearch.el: Small fixes.

(isearch-wrap-pause): Mention the new feature of `no' and `no-ding'
in the docstring.
(isearch-lax-whitespace, isearch-forward-thing-at-point): Add the
group 'isearch' since another defgroup changed the default group.
(isearch-delete-char): Use 'isearch-invisible' instead of 'search-invisible'
since the users might change the current value with 'M-s i'.

20 months ago* lisp/vc/diff-mode.el (diff-minor-mode-prefix): Replace "ESC" with "\e".
Juri Linkov [Wed, 28 Dec 2022 18:14:43 +0000 (20:14 +0200)]
* lisp/vc/diff-mode.el (diff-minor-mode-prefix): Replace "ESC" with "\e".

"ESC" looks like an attempt to use kbd syntax in customization.
But actually now 'key-description' is used in 'diff-minor-mode-map'
to convert "\e" to "ESC".

20 months ago; * etc/NEWS: Move the paragraph with 'C-u RET' closer to the related section.
Juri Linkov [Wed, 28 Dec 2022 18:09:46 +0000 (20:09 +0200)]
; * etc/NEWS: Move the paragraph with 'C-u RET' closer to the related section.

20 months ago* doc/emacs/display.texi (Text Scale): Improve section about repeating keys.
Juri Linkov [Wed, 28 Dec 2022 18:06:18 +0000 (20:06 +0200)]
* doc/emacs/display.texi (Text Scale): Improve section about repeating keys.

Mention that it's possible to use repeating keys without the modifiers
and copy an example from etc/NEWS.

20 months ago* lisp/repeat.el (repeat-echo-function): Suggest 'add-function' in docstring.
Juri Linkov [Wed, 28 Dec 2022 17:58:44 +0000 (19:58 +0200)]
* lisp/repeat.el (repeat-echo-function): Suggest 'add-function' in docstring.

(bug#60353)

20 months ago* lisp/tab-line.el (tab-line-cache-key-default): More cache keys (bug#60340).
Juri Linkov [Wed, 28 Dec 2022 17:47:52 +0000 (19:47 +0200)]
* lisp/tab-line.el (tab-line-cache-key-default): More cache keys (bug#60340).

Move more cache keys here from 'tab-line-format' to give users more freedom.

20 months ago* etc/package-keyring.gpg: Update with new key
Stefan Monnier [Wed, 28 Dec 2022 17:19:02 +0000 (12:19 -0500)]
* etc/package-keyring.gpg: Update with new key

20 months ago; Yet another declare-function to avoid treesit-related warning
Eli Zaretskii [Wed, 28 Dec 2022 17:08:19 +0000 (19:08 +0200)]
; Yet another declare-function to avoid treesit-related warning

20 months ago; * lisp/treesit.el (treesit--simple-imenu-1): Doc fix; wording.
Stefan Kangas [Wed, 28 Dec 2022 16:37:46 +0000 (17:37 +0100)]
; * lisp/treesit.el (treesit--simple-imenu-1): Doc fix; wording.

20 months agoWarn of absent networks module in ERC
F. Jason Park [Mon, 26 Dec 2022 05:36:53 +0000 (21:36 -0800)]
Warn of absent networks module in ERC

* doc/misc/erc.texi: Add linkable note in Modules chapter about some
modules being required.  Also tweak markup in auth-source section.
* etc/ERC-NEWS: Mention the special role of `networks'.
* lisp/erc/erc-backend.el (erc--server-post-connect-hook): Add
internal hook for core modules to perform post-network-process,
pre-protocol config validation even when they haven't been loaded.
(erc--register-connection): Run `erc--server-post-connect-hook'.
* lisp/erc/erc-networks.el (erc-networks--bouncer-targets,
erc-networks-on-MOTD-end): Fix comments and doc strings.  Also change
former from constant to internal variable in case adjustment needed
between releases.
(erc-networks--warn-on-connect): New function to warn about the
`networks' module being absent from `erc-modules'.  This could
probably run at any time up to and including when the logical IRC
connection is established, but doing so at the process/protocol
boundary seems ideal.
* lisp/erc/erc-sasl.el (erc--register-connection): Defer to base
method instead of calling `erc-login' explicitly.
* lisp/erc/erc.el (erc-generate-new-buffer-name): Don't reconcile
buffer names when networks module not in play.
(erc-format-target-and/or-network): Don't assume networks module
loaded.
* test/lisp/erc/erc-scenarios-base-unstable.el:
(erc-scenarios-networks-no-module): New test.
* test/lisp/erc/resources/networks/no-module/basic.eld: New test data
file.  (Bug#60331.)

20 months agoAvoid "already compiled" warning in erc-compat
F. Jason Park [Wed, 28 Dec 2022 14:18:01 +0000 (06:18 -0800)]
Avoid "already compiled" warning in erc-compat

* lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search):
Don't `byte-compile' sub-29 secrets wrapper.  This was especially
noisy in tests.  Ditch closed-over vars via HOF instead of suppressing
because compiling emits "unused lexical" warning on Emacs 27.

20 months ago; Fix one more treesit byte-compilation warning.
Eli Zaretskii [Wed, 28 Dec 2022 14:48:22 +0000 (16:48 +0200)]
; Fix one more treesit byte-compilation warning.

20 months ago; Avoid treesit-related byte-compiler warnings
Eli Zaretskii [Wed, 28 Dec 2022 14:41:58 +0000 (16:41 +0200)]
; Avoid treesit-related byte-compiler warnings

* lisp/progmodes/json-ts-mode.el (treesit-node-child-by-field-name):
* lisp/textmodes/toml-ts-mode.el (treesit-node-child-by-field-name):
* lisp/progmodes/java-ts-mode.el (treesit-node-child-by-field-name):
* lisp/progmodes/csharp-mode.el
(treesit-node-child-by-field-name): Avoid byte-compilation
warnings about treesit-node-type.

20 months ago(python--treesit-settings): Remove duplicate matcher
Dmitry Gutov [Wed, 28 Dec 2022 13:12:44 +0000 (15:12 +0200)]
(python--treesit-settings): Remove duplicate matcher

* lisp/progmodes/python.el (python--treesit-settings): Remove
duplicate matcher (which found itself under 'function' in addition
to 'definition').

20 months agoMake last change of w32 GUI dialogs conditional and reversible
Eli Zaretskii [Wed, 28 Dec 2022 13:10:39 +0000 (15:10 +0200)]
Make last change of w32 GUI dialogs conditional and reversible

* src/w32term.c (syms_of_w32term) <w32-yes-no-dialog-show-cancel>:
New boolean variable.
(w32_initialize): Fix query for visible system caret: 'bool' is a
single-byte data type, whereas SystemParametersInfo wants a BOOL,
which is a 32-bit int.
* src/w32menu.c (simple_dialog_show): Show "Cancel" button only if
'w32-yes-no-dialog-show-cancel' is non-nil.

* etc/NEWS: Announce the change.

20 months agoFix tree-sitter typos
Yuan Fu [Wed, 28 Dec 2022 08:32:37 +0000 (00:32 -0800)]
Fix tree-sitter typos

* doc/lispref/parsing.texi (Tree-sitter major modes):
* lisp/progmodes/java-ts-mode.el:
* test/src/treesit-tests.el (treesit-defun-navigation-nested-4): Fix
typo.

20 months agoUpdate tree-sitter major modes to use the new Imenu facility
Yuan Fu [Wed, 28 Dec 2022 04:57:12 +0000 (20:57 -0800)]
Update tree-sitter major modes to use the new Imenu facility

See previous commit for more explanation.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-name): Handle more
types.
(c-ts-mode--imenu-1)
(c-ts-mode--imenu): Remove functions.
(c-ts-base-mode): Setup Imenu.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--imenu-1)
(csharp-ts-mode--imenu): Remove functions.
(csharp-ts-mode): Setup Imenu.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--imenu-1)
(java-ts-mode--imenu): Remove functions.
(java-ts-mode): Setup Imenu.
* lisp/progmodes/js.el (js--treesit-imenu-1)
(js--treesit-imenu): Remove functions.
(js--treesit-valid-imenu-entry): New function.
(js-ts-mode): Setup Imenu.
* lisp/progmodes/json-ts-mode.el (json-ts-mode--defun-name): Trim the
quotes.
(json-ts-mode--imenu-1)
(json-ts-mode--imenu): Remove functions.
(json-ts-mode): Setup Imenu.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--imenu)
(rust-ts-mode--imenu-1): Remove functions.
(rust-ts-mode): Setup Imenu.
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-base-mode): Remove treesit-defun-prefer-top-level, it's
not used anymore.  Setup Imenu.  Setup treesit-defun-name-function.
* lisp/textmodes/css-mode.el (css--treesit-imenu-1)
(css--treesit-imenu): Remove functions.
(css-ts-mode): Setup Imenu.
* lisp/textmodes/toml-ts-mode.el (toml-ts-mode--defun-name): Fix it
and add a fallback.
(toml-ts-mode--imenu-1)
(toml-ts-mode--imenu): Remove functions.
(toml-ts-mode): Setup Imenu.

20 months agoAdd tree-sitter helper functions for Imenu
Yuan Fu [Wed, 28 Dec 2022 04:37:29 +0000 (20:37 -0800)]
Add tree-sitter helper functions for Imenu

We didn't add an integration for Imenu because we aren't sure what
should it look like.  Now we have a pretty good idea.  All the major
modes copy-paste the two Imenu functions and tweaks them in a standard
way.  With the addition of treesit-defun-type-regexp and
treesit-defun-name-function, now is a good time to standardize Imenu
integration.

In the next commit we update all the major modes to use this
integration.

* doc/lispref/modes.texi (Imenu): Add manual.
* doc/lispref/parsing.texi (Tree-sitter major modes): Update manual.
* lisp/treesit.el (treesit-simple-imenu-settings): New varaible.
(treesit--simple-imenu-1)
(treesit-simple-imenu): New functions.
(treesit-major-mode-setup): Setup Imenu.

20 months agoFix treesit--things-around (bug#60355)
Yuan Fu [Wed, 28 Dec 2022 01:02:03 +0000 (17:02 -0800)]
Fix treesit--things-around (bug#60355)

Current implementation of treesit--things-around only searches forward
for REGEXP and go up the tree until it finds a valid thing, if nothing
matches it gives up.  This makes it sometimes miss defuns.  The new
implementation tries multiple times (of search forward + go up) until
it exhausts all possible defun nodes.

* lisp/treesit.el (treesit--things-around): New implementation.
(treesit--navigate-defun): Refactor to use treesit-node-top-level to
simplify code, and add some guards in the predicate function.
* test/src/treesit-tests.el:
(treesit--ert-defun-navigation-elixir-program): New variable.
(treesit-defun-navigation-nested-4): New test.