]> git.eshelyaron.com Git - emacs.git/log
emacs.git
19 months ago; * doc/emacs/custom.texi (Init Rebinding): Fix wording in last change.
Eli Zaretskii [Sat, 21 Jan 2023 07:50:59 +0000 (09:50 +0200)]
; * doc/emacs/custom.texi (Init Rebinding): Fix wording in last change.

19 months ago; Reword user documentation on binding keys in Lisp
Panagiotis Koutsourakis [Tue, 17 Jan 2023 18:57:41 +0000 (20:57 +0200)]
; Reword user documentation on binding keys in Lisp

* doc/emacs/custom.texi (Init Rebinding): Move the description of
'kbd' farther down.  (Bug#60859)

20 months agoMH-E: handle removal of mhparam libdir from nmh 1.8
Mike Kupfer [Mon, 16 Jan 2023 21:50:49 +0000 (13:50 -0800)]
MH-E: handle removal of mhparam libdir from nmh 1.8

* lisp/mh-e/mh-e.el (mh-variant-nmh-info): If "libdir" doesn't
work, try "libexecdir" (Bug#60952) (SF#491).

20 months agoUse point-min to anchor top-level constructs (bug#60602)
Theodor Thornhill [Fri, 20 Jan 2023 21:37:47 +0000 (22:37 +0100)]
Use point-min to anchor top-level constructs (bug#60602)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New anchor.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New
anchor.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): New anchor.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): New anchor.

20 months ago* lisp/org/ob-ruby.el: Fix outdated comments.
Dmitry Gutov [Fri, 20 Jan 2023 21:32:21 +0000 (23:32 +0200)]
* lisp/org/ob-ruby.el: Fix outdated comments.

20 months ago; ruby-ts-mode: Add a Version tag
Dmitry Gutov [Fri, 20 Jan 2023 17:25:12 +0000 (19:25 +0200)]
; ruby-ts-mode: Add a Version tag

20 months ago; ruby-ts-mode: Update font-lock features list in Commentary
Dmitry Gutov [Fri, 20 Jan 2023 17:08:22 +0000 (19:08 +0200)]
; ruby-ts-mode: Update font-lock features list in Commentary

20 months ago(project-try-vc): Add string-start and string-end anchors to marker-re
Dmitry Gutov [Fri, 20 Jan 2023 16:43:56 +0000 (18:43 +0200)]
(project-try-vc): Add string-start and string-end anchors to marker-re

* lisp/progmodes/project.el (project-try-vc):
Add string-start and string-end anchors to marker-re (bug#60956).

20 months agoMake `keymap-set-after' work for menus
Robert Pluim [Thu, 19 Jan 2023 15:05:45 +0000 (16:05 +0100)]
Make `keymap-set-after' work for menus

It still doesn't work for an AFTER that's a key, though, since
`key-parse' produces vectors, and keymaps contain integers.

* lisp/keymap.el (keymap-set-after): Only parse AFTER as a key if it's
a string.  For consistency, use `key-parse' on the definition if it's
a string, just like `keymap-set'.
* test/src/keymap-tests.el (keymap-tests--command-3): New dummy command.
(keymap-set-after-menus): New test.  Check that we can insert a menu
item after a specific entry.

20 months agoUse `key-parse' in `keymap-lookup'
Robert Pluim [Thu, 19 Jan 2023 14:58:51 +0000 (15:58 +0100)]
Use `key-parse' in `keymap-lookup'

It's stricter than `kbd', and doesn't try to do anything with key
sequences that look like macros.

* lisp/keymap.el (keymap-lookup): Use `key-parse' instead of `kbd'.
* test/src/keymap-tests.el (keymap-set-after-menus): Test the
`keymap-set-after' API.

20 months agoImprove `keymap-set-after' documentation
Robert Pluim [Thu, 19 Jan 2023 14:56:21 +0000 (15:56 +0100)]
Improve `keymap-set-after' documentation

* doc/lispref/keymaps.texi (Changing Key Bindings): Mention `key-valid-p'
(Modifying Menus): Correct description of KEY arg.

20 months agoHandle after arg correctly in `keymap-set-after'
Robert Pluim [Thu, 19 Jan 2023 13:34:10 +0000 (14:34 +0100)]
Handle after arg correctly in `keymap-set-after'

* lisp/keymap.el (keymap-set-after): AFTER: t means the same as nil,
so just change it to nil.  (Bug#60867)

20 months agoDon't load erc-goodies atop erc.el
F. Jason Park [Fri, 20 Jan 2023 04:19:40 +0000 (20:19 -0800)]
Don't load erc-goodies atop erc.el

* lisp/erc/erc.el: Commit c2d657e7c4fd9685591f2120007eabf78745919d
"Move ERC's core dependencies to a separate file" ironed out ERC's
interwoven dependencies for the better but didn't cleanly sidestep the
goodies interdependency, specifically with regard to custom options.
This reverts the tiny portion impacting this aspect by once again
requiring `erc-goodies' at the very end of ERC's main library. Special
thanks to Libera.Chat user jrm for reporting this bug.

20 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Fri, 20 Jan 2023 11:20:08 +0000 (12:20 +0100)]
; * etc/NEWS: Fix typos.

20 months agoMake tree-sitter based modes optional
Eli Zaretskii [Fri, 20 Jan 2023 08:28:26 +0000 (10:28 +0200)]
Make tree-sitter based modes optional

* lisp/progmodes/c-ts-mode.el: Update Commentary.  Make
'auto-mode-alist' update conditional on the tree-sitter and
grammar libraries being available.
* lisp/progmodes/cmake-ts-mode.el:
* lisp/progmodes/csharp-mode.el:
* lisp/progmodes/dockerfile-ts-mode.el:
* lisp/progmodes/go-ts-mode.el:
* lisp/progmodes/java-ts-mode.el:
* lisp/progmodes/js.el:
* lisp/progmodes/json-ts-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/ruby-ts-mode.el:
* lisp/progmodes/typescript-ts-mode.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/toml-ts-mode.el:
* lisp/textmodes/yaml-ts-mode.el: Make 'auto-mode-alist' update
for tree-sitter based modes be conditional on the tree-sitter and
grammar libraries being available.  (Bug#60559)

20 months ago; (ruby-ts--predefined-variables): Make it a little shorter
Dmitry Gutov [Fri, 20 Jan 2023 03:41:39 +0000 (05:41 +0200)]
; (ruby-ts--predefined-variables): Make it a little shorter

20 months agoruby-ts-mode: Claw back half of the performance drop from last change
Dmitry Gutov [Fri, 20 Jan 2023 03:35:12 +0000 (05:35 +0200)]
ruby-ts-mode: Claw back half of the performance drop from last change

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--builtin-method-p):
New function.
(ruby-ts--font-lock-settings): Use it instead of :match.

20 months ago(ruby-ts-mode): Rename 'builtin-functions' to 'builtin-function'
Dmitry Gutov [Fri, 20 Jan 2023 02:14:38 +0000 (04:14 +0200)]
(ruby-ts-mode): Rename 'builtin-functions' to 'builtin-function'

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings)
(ruby-ts-mode): Rename 'builtin-functions' to 'builtin-function',
for consistency with similar features.

20 months agoruby-ts-mode: Highlight builtin methods
Dmitry Gutov [Fri, 20 Jan 2023 01:56:44 +0000 (03:56 +0200)]
ruby-ts-mode: Highlight builtin methods

* lisp/progmodes/ruby-mode.el (ruby-builtin-methods-with-reqs)
(ruby-builtin-methods-no-reqs): New constants, extracted.
(ruby-font-lock-keywords): Replace values with references.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--builtin-methods): New
variable.  Construct regexp from aforementioned constants' values.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Use it.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Add new font-lock feature: builtin-functions.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--predefined-constants)
(ruby-ts--predefined-variables): Unrelated to the rest of the
patch, add string-start and string-end anchors.

20 months ago; ruby-ts-mode.el: Add customize-group mention to commentary
Dmitry Gutov [Fri, 20 Jan 2023 01:54:36 +0000 (03:54 +0200)]
; ruby-ts-mode.el: Add customize-group mention to commentary

20 months agoFix c-ts-mode indent (bug#60873)
Yuan Fu [Thu, 19 Jan 2023 22:46:17 +0000 (14:46 -0800)]
Fix c-ts-mode indent (bug#60873)

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--statement-offset): Handle the edge case.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add a test.

20 months agoFix various problems in treesit-explore-mode (bug#60800)
Yuan Fu [Thu, 19 Jan 2023 22:22:56 +0000 (14:22 -0800)]
Fix various problems in treesit-explore-mode (bug#60800)

* lisp/treesit.el:
(treesit--explorer-kill-explorer-buffer): New function.
(treesit-explore-mode):
1. Move prompt for language earlier, and terminate early if language
not available.
2. Make sure desktop-save doesn't save the explorer buffer.
3. Kill the explorer buffer when the source buffer is killed.

20 months ago; * lisp/treesit.el (treesit-font-lock-fontify-region): Minor fix.
Yuan Fu [Thu, 19 Jan 2023 19:53:14 +0000 (11:53 -0800)]
; * lisp/treesit.el (treesit-font-lock-fontify-region): Minor fix.

The check for treesit--font-lock-fast-mode is not really necessary,
but anyway.

20 months ago; Update tree-sitter major mode manual
Yuan Fu [Wed, 18 Jan 2023 23:45:29 +0000 (15:45 -0800)]
; Update tree-sitter major mode manual

* doc/lispref/parsing.texi (Tree-sitter Major Modes): Update.

20 months ago; Add commentary and dostring in c-ts-mode
Yuan Fu [Wed, 18 Jan 2023 23:32:12 +0000 (15:32 -0800)]
; Add commentary and dostring in c-ts-mode

* lisp/progmodes/c-ts-mode.el: Add commentary.
(c-ts-mode, c++-ts-mode): Add docstring.

20 months agoFix an oversight in advice.el
Michael Heerdegen [Wed, 18 Jan 2023 11:32:05 +0000 (12:32 +0100)]
Fix an oversight in advice.el

This fixes an oversight from 77c3c464a16: "* lisp/emacs-lisp/advice.el
(ad-advised-functions): Make it a plain list" that caused an issue as
reported in Bug#60893.
* lisp/emacs-lisp/advice.el (ad-read-advised-function): Adjust to
handle the new type of elements of `ad-advised-functions'.

20 months ago; * etc/NEWS: Rearrange instructions for building tree-sitter grammars.
Eli Zaretskii [Thu, 19 Jan 2023 18:13:54 +0000 (20:13 +0200)]
; * etc/NEWS: Rearrange instructions for building tree-sitter grammars.

20 months ago(treesit-simple-indent-presets): Have n-p-gp check for grandparent's presence
Dmitry Gutov [Thu, 19 Jan 2023 17:43:19 +0000 (19:43 +0200)]
(treesit-simple-indent-presets): Have n-p-gp check for grandparent's presence

* lisp/treesit.el (treesit-simple-indent-presets): Have n-p-gp
check for grandparent's presence before checking its type.

20 months ago; ruby-ts--indent-rules: Minor cleanup
Dmitry Gutov [Thu, 19 Jan 2023 16:31:57 +0000 (18:31 +0200)]
; ruby-ts--indent-rules: Minor cleanup

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Remove
the (match "begin" "assignment") rule.  The catch-all has the same
effect.  Update a comment referring to rules removed previously.

20 months agoruby-toggle-block: Fix in ruby-ts-mode
Dmitry Gutov [Thu, 19 Jan 2023 15:42:05 +0000 (17:42 +0200)]
ruby-toggle-block: Fix in ruby-ts-mode

* lisp/progmodes/ruby-mode.el (ruby-toggle-block): Make it work
with ruby-ts-mode.  ruby-forward-sexp checks ruby-use-smie.

20 months ago(ruby-ts--indent-rules): Indent inside empty parens properly
Dmitry Gutov [Thu, 19 Jan 2023 15:31:43 +0000 (17:31 +0200)]
(ruby-ts--indent-rules): Indent inside empty parens properly

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Consider the case when there are no arguments inside the call yet.

* test/lisp/progmodes/ruby-ts-mode-tests.el
(ruby-ts-indent-call-no-args): Add test.

20 months ago; * doc/emacs/modes.texi (Choosing Modes): Add index entries.
Eli Zaretskii [Thu, 19 Jan 2023 14:15:13 +0000 (16:15 +0200)]
; * doc/emacs/modes.texi (Choosing Modes): Add index entries.

20 months agoFix bug in 'sieve-manage--append-to-log'
Kai Tetzlaff [Thu, 19 Jan 2023 02:16:14 +0000 (03:16 +0100)]
Fix bug in 'sieve-manage--append-to-log'

* lisp/net/sieve-manage.el (sieve-manage--append-to-log): Fix
log buffer creation.  (Bug#54154)  Do not merge to master.

20 months agoCC Mode: Prevent two classes of "type" prematurely entering c-found-types
Alan Mackenzie [Thu, 19 Jan 2023 10:59:10 +0000 (10:59 +0000)]
CC Mode: Prevent two classes of "type" prematurely entering c-found-types

This fixes bug #60769.  The two classes of "type" are foo and bar in
"foo d(bar () ...)", where the d could be a mistyped C-M-d.

* list/progmodes/cc-engine.el (c-forward-decl-or-cast-1): New local variable
got-arglist.  Refactor a sequence of enclosed `if' forms into a `cond' form.
Set got-arglist when needed.  In CASE 2, set unsafe-maybe to inhibit foo
being entered into c-found-types.  In CASE 19, likewise set unsafe-maybe, to
inhibit bar entering c-found-types.

20 months agoruby-ts-mode: Use font-lock-constant-face for true/false/nil
Dmitry Gutov [Thu, 19 Jan 2023 03:43:10 +0000 (05:43 +0200)]
ruby-ts-mode: Use font-lock-constant-face for true/false/nil

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Use font-lock-constant-face for true/false/nil.

20 months ago(ruby-ts--indent-rules): Add a rule for continuation of a hash pair
Dmitry Gutov [Thu, 19 Jan 2023 03:26:03 +0000 (05:26 +0200)]
(ruby-ts--indent-rules): Add a rule for continuation of a hash pair

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Add a rule for continuation of a hash pair.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.

20 months ago(ruby-ts--parent-call-or-bol): Handle more cases with nested literals
Dmitry Gutov [Thu, 19 Jan 2023 03:10:05 +0000 (05:10 +0200)]
(ruby-ts--parent-call-or-bol): Handle more cases with nested literals

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--parent-call-or-bol):
Handle more cases with nested literals.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.

20 months ago(ruby-ts--statement-container-regexp): Remove "parenthesized_statements"
Dmitry Gutov [Thu, 19 Jan 2023 01:51:51 +0000 (03:51 +0200)]
(ruby-ts--statement-container-regexp): Remove "parenthesized_statements"

* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--statement-container-regexp): Remove
"parenthesized_statements", it's not really a statement container,
not one we'd use for indentation alignment anyway.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.

20 months agoruby-ts-mode: Handle indent in parenless calls much closer to ruby-mode
Dmitry Gutov [Thu, 19 Jan 2023 01:38:58 +0000 (03:38 +0200)]
ruby-ts-mode: Handle indent in parenless calls much closer to ruby-mode

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--parent-call-or-bol):
New function.
(ruby-ts--indent-rules): Use it for cases which need special
anchoring logic when inside a parenless method call.
Remove the ad-hoc handling of pair-hash-pair etc indentation,
which was there only for the parenless cases, apparently.
Have "No paren, ruby-parenless-call-arguments-indent is nil" case
align to the statement, if only because ruby-mode does that.

* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-parenless-call-arguments-indent.rb.

20 months agoFix split-window-below for the case when split-window-keep-point is nil.
Juri Linkov [Wed, 18 Jan 2023 18:24:26 +0000 (20:24 +0200)]
Fix split-window-below for the case when split-window-keep-point is nil.

* lisp/window.el (split-window-below): Don't try to move point when
split-window-keep-point is nil and window-to-split is not the selected window
or nil (that defaults to the selected window) because code makes sense
only for the selected window.
(split-window-below, split-window-right): Improve docstrings (bug#60886)

20 months agoRebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible with search-map
Juri Linkov [Wed, 18 Jan 2023 18:05:19 +0000 (20:05 +0200)]
Rebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible with search-map

Also it's compatible with 'M-s c' (isearch-toggle-case-fold)
used during Isearch.  Also makes possible to use the global keybinding
'M-c' (capitalize-dwim) in the minibuffer.

* doc/lispref/minibuf.texi (Text from Minibuffer): Rename ‘M-c’ to ‘M-s c’.

* lisp/replace.el (read-regexp-map): Rebind ‘M-c’ to ‘M-s c’ (bug#60741).
(read-regexp-toggle-case-fold): Rename from read-regexp-toggle-case-folding
to more standard name.

20 months ago* lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible with Dired
Juri Linkov [Wed, 18 Jan 2023 17:55:10 +0000 (19:55 +0200)]
* lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible with Dired

(vc-dir-mode-map): Replace ‘%’ for vc-dir-mark-by-regexp
with ‘% m’ in regexp-map and ‘* %’ in mark-map (bug#60887).

* doc/emacs/maintaining.texi (VC Directory Commands): Replace ‘%’
with ‘% m’ and ‘* %’.  Mention vc-dir-mark-registered-files.

20 months agoUse proper types for Eshell warnings
Jim Porter [Wed, 18 Jan 2023 04:51:15 +0000 (20:51 -0800)]
Use proper types for Eshell warnings

* lisp/eshell/esh-var.el (eshell-get-variable):
* lisp/eshell/em-basic (eshell/echo): Don't use ':warning'; that's a
warning level, not a warning type.

20 months ago; Avoid byte-compiler warning in cc-fonts.el.
Eli Zaretskii [Wed, 18 Jan 2023 15:22:48 +0000 (17:22 +0200)]
; Avoid byte-compiler warning in cc-fonts.el.

20 months ago; Clarify doc strings of some functions in files.el
Eli Zaretskii [Wed, 18 Jan 2023 14:19:10 +0000 (16:19 +0200)]
; Clarify doc strings of some functions in files.el

* lisp/files.el (file-name-sans-extension, file-name-extension)
(file-name-sans-versions): Doc fixes.  (Bug#60929)

20 months agoImprove the documentation of 'auto-mode-alist' search
Eli Zaretskii [Wed, 18 Jan 2023 14:01:12 +0000 (16:01 +0200)]
Improve the documentation of 'auto-mode-alist' search

* doc/emacs/modes.texi (Choosing Modes): Expand the description of
"recursive extension stripping" using 'auto-mode-alist'.
(Bug#60930)

20 months ago; Fix minor mistakes in documentation
Ikumi Keita [Wed, 18 Jan 2023 12:28:59 +0000 (14:28 +0200)]
; Fix minor mistakes in documentation

* lisp/emacs-lisp/cl-macs.el (cl-letf): Correct Info reference.

* doc/lispref/strings.texi (String Conversion): Fix typo.

(Bug#60926)

20 months ago; * lisp/treesit.el (treesit-font-lock-fontify-region): Minor fix.
Yuan Fu [Wed, 18 Jan 2023 06:52:22 +0000 (22:52 -0800)]
; * lisp/treesit.el (treesit-font-lock-fontify-region): Minor fix.

20 months agoRevert "Revert "Add c-or-c++-ts-mode (bug#59613)""
Yuan Fu [Wed, 18 Jan 2023 06:30:09 +0000 (22:30 -0800)]
Revert "Revert "Add c-or-c++-ts-mode (bug#59613)""

This reverts commit d46f7f4edcce14e6cbd8e2d7091dbabbe08defc1.

Aaaactually, we need this, otherwise we can't use tree-sitter based C
mode for header files.

20 months agoMake it harder to misactivate tree-sitter font-lock fast mode
Yuan Fu [Wed, 18 Jan 2023 06:26:21 +0000 (22:26 -0800)]
Make it harder to misactivate tree-sitter font-lock fast mode

This has been brought up in bug#60691 and bug#60223.  I proposed a fix
by testing the size of the tree rather than measuring the query time.
But after some thought, I fear that just looking at the size will give
us false-negatives.  So I kept the time-based activation, just added a
grace count to reduce false-positives.

* lisp/treesit.el:
(treesit--font-lock-fast-mode-grace-count): New variable.
(treesit--font-lock-notifier): Only activate fast mode after 5
offenses.

20 months ago; * src/treesit.c: Remove unused boilerplate.
Yuan Fu [Tue, 17 Jan 2023 17:37:04 +0000 (09:37 -0800)]
; * src/treesit.c: Remove unused boilerplate.

These two functions are not used after 7c61a304104.

20 months agoruby-ts-mode: Obey the option ruby-method-call-indent
Dmitry Gutov [Wed, 18 Jan 2023 01:21:32 +0000 (03:21 +0200)]
ruby-ts-mode: Obey the option ruby-method-call-indent

* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--method-call-indent-p): New function.
(ruby-ts--indent-rules): Use it.

* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-method-call-indent.rb.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Add explicit value for ruby-method-call-indent.

20 months agoruby-ts-mode: Obey the option ruby-after-operator-indent
Dmitry Gutov [Wed, 18 Jan 2023 00:55:09 +0000 (02:55 +0200)]
ruby-ts-mode: Obey the option ruby-after-operator-indent

* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--after-op-indent-p): New function.
(ruby-ts--indent-rules): Use it.

* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-after-operator-indent.rb.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Make sure indentation vars are at their default values.

20 months agoruby-ts-mode: Fix indent after operator or conditional
Dmitry Gutov [Wed, 18 Jan 2023 00:40:00 +0000 (02:40 +0200)]
ruby-ts-mode: Fix indent after operator or conditional

Make it match ruby-mode's indentation behavior.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--binary-indent-anchor):
New function.
(ruby-ts--indent-rules): Use it instead of a composite matcher.
Add a rule for 'conditional'.
(ruby-ts--assignment-ancestor, ruby-ts--is-in-condition)
(ruby-ts--endless-method): Remove.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Add examples.

20 months agoruby-ts-mode: Fix/change indentation of a continuation method call
Dmitry Gutov [Tue, 17 Jan 2023 22:55:09 +0000 (00:55 +0200)]
ruby-ts-mode: Fix/change indentation of a continuation method call

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix/change indentation of a continuation method call.

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

20 months agoruby-ts-mode: Fix indent inside parenthesized_expr and else/end after unless
Dmitry Gutov [Tue, 17 Jan 2023 22:41:14 +0000 (00:41 +0200)]
ruby-ts-mode: Fix indent inside parenthesized_expr and else/end after unless

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix indentation for parenthesized_expression and else/end after
'unless'.

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

20 months agoruby-ts-mode: Fix the rules for hanging arrays and hashes
Dmitry Gutov [Tue, 17 Jan 2023 21:46:41 +0000 (23:46 +0200)]
ruby-ts-mode: Fix the rules for hanging arrays and hashes

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix the rules for hanging arrays and hashes (to line up to
parent-bol instead of the opening brace).

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
New file with examples.

* test/lisp/progmodes/ruby-ts-mode-tests.el: Use it here.

20 months agoAdd more detail about how to invoke Eshell commands
Jim Porter [Mon, 16 Jan 2023 02:35:31 +0000 (18:35 -0800)]
Add more detail about how to invoke Eshell commands

* doc/misc/eshell.texi (Variables): Move footnote explaining "REPL"
from here...
(Top): ... to its first use here.
(Commands): Move explanation about kernel functions to here.
(Invocation): Describe command form and Lisp form.  Fix documentation
about priority of commands in command form.
(Arguments): Add a cross reference to the Invocation node.

20 months agoCC Mode: On removal of "typedef", remove pertinent types from c-found-types
Alan Mackenzie [Tue, 17 Jan 2023 18:15:45 +0000 (18:15 +0000)]
CC Mode: On removal of "typedef", remove pertinent types from c-found-types

For this purpose, record the type names declared by typedef in a text
property, c-typedef, on the typedef.  On any change to that "typedef" or a
type, remove the old identifier(s) from c-found-types.

This should fix bug #59671.

* lisp/progmodes/cc-defs.el (c-search-forward-non-nil-char-property): New
macro.

* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): Move the scope of
identifier-start from the "inner" let form to the outer one.  Amend the
return value such that the middle element of the second element is now the
position of the "typedef", not merely non-nil.

* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Disregard the LIMIT
parameter when fontifying the declarators of a typedef construct.  Also in
this case, set the c-typedef text property on the "typedef" to the list of
declared types.  Amend this list when these declared types change.
(c-font-lock-single-decl): Massage the `types' argument given to
c-font-lock-declarators.
(c-font-lock-cut-off-declarators): Amend to work when the starting point of
the fontification is inside a brace block.

* lisp/progmodes/cc-mode.el (c-before-change-de-typedef)
(c-after-change-de-typedef): New functions.
(c-update-new-id): Replace the erroneous c-end-of-current-token with a clause
containing c-forward-token-2.
(c-before-change): Call c-before-change-de-typedef.
(c-after-change): Call c-after-change-de-typedef.

20 months ago; Relax timeouts for failing ERC test
F. Jason Park [Tue, 17 Jan 2023 14:26:34 +0000 (06:26 -0800)]
; Relax timeouts for failing ERC test

* test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld: Bump
timeouts to 10 seconds.
* test/lisp/erc/resources/base/netid/bouncer/foonet-again.eld: Bump
timeouts to 10 seconds.

20 months agoDon't preserve non-module minor modes in erc-open
F. Jason Park [Fri, 13 Jan 2023 14:03:15 +0000 (06:03 -0800)]
Don't preserve non-module minor modes in erc-open

* lisp/erc/erc-common.el (define-erc-module): Add symbol property
`erc-module' to minor modes defined as part of a module.
* lisp/erc/erc.el (erc--merge-local-modes): Be more conservative when
persisting local minor-mode state across ERC sessions.  User and
third-party modes that were not defined via `define-erc-modules'
should be left alone.
(erc-open): Run major-mode hooks and enable minor modes after prompt
has been set up.  This ensures that module-setup code can access a
fully initialized `erc-input-marker'.
* test/lisp/erc/erc-tests.el (erc--merge-local-modes): Add mocks for
`erc-module' symbol property and a test case covering some foreign ERC
mode.
(define-erc-module--global, define-erc-module--local): Expect the
`erc-module' symbol property to be defined for mode symbols and
aliases.  (Bug#60784.)

20 months agoUse correct buffer for local-module vars in erc-open
F. Jason Park [Tue, 17 Jan 2023 07:05:16 +0000 (23:05 -0800)]
Use correct buffer for local-module vars in erc-open

* lisp/erc/erc.el (erc--target-priors): New internal variable to do
for target buffers what `erc--server-reconnecting' does for server
buffers.
(erc-open): Source the state of a local module's mode variable from
its actual buffer rather than its server buffer.  Additionally, make
all local variables from a prior session available to
module-activation functions and `erc-mode' hooks, even when
`erc-reuse-buffers' is nil.  This bug arrived with the introduction of
"local-modules" (bug#57955).

* test/lisp/erc/erc-scenarios-base-local-modules.el
(erc-scenarios-base-local-modules--toggle-helpers): Remove useless
`with-current-buffer'.
(erc-scenarios-base-local-modules--local-var, erc--phony-sblm--enable,
erc--phony-sblm--disable, erc--phony-sblm--mode): Add fake local
module and data var for test scenario.
(erc-scenarios-base-local-modules--var-persistence) Add slightly hacky
test case with promise to improve later when splitting the file.

20 months ago; Avoid plist-get as generalized var in erc-compat
F. Jason Park [Tue, 10 Jan 2023 19:59:57 +0000 (11:59 -0800)]
; Avoid plist-get as generalized var in erc-compat

* lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search): The
gv expander for `plist-get' was added in Emacs 28.  But ERC still
supports 27, as of this function's introduction, in Emacs 29.

20 months agoFix display of warnings on w32 console
Eli Zaretskii [Tue, 17 Jan 2023 13:44:51 +0000 (15:44 +0200)]
Fix display of warnings on w32 console

* lisp/emacs-lisp/warnings.el (warnings-suppress): Use alternative
symbol for TTY frames on MS-Windows.

20 months agoFix buffer-list-update-hook for indirect buffers
Basil L. Contovounesios [Wed, 11 Jan 2023 16:34:07 +0000 (16:34 +0000)]
Fix buffer-list-update-hook for indirect buffers

Fmake_indirect_buffer can be told whether to run buffer hooks since
bug#49160, but until now it ran buffer-list-update-hook irrespective
of this.

* src/buffer.c (Fmake_indirect_buffer): Don't run
buffer-list-update-hook when called with a non-nil
INHIBIT-BUFFER-HOOKS argument.
(run_buffer_list_update_hook): Don't special-case NULL argument, as
no such callers remain.

* test/src/buffer-tests.el
(buffer-tests-inhibit-buffer-hooks-indirect): Test whether indirect
buffer hooks are run regardless of whether base buffer hooks are
inhibited.  Check that all three buffer hooks, not just
kill-buffer-query-functions, are inhibited.

20 months ago; Fix tree-sitter indent anchor preset
Yuan Fu [Tue, 17 Jan 2023 09:20:51 +0000 (01:20 -0800)]
; Fix tree-sitter indent anchor preset

* lisp/treesit.el:
(treesit-simple-indent-presets): Fix prev-adaptive-prefix.

20 months agoFix treesit-node-first-child-for-pos (bug#60127)
Yuan Fu [Tue, 17 Jan 2023 08:57:54 +0000 (00:57 -0800)]
Fix treesit-node-first-child-for-pos (bug#60127)

The problem is due to a bug in ts_node_first_child_for_pos, but
tree-sitter is moving pretty slowly right now so I reimplemented a
correct version of it in treesit.c.

* src/treesit.c (treesit_cursor_first_child_for_byte): New function.
(Ftreesit_node_first_child_for_pos): Use the new function.

20 months ago; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor change.
Yuan Fu [Tue, 17 Jan 2023 04:32:15 +0000 (20:32 -0800)]
; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor change.

20 months agoFix hfy-exclude-file-rules (bug#60562)
Mattias Engdegård [Sun, 15 Jan 2023 14:23:44 +0000 (15:23 +0100)]
Fix hfy-exclude-file-rules (bug#60562)

* lisp/htmlfontify.el (hfy-exclude-file-rules):
Fix broken defcustom type; no longer fails test-custom-opts.
Fix regexps not to use newline-sensitive patterns like `.` and `$`
which do not make sense when matching file names.
Better doc string.
* lisp/htmlfontify.el (hfy-list-files): Simplify regexp argument.

20 months agoCC Mode: Prevent ids in temporary "declarators" getting into c-found-types
Alan Mackenzie [Mon, 16 Jan 2023 17:44:44 +0000 (17:44 +0000)]
CC Mode: Prevent ids in temporary "declarators" getting into c-found-types

This should fix bug #60765.  In the scenario type an identifier in front of
foo (bar, baz), as when started a new statement.  This temporarily makes the
function call a declarator, and bar and baz types.  Don't enter bar and baz
into c-found-types.

* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1) (CASE 6): When a
'maybe type triggers this case, set `unsafe-maybe' to non-nil.

20 months ago; Fix more quoting in w32fns.c.
Eli Zaretskii [Mon, 16 Jan 2023 14:55:01 +0000 (16:55 +0200)]
; Fix more quoting in w32fns.c.

20 months ago; Avoid byte-compiler warning in eglot.el
Eli Zaretskii [Mon, 16 Jan 2023 14:52:48 +0000 (16:52 +0200)]
; Avoid byte-compiler warning in eglot.el

* lisp/progmodes/eglot.el (eglot): Rename INTERACTIVE to avoid
byte-compiler warning.  Update the doc string.  (Bug#60557)

20 months ago; * lisp/progmodes/eglot.el: Remove stray space.
Eli Zaretskii [Mon, 16 Jan 2023 14:08:46 +0000 (16:08 +0200)]
; * lisp/progmodes/eglot.el: Remove stray space.

20 months ago; * src/w32fns.c: Fix quoting. Patch by Arash Esbati <arash@gnu.org>.
Eli Zaretskii [Mon, 16 Jan 2023 14:00:18 +0000 (16:00 +0200)]
; * src/w32fns.c: Fix quoting.  Patch by Arash Esbati <arash@gnu.org>.

20 months agoFix M-x eglot prompt when connection already exists (bug#60557)
João Távora [Mon, 16 Jan 2023 11:48:09 +0000 (11:48 +0000)]
Fix M-x eglot prompt when connection already exists (bug#60557)

Before this change, if a current connection existed at the time of M-x
eglot, user would be first asked to enter into M-x eglot's interactive
spec details about new command line arguments, and only afterwards be
prompted about what to do with the current connection (which could be
to reconnect to it using the same arguments, or tear it down and make
a new one).

This is very confusing, as users may not be fully aware of the
distinction between "reconnect" vs "disconnect-and-connect".  They
might not know if any new command line arguments provided are taking
effect or not.

This change simplifies this and removes the option to "reconnect
instead" from M-x eglot (users can do that at any time via M-x
eglot-reconnect).  It also ensures that users are informed about a
current connection before asking to enter new command line arguments
and not the other way round.

* lisp/progmodes/eglot.el (eglot): Rework.

20 months agoFix tree-sitter indent preset function (bug#60270)
Yuan Fu [Mon, 16 Jan 2023 08:23:47 +0000 (00:23 -0800)]
Fix tree-sitter indent preset function (bug#60270)

* lisp/treesit.el (treesit-simple-indent-presets): Fix
prev-adaptive-prefix so it doesn't return nil if the previous line has
no prefix.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

20 months agoruby-ts-mode: Support the option ruby-block-indent
Dmitry Gutov [Mon, 16 Jan 2023 03:17:05 +0000 (05:17 +0200)]
ruby-ts-mode: Support the option ruby-block-indent

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--block-indent-anchor):
New function.
(ruby-ts--indent-rules): Use it.

* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-block-indent.rb.

20 months agoImprove indentation for jsx
Theodor Thornhill [Sun, 15 Jan 2023 20:31:16 +0000 (21:31 +0100)]
Improve indentation for jsx

* lisp/progmodes/js.el (js--treesit-indent-rules): Use more parent
anchors and fix typo with wrong indent offset variable.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Use more parent anchors.

20 months ago* lisp/subr.el (while-let): Fix docs if-let->if-let* (bug#60758).
Sean Whitton [Sun, 15 Jan 2023 17:01:41 +0000 (10:01 -0700)]
* lisp/subr.el (while-let): Fix docs if-let->if-let* (bug#60758).

20 months agoRevert "* lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758)."
Sean Whitton [Sun, 15 Jan 2023 16:57:41 +0000 (09:57 -0700)]
Revert "* lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758)."

This reverts commit 083badc9c122a802080552e7771e78ee47c01e3c.

20 months agoBump use-package version for Emacs 29.1
Stefan Kangas [Sun, 15 Jan 2023 13:30:46 +0000 (14:30 +0100)]
Bump use-package version for Emacs 29.1

* lisp/use-package/use-package.el: Bump version to 2.4.5.

20 months agoImprove error message from sqlite-mode.el
Eli Zaretskii [Sun, 15 Jan 2023 10:06:54 +0000 (12:06 +0200)]
Improve error message from sqlite-mode.el

* lisp/sqlite-mode.el (sqlite-mode-open-file): Add error
checking.  (Bug#60490)

20 months ago; Fix last change: remove unused @anchor.
Eli Zaretskii [Sun, 15 Jan 2023 09:52:46 +0000 (11:52 +0200)]
; Fix last change: remove unused @anchor.

20 months ago; Update htmlfontify documentation
Xi Lu [Sun, 15 Jan 2023 09:49:45 +0000 (11:49 +0200)]
; Update htmlfontify documentation

* doc/misc/htmlfontify.texi (Customization): Remove 'hfy-find-cmd',
add 'hfy-exclude-file-rules'.
(Requirements): Remove text about 'find' program.

20 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Sun, 15 Jan 2023 09:19:20 +0000 (11:19 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

20 months ago; * lisp/files.el (insert-directory-wildcard-in-dir-p): Doc fix.
Eli Zaretskii [Sun, 15 Jan 2023 09:18:44 +0000 (11:18 +0200)]
; * lisp/files.el (insert-directory-wildcard-in-dir-p): Doc fix.

20 months ago; Add more c-ts-mode indent and filling tests
Yuan Fu [Sat, 14 Jan 2023 07:42:44 +0000 (23:42 -0800)]
; Add more c-ts-mode indent and filling tests

* test/lisp/progmodes/c-ts-mode-resources/filling.erts: New file.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: More tests.
* test/lisp/progmodes/c-ts-mode-tests.el:
(c-ts-mode-test-filling): new test.

20 months agoFix c-ts-mode block comment indentation (bug#60270)
Yuan Fu [Sun, 15 Jan 2023 09:01:38 +0000 (01:01 -0800)]
Fix c-ts-mode block comment indentation (bug#60270)

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--comment-2nd-line-anchor): Handle another edge case.

20 months agoFix c-ts-mode label indent
Yuan Fu [Sun, 15 Jan 2023 08:21:10 +0000 (00:21 -0800)]
Fix c-ts-mode label indent

Fix indentation of the statement right under a label.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Fix.
(c-ts-mode--top-level-label-matcher): Fix.

20 months agoFix statement indent for c-ts-mode (bug#59686) (bug#60280)
Yuan Fu [Sun, 15 Jan 2023 08:16:58 +0000 (00:16 -0800)]
Fix statement indent for c-ts-mode (bug#59686) (bug#60280)

Instead of trying to figure out the correct anchor, now we just count
the layers of {} blocks between the node and the root node.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Use new offset functions
c-ts-mode--close-bracket-offset and c-ts-mode--statement-offset.
(c-ts-mode--bracket-children-anchor): Remove function.
(c-ts-mode--top-level-label-matcher): New variable.
(c-ts-mode--statement-offset)
(c-ts-mode--close-bracket-offset): New offset functions.

20 months agoAllow offset in tree-sitter indent rules to be functions
Yuan Fu [Sun, 15 Jan 2023 08:15:25 +0000 (00:15 -0800)]
Allow offset in tree-sitter indent rules to be functions

This is needed for fixing C indentation.  See next comment.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el (treesit-simple-indent): Try evaluating OFFSET as a
function if it's not integer nor variable.

20 months ago; Minor change in c-ts-mode--indent-styles
Yuan Fu [Sun, 15 Jan 2023 04:53:10 +0000 (20:53 -0800)]
; Minor change in c-ts-mode--indent-styles

; * lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Move top-level label rule to GNU style.

20 months agoSupport filling line comments in c-ts-mode
Yuan Fu [Sat, 14 Jan 2023 07:31:18 +0000 (23:31 -0800)]
Support filling line comments in c-ts-mode

Now we handle line comments separately because for line comments, each
line is an individual node, unlike block comments, where the whole
block comment is a single node.  fill-comment-paragraph turns out to
do the job perfectly fine.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--fill-paragraph): Extract out most parts into
c-ts-mode--fill-block-comment.
(c-ts-mode--fill-block-comment): New extracted function.

20 months ago; Fix c-ts-mode filling
Yuan Fu [Sat, 14 Jan 2023 07:05:45 +0000 (23:05 -0800)]
; Fix c-ts-mode filling

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--comment-regexp): New variable.
(c-ts-mode--fill-paragraph): Use the new variable, and make sure
start-marker is always initialized.

20 months agoFix expansion of wildcards in ls-lisp.el
Eli Zaretskii [Sun, 15 Jan 2023 08:47:24 +0000 (10:47 +0200)]
Fix expansion of wildcards in ls-lisp.el

* lisp/ls-lisp.el (ls-lisp--dired): Fix error message text.
Handle the case of a wildcard specifying directories.  (Bug#60819)

20 months agoFix messages displayed when diary is shown
Eli Zaretskii [Sun, 15 Jan 2023 06:10:33 +0000 (08:10 +0200)]
Fix messages displayed when diary is shown

* lisp/calendar/diary-lib.el (diary-list-entries): Display the
"...done" message only if there's no important message in the
echo-area.  (Bug#60795)

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

20 months ago; Fix typos
Stefan Kangas [Sun, 15 Jan 2023 01:10:32 +0000 (02:10 +0100)]
; Fix typos

20 months agoAdd constructor_declaration as java-ts-mode defun
Theodor Thornhill [Sat, 14 Jan 2023 21:39:08 +0000 (22:39 +0100)]
Add constructor_declaration as java-ts-mode defun

* lisp/progmodes/java-ts-mode.el (java-ts-mode): Extend
treesit-defun-type-regexp.

20 months agoFurther improvement for non-string values in pcomplete
Gregory Heytings [Wed, 4 Jan 2023 16:48:03 +0000 (16:48 +0000)]
Further improvement for non-string values in pcomplete

* lisp/pcomplete.el (pcomplete-arg): Use the string representation
of the argument value instead of the text representation of the
argument.  Return the value, even when it is not a string, when
index is 'last'.  Fixes bug#60464.