]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years ago; Improve documentation of 'setopt'
Eli Zaretskii [Sun, 18 Dec 2022 12:26:54 +0000 (14:26 +0200)]
; Improve documentation of 'setopt'

* doc/lispref/variables.texi (Setting Variables): Note about the
differences between 'setopt' and 'customize-set-variable'.

2 years agoruby-mode: Support endless methods (bug#54702)
Dmitry Gutov [Sun, 18 Dec 2022 12:01:47 +0000 (14:01 +0200)]
ruby-mode: Support endless methods (bug#54702)

* lisp/progmodes/ruby-mode.el (ruby-endless-method-head-re):
New constant.
(ruby-smie-grammar): New token.
(ruby-smie--forward-token, ruby-smie--backward-token):
Recognize it.
(ruby-smie-rules): Indentation support.
(ruby-add-log-current-method): Support here too.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-after-endless-method): New test.

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

2 years ago; * lisp/progmodes/sql.el (sql-product-interactive): Doc fix (bug#60175)
Eli Zaretskii [Sun, 18 Dec 2022 11:54:43 +0000 (13:54 +0200)]
; * lisp/progmodes/sql.el (sql-product-interactive): Doc fix (bug#60175)

2 years ago* lisp/cus-edit.el (setopt--set): Warn instead of rasing an error
Philip Kaludercic [Sat, 17 Dec 2022 16:29:24 +0000 (17:29 +0100)]
* lisp/cus-edit.el (setopt--set): Warn instead of rasing an error

(Bug#60162)

2 years agoAllow customising windmove user options with an empty prefix
Philip Kaludercic [Sat, 17 Dec 2022 14:54:40 +0000 (15:54 +0100)]
Allow customising windmove user options with an empty prefix

* lisp/windmove.el (windmove--default-keybindings-type): Handle nil
as a prefix value.  (Bug#60161)

2 years agoImprove and extend admin/git-bisect-start
Gregory Heytings [Sun, 18 Dec 2022 10:46:48 +0000 (10:46 +0000)]
Improve and extend admin/git-bisect-start

* admin/git-bisect-start: Use 'git bisect skip' instead of 'git
bisect good' for merges of external trees, which is equivalent but
faster in some cases.  Improve the explanation on external tree
merges.  Add list of commits in the last six years on which
building Emacs fails, and call 'git bisect skip' on them.  Also
document how the script can be called automatically when 'git
bisect start' is called in the Emacs repository.

* admin/notes/repo (Bisecting): Adapt the explanation of the
script accordingly.

2 years agoMake 'rmail-summary-by-thread' faster
Andrea Monaco [Fri, 9 Dec 2022 20:22:22 +0000 (21:22 +0100)]
Make 'rmail-summary-by-thread' faster

* lisp/mail/rmailsum.el (rmail-summary-message-parents-vector)
(rmail-summary-message-descendants-vector): Doc fixes.
(rmail-summary-message-descendants-vector): New variable.
(rmail-summary-fill-message-parents-and-descs-vectors): Renamed
from 'rmail-summary-fill-message-parents-vector' and rewritten.
(rmail-summary-direct-descendants): Function deleted.

2 years ago; Improve documentation of installing tree-sitter and grammars.
Eli Zaretskii [Sun, 18 Dec 2022 10:08:22 +0000 (12:08 +0200)]
; Improve documentation of installing tree-sitter and grammars.

* etc/NEWS: Enhance tree-sitter sections wrt grammar libraries.

2 years agoFix the MS-DOS build
Po Lu [Sun, 18 Dec 2022 10:05:57 +0000 (18:05 +0800)]
Fix the MS-DOS build

* src/lread.c (syms_of_lread): Make the MS-DOS build work again.

2 years agoAvoid crashes in PGTK build due to signal in 'note_mouse_highlight'
Eli Zaretskii [Sun, 18 Dec 2022 08:29:34 +0000 (10:29 +0200)]
Avoid crashes in PGTK build due to signal in 'note_mouse_highlight'

* src/xdisp.c (string_buffer_position): Make sure the TO argument
of 'string_buffer_position_lim' is always inside [BEGV..ZV].
Otherwise 'string_buffer_position_lim' might call
'get-char-property' and friends with invalid position, which will
just signal an error and do nothing useful.  (Bug#60144)

2 years agoFix MS-Windows build broken by recent treesit.c changes
Eli Zaretskii [Sun, 18 Dec 2022 05:57:34 +0000 (07:57 +0200)]
Fix MS-Windows build broken by recent treesit.c changes

* src/treesit.c (init_treesit_functions, ts_tree_cursor_copy)
(ts_tree_cursor_delete): Add boilerplate for using new tree-sitter
functions.
(ts_node_parent): Delete boilerplate of unused function.

2 years agoFix wrong capture in typescript-ts-mode (bug#60167)
Theodor Thornhill [Sat, 17 Dec 2022 19:07:59 +0000 (20:07 +0100)]
Fix wrong capture in typescript-ts-mode (bug#60167)

An example of the issue could be:

    <Menu.Item>
        {({ active }) => (
          link
            ? <Link to={link}> {text}</Link>
            : <a href="#" onClick={onClick}>{text}</a>
        )}
    </Menu.Item>

Here 'link' as well as a lot of the other constructs inside of the
parenthesized expression will be font-locked with
'font-lock-variable-name-face'.  We only want to capture the
identifier.

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Make the variable capture
only capture the identifier, and not the whole expression.

2 years agoAdd rust-ts-mode (Bug#60136)
Randy Taylor [Fri, 16 Dec 2022 21:05:29 +0000 (16:05 -0500)]
Add rust-ts-mode (Bug#60136)

* etc/NEWS: Mention it.
* lisp/progmodes/eglot.el (eglot-server-programs): Add it.
* lisp/progmodes/rust-ts-mode.el: New major mode with
tree-sitter support.

2 years agoIndentation fixes for jsx/tsx (bug#60169)
Theodor Thornhill [Sat, 17 Dec 2022 22:11:57 +0000 (23:11 +0100)]
Indentation fixes for jsx/tsx (bug#60169)

* lisp/progmodes/js.el (js--treesit-indent-rules): Simplify the rules.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Simplify the rules.

2 years agoFix treesit-query-validate problem with view-mode
Theodor Thornhill [Sat, 17 Dec 2022 19:23:02 +0000 (20:23 +0100)]
Fix treesit-query-validate problem with view-mode

* lisp/treesit.el (treesit-query-validate): Move the (view-mode) into
the correct scope.

2 years agoUse cursor API in treesit-node-parent
Yuan Fu [Sat, 17 Dec 2022 23:14:02 +0000 (15:14 -0800)]
Use cursor API in treesit-node-parent

This is the last part of the change that fixes bug#60054.  The
previous change fixes it for searching functions, this fixes for
treesit-node-parent.

* src/treesit.c (Ftreesit_node_parent): Use the new cursor API.

2 years agoSwitch to use cursor API in treesit.c
Yuan Fu [Sat, 17 Dec 2022 23:01:57 +0000 (15:01 -0800)]
Switch to use cursor API in treesit.c

ts_node_parent has bugs (bug#60054), using cursor API avoids that.
Tree-sitter's author might remove ts_node_parent in the future, so
might as well switch to use cursors now.  We are basically
reimplementing some of the logic of ts_node_prev_sibling and
ts_node_parent in the sibling helper and cursor helper functions.

See also https://github.com/tree-sitter/tree-sitter/issues/1992

* src/treesit.c (treesit_traverse_sibling_helper)
(treesit_traverse_child_helper)
(treesit_traverse_match_predicate): Reimplemented to use the cursor API.
(treesit_search_dfs)
(treesit_search_forward): Use the new cursor helper functions.
(Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree): Use cursors.

* test/src/treesit-tests.el (treesit-search-subtree): New test.
(treesit--ert-search-setup): New macro.
(treesit-search-forward)
(treesit-search-forward-named-only)
(treesit-search-backward)
(treesit-search-backward-named-only)
(treesit-cursor-helper-with-missing-node): New tests.

2 years agoAdd treesit_assume_true and treesit_cursor_helper
Yuan Fu [Sat, 17 Dec 2022 22:59:01 +0000 (14:59 -0800)]
Add treesit_assume_true and treesit_cursor_helper

This is part 1 of the change to change node API to cursor API.  See
the second part for more detail.  (I splitted the change to make the
diff more sane.)

* src/treesit.c (treesit_assume_true)
(treesit_cursor_helper): New functions.

2 years agoRemove file-exists-in-trash-p
Paul Eggert [Sat, 17 Dec 2022 22:41:48 +0000 (14:41 -0800)]
Remove file-exists-in-trash-p

* lisp/files.el (file-exists-in-trash-p): Remove, as this name is
not suitable for users.  All uses replaced by file-attributes,
which is good enough here.

2 years agoUpdate to Org 9.6-49-g47d129
Kyle Meyer [Sat, 17 Dec 2022 22:18:40 +0000 (17:18 -0500)]
Update to Org 9.6-49-g47d129

2 years agoDon’t assume make-directory handler returns nil
Paul Eggert [Sat, 17 Dec 2022 22:09:03 +0000 (14:09 -0800)]
Don’t assume make-directory handler returns nil

* lisp/files.el (make-directory): Ignore what the make-directory
handler returns, as its return value was not documented in Emacs 28.

2 years agoFix copy-directory bug when dest dir exists
Paul Eggert [Sat, 17 Dec 2022 20:15:30 +0000 (12:15 -0800)]
Fix copy-directory bug when dest dir exists

* lisp/files.el (copy-directory): Set ‘follow’ depending on
whether we made the directory, not based on a guess that is
sometimes wrong.  When NEWNAME is a directory name and
COPY-CONTENTS is nil, do not object merely because the adjusted
NEWNAME is already a directory.  (Bug#58919).
* test/lisp/files-tests.el (files-tests-copy-directory):
Test for the bug.

2 years agomake-directory now returns t if dir already exists
Paul Eggert [Sat, 17 Dec 2022 20:15:30 +0000 (12:15 -0800)]
make-directory now returns t if dir already exists

This new feature will help fix a copy-directory bug (Bug#58919).
Its implementation does not rely on make-directory handlers
supporting the new feature, as it no longer uses a make-directory
handler H in any way other than (funcall H DIR), thus using
only the intersection of the old and new behavior for handlers.
This will give us time to fix handlers at our leisure.
* lisp/files.el (files--ensure-directory): New arg MKDIR.
All uses changed.
(files--ensure-directory, make-directory):
Return non-nil if DIR is already a directory.  All uses changed.
* test/lisp/files-tests.el (files-tests-make-directory):
Test new return-value convention.

2 years agoUse make-directory handlers uniformly
Paul Eggert [Sat, 17 Dec 2022 20:15:30 +0000 (12:15 -0800)]
Use make-directory handlers uniformly

Formerly, the code supported both make-directory and
make-directory-internal handlers. This led to confusion and meant than
in a few cases (nnmaildir, ido) remote directories could not be used in
some cases.  Fix this by using only make-directory handlers.

Perhaps there used to be a reason for why there were both
make-directory and make-directory-internal handlers, but whatever that
reason was, it seems to have vanished even before now.

There is no longer any need for make-directory-internal handlers, as
the few remaining callers that use make-directory-internal do so only
when there are no handlers.  However, this change keeps the existing
make-directory-internal handlers for now, in case this code is ever
used in older Emacs versions that still call those handlers.

* lisp/gnus/nnmaildir.el (nnmaildir--mkdir):
* lisp/ido.el (ido-file-internal):
* lisp/net/tramp-smb.el (tramp-smb-handle-make-directory):
Use make-directory, not make-directory-internal.
* lisp/net/tramp-smb.el (tramp-smb-handle-make-directory-internal):
Now obsolete.
* src/fileio.c (Fmake_directory_internal): Do not look for or
use a make-directory-internal handler.
* test/lisp/files-tests.el:
(files-tests-file-name-non-special-make-directory-internal):
Remove, as this test incorrectly assumes that make-directory-internal
must support handlers.

2 years agoImprove documentation of 'file-exists-p'
Eli Zaretskii [Sat, 17 Dec 2022 20:14:40 +0000 (22:14 +0200)]
Improve documentation of 'file-exists-p'

* doc/lispref/files.texi (Testing Accessibility): Document better
how to test for existing dangling symlinks.  (Bug#60146)

2 years agoFix resizing of mini-windows by 'set-minibuffer-message'
Eli Zaretskii [Sat, 17 Dec 2022 18:43:56 +0000 (20:43 +0200)]
Fix resizing of mini-windows by 'set-minibuffer-message'

* src/xdisp.c (redisplay_window): Always resize mini-windows
displaying the active minibuffer.  (Bug#60015)

2 years agoPrevent Abort dialogs from async-compiling jobs on Windows
Eli Zaretskii [Sat, 17 Dec 2022 18:35:11 +0000 (20:35 +0200)]
Prevent Abort dialogs from async-compiling jobs on Windows

* lisp/emacs-lisp/comp.el (comp-run-async-workers): Disable Abort
dialog popping in the sub-processes that perform async
compilation, by passing w32-disable-abort-dialog=t on their
command line.

2 years agoFix 'window-max-chars-per-line' when there are no fringes
Eli Zaretskii [Sat, 17 Dec 2022 12:04:14 +0000 (14:04 +0200)]
Fix 'window-max-chars-per-line' when there are no fringes

* lisp/window.el (window-max-chars-per-line): Fix the way we
account for the fringes by calling 'window-fringes'.  (Bug#59963)

2 years ago; Revert "; * lisp/subr.el (internal--with-narrowing): Simplify"
Eli Zaretskii [Sat, 17 Dec 2022 07:49:43 +0000 (09:49 +0200)]
; Revert "; * lisp/subr.el (internal--with-narrowing): Simplify"

This reverts commit d9add661617dfba491465943d402230699a9a4ff.

Please install on the release branch only changes that fix
incorrect behavior.  Cleanups don't belong here.

2 years agoruby-mode: Recognize instance or global var as first arg in parenless call
Dmitry Gutov [Sat, 17 Dec 2022 01:30:52 +0000 (03:30 +0200)]
ruby-mode: Recognize instance or global var as first arg in parenless call

* lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p):
Recognize instance or global var as first arg in parenless call.

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

2 years agoFix end-of-defun in ruby-mode
Dmitry Gutov [Sat, 17 Dec 2022 01:13:29 +0000 (03:13 +0200)]
Fix end-of-defun in ruby-mode

* lisp/progmodes/ruby-mode.el (ruby-beginning-of-defun):
Return t in case of success.

2 years ago; * lisp/subr.el (internal--with-narrowing): Simplify
Philip Kaludercic [Fri, 16 Dec 2022 23:11:46 +0000 (00:11 +0100)]
; * lisp/subr.el (internal--with-narrowing): Simplify

(Bug#60130)

2 years agoRemove treesit-defun-prefer-top-level and friends
Yuan Fu [Fri, 16 Dec 2022 23:04:32 +0000 (15:04 -0800)]
Remove treesit-defun-prefer-top-level and friends

Because they are not used anymore, after the new defun navigation is
installed.

* lisp/treesit.el (treesit-defun-prefer-top-level)
(treesit--defun-maybe-top-level): Remove.

2 years agoAdd yaml-ts-mode (Bug#60105)
Randy Taylor [Tue, 13 Dec 2022 14:41:01 +0000 (09:41 -0500)]
Add yaml-ts-mode (Bug#60105)

* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add yaml support.
* etc/NEWS: Mention it.
* lisp/textmodes/yaml-ts-mode.el: New major mode with
tree-sitter support.
* lisp/progmodes/eglot.el (eglot-server-programs): Add it.

2 years agoFix indentation in json-ts-mode (bug#60123)
Jostein Kjønigsen [Fri, 16 Dec 2022 15:01:41 +0000 (16:01 +0100)]
Fix indentation in json-ts-mode (bug#60123)

* lisp/progmodes/json-ts-mode.el
(json-ts--indent-rules): Add indentation rules for arrays.

2 years ago; Handle nil ARG in treesit-beginning/end-of-defun
Yuan Fu [Fri, 16 Dec 2022 05:23:20 +0000 (21:23 -0800)]
; Handle nil ARG in treesit-beginning/end-of-defun

* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Handle nil ARG.

2 years agoNew input method 'cyrillic-chuvash'
Eli Zaretskii [Fri, 16 Dec 2022 20:05:52 +0000 (22:05 +0200)]
New input method 'cyrillic-chuvash'

* lisp/leim/quail/cyrillic.el ("cyrillic-chuvash"): New input
method, contributed by flashymittens@tutanota.com.  (Bug#60023)

Copyright-paperwork-exempt: yes

2 years ago; Improve wording of 'format' doc string
Eli Zaretskii [Fri, 16 Dec 2022 18:46:00 +0000 (20:46 +0200)]
; Improve wording of 'format' doc string

* src/editfns.c (Fformat): Use "produce" instead of "print".
(Bug#60125)

2 years agoBackport: ; * lisp/bs.el: Small doc and whitespace fixes
Juanma Barranquero [Fri, 16 Dec 2022 17:36:42 +0000 (18:36 +0100)]
Backport: ; * lisp/bs.el: Small doc and whitespace fixes

(cherry picked from commit 8624734504af4572525665c713a47e1b6f439a2c)

2 years agoRevert "alist-get testfn argument evaluation correction"
Eli Zaretskii [Fri, 16 Dec 2022 17:29:30 +0000 (19:29 +0200)]
Revert "alist-get testfn argument evaluation correction"

This reverts commit 17d65c99cd812e085d85f790c83ec0d540490a55.

Please don't install unnecessary improvements on the release
branch.

2 years agoRevert "Elide broken but unnecessary `if` optimisations"
Eli Zaretskii [Fri, 16 Dec 2022 17:27:33 +0000 (19:27 +0200)]
Revert "Elide broken but unnecessary `if` optimisations"

This reverts commit 13aa376e93564a8cf2ddbbcf0968c6666620db89.

Please don't install anything on the release branch that is
not a clear bugfix for a known bug.

2 years agoRevert "Use equal and member instead of eq and memq"
Eli Zaretskii [Fri, 16 Dec 2022 17:25:45 +0000 (19:25 +0200)]
Revert "Use equal and member instead of eq and memq"

This reverts commit f4b430140f0866f98bbf18b7094348dc64032813.

Please don't install anything on the release branch that is not
strictly necessary fro Emacs 29.

2 years agoUse equal and member instead of eq and memq
Mattias Engdegård [Fri, 16 Dec 2022 11:17:33 +0000 (12:17 +0100)]
Use equal and member instead of eq and memq

* lisp/cedet/semantic/complete.el (semantic-displayer-show-request):
* lisp/descr-text.el (describe-char-categories):
* lisp/mh-e/mh-identity.el (mh-select-identity):
* lisp/transient.el (transient--delay-post-command)
(transient--post-command):
* lisp/vc/vc-git.el (vc-git-create-tag):
* test/lisp/emacs-lisp/cl-lib-tests.el
(cl-lib-nth-value-test-multiple-values):
* lisp/emulation/viper-cmd.el (viper-preserve-cursor-color):
Use `equal` instead of `eq` and `member` instead of `memq` where
the comparison is with literals without guaranteed identity.
In some cases this change corrects evident bugs, in others it is
mostly cosmetic.

2 years agoElide broken but unnecessary `if` optimisations
Mattias Engdegård [Fri, 16 Dec 2022 14:56:04 +0000 (15:56 +0100)]
Elide broken but unnecessary `if` optimisations

* lisp/emacs-lisp/byte-opt.el (byte-optimize-if):
Remove explicit clauses purposing to simplify

    (if X nil t) -> (not X)
    (if X t nil) -> (not (not X))

but never did so because of a coding mistake (eq instead of equal),
found by a recently added warning.  They weren't actually needed
thanks to the optimiser's fixpoint iteration: we eventually get the
same results through

    (if X nil t) -> (if (not X) t nil) -> (if (not X) t) -> (not X)
    (if X t nil) -> (if X t) -> (not (not X))

2 years agoalist-get testfn argument evaluation correction
Mattias Engdegård [Fri, 16 Dec 2022 10:08:02 +0000 (11:08 +0100)]
alist-get testfn argument evaluation correction

* lisp/emacs-lisp/gv.el (alist-get):
Evaluate TESTFN exactly once (previously up to 3 times).
Reduce the macro-expansion to include a call to either assoc or assq,
not both; this reduces the generated code size in some cases.

2 years ago* lisp/term/xterm.el (xterm-function-map): Add M-SPC. (Bug#60077)
Eli Zaretskii [Fri, 16 Dec 2022 16:02:57 +0000 (18:02 +0200)]
* lisp/term/xterm.el (xterm-function-map): Add M-SPC.  (Bug#60077)

2 years agoFix moving to trash files that overwrite dangling symlinks there
Eli Zaretskii [Fri, 16 Dec 2022 15:54:35 +0000 (17:54 +0200)]
Fix moving to trash files that overwrite dangling symlinks there

* lisp/files.el (file-exists-in-trash-p): New function.
(move-file-to-trash): Use it instead of 'file-exists-p' when
testing whether the file exist in the trash.  (Bug#59986)

2 years agoFix SVG scaling (bug#59802)
Manuel Giraud [Tue, 13 Dec 2022 09:10:03 +0000 (10:10 +0100)]
Fix SVG scaling (bug#59802)

Fix SVG scaling with librsvg>2.52 and SVG file with only one known
dimension.

* src/image.c (svg_load_image): Compute a percentage dimension with
the other known dimension.

2 years ago; Add useful hint to which-func documentation
Eli Zaretskii [Fri, 16 Dec 2022 15:43:46 +0000 (17:43 +0200)]
; Add useful hint to which-func documentation

* lisp/progmodes/which-func.el (which-func-non-auto-modes)
(which-func-maxout): Mention the slow startup with Eglot and
how to work around that.  (Bug#60107)

2 years ago; Improve doc strings of minibuffer-history commands
Eli Zaretskii [Fri, 16 Dec 2022 15:32:05 +0000 (17:32 +0200)]
; Improve doc strings of minibuffer-history commands

* lisp/simple.el (goto-history-element, next-history-element)
(previous-history-element): Doc fixes.  (Bug#60103)

2 years ago; Fix last changes in buffer.c
Eli Zaretskii [Fri, 16 Dec 2022 14:46:37 +0000 (16:46 +0200)]
; Fix last changes in buffer.c

* src/buffer.c (other_buffer_safely): Ensure Lisp Interaction mode
in *scratch*.  (Bug#60096)

2 years agoFix some naming issues involving query buffers in ERC
F. Jason Park [Mon, 12 Dec 2022 15:38:44 +0000 (07:38 -0800)]
Fix some naming issues involving query buffers in ERC

* lisp/erc/erc-networks.el
(erc-networks-rename-surviving-target-buffer): Don't kill a surviving
target buffer when another, non-target buffer, possibly not even
belonging to ERC, already exists and sports the target's name.
(erc-networks--reconcile-buffer-names): Always append a network-ID
suffix to a target buffer's name if another buffer of that name
already exists.  (Bug#59976.)
* lisp/erc/erc.el (erc, erc-tls): Revise `:id' portion of doc strings.
Thanks to Mike Kazantsev for the suggestion and for filing this bug
and helping solve it.
* test/lisp/erc/erc-networks-tests.el:
(erc-networks-rename-surviving-target-buffer--query-non-target): Add
new test.
* test/lisp/erc/erc-scenarios-base-association-query.el: New file.
* test/lisp/erc/resources/base/assoc/queries/netnick.eld: New file.
* test/lisp/erc/resources/base/assoc/queries/non-erc.eld: New file.

2 years ago; Fix doc string in ERC's module-activation commands
F. Jason Park [Fri, 16 Dec 2022 07:25:10 +0000 (23:25 -0800)]
; Fix doc string in ERC's module-activation commands

* lisp/erc/erc-common.el (erc--assemble-toggle): Previously, the doc
string implied that a prefix argument was necessary to achieve
connection-wide effects, which might lead a person to think the
interactive code should be an uppercase "P".
* test/lisp/erc/erc-tests.el (define-erc-module--local): Update
expected result of code-gen.

2 years agoIncrement erc-debug-irc-protocol-version to 2
F. Jason Park [Thu, 15 Dec 2022 04:03:15 +0000 (20:03 -0800)]
Increment erc-debug-irc-protocol-version to 2

* lisp/erc/erc.el (erc-debug-irc-protocol-version): Change version to
2 to help dependent tooling detect redacted passwords.
(erc-log-irc-protocol): Don't bother redacting incoming messages.
(Bug#59284.)

2 years agoA better fix for bug#60096
Eli Zaretskii [Fri, 16 Dec 2022 14:29:51 +0000 (16:29 +0200)]
A better fix for bug#60096

* lisp/startup.el (initial-scratch-message):
* lisp/simple.el (get-scratch-buffer-create): Revert last changes.

* src/window.c (Fset_window_configuration): Force recalculation of
Vwindow_list after restoring the windows.
* src/buffer.c (other_buffer_safely): Make sure we always return a
valid buffer, even if 'get-scratch-buffer-create' signals an
error.

2 years ago; Fix printing Lisp types in .gdbinit
Eli Zaretskii [Fri, 16 Dec 2022 12:14:42 +0000 (14:14 +0200)]
; Fix printing Lisp types in .gdbinit

* src/alloc.c (valid_lisp_object_p): Support printing
stack-allocated strings and cons cells.

2 years agoBump Eglot version to 1.10
João Távora [Fri, 16 Dec 2022 09:23:21 +0000 (09:23 +0000)]
Bump Eglot version to 1.10

* lisp/progmodes/eglot.el (Version): Bump to 1.10
(Package-Requires): Bump required versions of jsonrpc and project.

2 years agoEglot: fix discrepant eglot-guess-contact/eglot-command-history
João Távora [Fri, 16 Dec 2022 09:29:32 +0000 (09:29 +0000)]
Eglot: fix discrepant eglot-guess-contact/eglot-command-history

Due to a typo, the defvar eglot--command-history wasn't actually used
in eglot-guess-contact as intended.  That function used a
single-dash-name version of the variable instead.

This worked fine, except that two variables were created instead of
one, and the one actually being used didn't have any docstring.

Rename the variable to eglot-command-history to fix this.  It's better
than renaming the reference in eglot-guess-contact which would lose
user's history for M-x eglot.

* lisp/progmodes/eglot.el (eglot-command-history): Rename from
eglot--command-history.

2 years agoAvoid recursive process filters in lisp/jsonrpc.el (bug#60088)
João Távora [Thu, 15 Dec 2022 15:26:13 +0000 (15:26 +0000)]
Avoid recursive process filters in lisp/jsonrpc.el (bug#60088)

jsonrpc.el may lose JSON-RPC messages because of recursive process
filters.  The problem happens in jsonrpc.el's jsonrpc--process-filter.

The code of the process filter didn't expect to be called recursively
and fails in that case.

But that can happen if the three conditions are verified.

1. the client code invoked by its jsonrpc--connection-receive inside
   the process filter callee immediately sends follow-up input to
   process within the same Lisp stack.  This is a common scenario,
   especially during LSP initialiation sequence used by Eglot, a
   jsonrpc.el client.

2. that follow-up message is large enough for process-send-string to
   send the input in bunches (output from processes can arrive in
   between bunches).

3. the process happens to have already some more output ready

The fix in this commit detects recursive invocations and immediately
re-schedules them as non-recursive calls to the
jsonrpc--process-filter (but started from timers).

* lisp/jsonrpc.el (jsonrpc--process-filter): Rework.
(Version): Bump to 1.0.16.

2 years ago; Fix typos
Stefan Kangas [Thu, 15 Dec 2022 01:41:20 +0000 (02:41 +0100)]
; Fix typos

2 years agoAdd lambda_expression-rule to java-ts-mode (bug#60091)
Theodor Thornhill [Thu, 15 Dec 2022 13:54:17 +0000 (14:54 +0100)]
Add lambda_expression-rule to java-ts-mode (bug#60091)

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New
rule.

2 years agoeglot: Add support for new language server csharp-ls
Jostein Kjønigsen [Thu, 15 Dec 2022 12:44:39 +0000 (13:44 +0100)]
eglot: Add support for new language server csharp-ls

C# has two popular language servers: Omnisharp Roslyn (already
supported) and csharp-ls (newer, more performant).

* lisp/progmodes/eglot.el: Add new C# language server
csharp-ls.  (Bug#60089)

2 years agoUse the new tree-sitter commands
Yuan Fu [Fri, 16 Dec 2022 01:44:07 +0000 (17:44 -0800)]
Use the new tree-sitter commands

* lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-valid-p)
(c-ts-mode--defun-skipper): New functions.
(c-ts-base-mode): Setup defun navigation.
* lisp/progmodes/sh-script.el (bash-ts-mode): Setup defun navigation.
* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Change to new implementation, which is
intended to be used as commands.
(treesit-major-mode-setup): Setup remap for beginning/end-of-defun
commands.

2 years agoAdd "function" feature to python-ts-mode (bug#59977)
Yuan Fu [Fri, 16 Dec 2022 01:25:06 +0000 (17:25 -0800)]
Add "function" feature to python-ts-mode (bug#59977)

* lisp/progmodes/python.el (python--treesit-settings): Add feature.
(python-ts-mode): Add feature.  And fix indentation for the
python-indent-guess-indent-offset code.

2 years agoAdd go-ts-mode and go-mod-ts-mode (Bug#60025)
Randy Taylor [Sun, 11 Dec 2022 23:41:16 +0000 (18:41 -0500)]
Add go-ts-mode and go-mod-ts-mode (Bug#60025)

* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add go-mod support.
* etc/NEWS: Mention them.
* lisp/progmodes/eglot.el (eglot-server-programs): Add them.
* lisp/progmodes/go-ts-mode.el: New major modes with
tree-sitter support.

2 years agoAdd basic support for hideshow in python-ts-mode (bug#60044)
Yuan Fu [Fri, 16 Dec 2022 01:16:28 +0000 (17:16 -0800)]
Add basic support for hideshow in python-ts-mode (bug#60044)

* lisp/progmodes/python.el (python-base-mode): Add setup for
python-ts-mode.

2 years agoAdd "this" keyword to java-ts-mode (bug#60086)
Theodor Thornhill [Thu, 15 Dec 2022 10:48:32 +0000 (11:48 +0100)]
Add "this" keyword to java-ts-mode (bug#60086)

* lisp/progmodes/java-ts-mode.el
(java-ts-mode--font-lock-settings): Add the node to the keyword
feature.

2 years agoWhen completing relative project file names, use relative history
Dmitry Gutov [Thu, 15 Dec 2022 22:45:55 +0000 (00:45 +0200)]
When completing relative project file names, use relative history

* lisp/progmodes/project.el: Require 'cl-lib'.

* lisp/progmodes/project.el (project--read-file-cpd-relative):
Pre-process history entries around completing-read (bug#58447).

This includes both filtering by common-parent-directory prefix and
mapping into relative names.

2 years agoAvoid segfaults due to invalid selected-window's buffer
Eli Zaretskii [Thu, 15 Dec 2022 21:39:58 +0000 (23:39 +0200)]
Avoid segfaults due to invalid selected-window's buffer

* lisp/startup.el (initial-scratch-message): Don't use \\[...]
commands for substitute-command-keys.
* lisp/simple.el (get-scratch-buffer-create): Don't call
substitute-command-keys on initial-scratch-message, to avoid
signaling an error in rare cases.  (Bug#60096)

2 years agoRevert 21b387c39bd with last-minute hasty changes (bug#60048).
Juri Linkov [Thu, 15 Dec 2022 19:24:48 +0000 (21:24 +0200)]
Revert 21b387c39bd with last-minute hasty changes (bug#60048).

* lisp/simple.el (completion-list-mode-map): Unbind [up] and [down].
(previous-line-completion, next-line-completion): Remove.

2 years agoReplace an erroneous eq with an equal in cc-defs.el
Alan Mackenzie [Thu, 15 Dec 2022 19:23:19 +0000 (19:23 +0000)]
Replace an erroneous eq with an equal in cc-defs.el

* lisp/progmodes/cc-defs.el (c-looking-at-non-alphnumspace): Replace eq with
equal in the XEmacs branch.

2 years ago* lisp/tab-bar.el ([tab-bar]): Use 'make-sparse-keymap' instead of 'ignore'.
Juri Linkov [Thu, 15 Dec 2022 19:10:28 +0000 (21:10 +0200)]
* lisp/tab-bar.el ([tab-bar]): Use 'make-sparse-keymap' instead of 'ignore'.

This helps to avoid the error in 'where-is-internal' that should
not call :filter unnecessarily (bug#9923).

2 years agocompile.el: Fix regression with nb of errors in modeline
Stefan Monnier [Thu, 15 Dec 2022 18:36:14 +0000 (13:36 -0500)]
compile.el: Fix regression with nb of errors in modeline

* lisp/progmodes/compile.el (compilation-mode-line-errors): Mark it as
risky-local, like `defconst` used to do for us.

2 years agoMake tab-bar-tab-group-format-function backwards-compatible (bug#60073)
Juri Linkov [Thu, 15 Dec 2022 18:03:24 +0000 (20:03 +0200)]
Make tab-bar-tab-group-format-function backwards-compatible (bug#60073)

* lisp/tab-bar.el (tab-bar--format-tab-group): Add condition-case
with wrong-number-of-arguments for backwards-compatibility.
(tab-bar-tab-group-format-default): Simplify.

2 years agoMake tab-bar-tab-group-format-function also handle current group
Gabriel do Nascimento Ribeiro [Thu, 15 Dec 2022 14:58:30 +0000 (11:58 -0300)]
Make tab-bar-tab-group-format-function also handle current group

* lisp/tab-bar.el (tab-bar--format-tab-group): Call
'tab-bar-tab-group-format-default' to format current group tab.
(tab-bar-tab-group-format-default): Update function to also handle
current group tab (bug#60073).

2 years agoEnsure package directories for source packages from checkouts
Philip Kaludercic [Thu, 15 Dec 2022 17:21:24 +0000 (18:21 +0100)]
Ensure package directories for source packages from checkouts

* lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
Set the :dir entry, since `package-vc--unpack-1' assumes the field is
set, as is the case when invoking `package-vc--unpack'.

2 years ago; * etc/NEWS: Fix recent changes.
Randy Taylor [Thu, 15 Dec 2022 16:44:10 +0000 (11:44 -0500)]
; * etc/NEWS: Fix recent changes.

2 years ago* test/README (SELECTOR): Add eglot-tests.el to remote file using libraries.
Michael Albinus [Thu, 15 Dec 2022 15:37:36 +0000 (16:37 +0100)]
* test/README (SELECTOR): Add eglot-tests.el to remote file using libraries.

2 years agoFix bug#60060 in Tramp
Michael Albinus [Thu, 15 Dec 2022 15:37:16 +0000 (16:37 +0100)]
Fix bug#60060 in Tramp

* lisp/net/tramp-sh.el (tramp-sh-handle-file-local-copy):
Delete `tmpfile' in case of error.  (Bug#60060)

2 years ago; * lisp/net/tramp-crypt.el: Fix comment.
Michael Albinus [Thu, 15 Dec 2022 15:36:38 +0000 (16:36 +0100)]
; * lisp/net/tramp-crypt.el: Fix comment.

2 years ago* .gitignore: Ignore GDB history files.
Manuel Giraud [Thu, 15 Dec 2022 08:50:32 +0000 (09:50 +0100)]
* .gitignore: Ignore GDB history files.

2 years agoMention 'tree-sitter' in user manual and NEWS
Eli Zaretskii [Thu, 15 Dec 2022 08:47:11 +0000 (10:47 +0200)]
Mention 'tree-sitter' in user manual and NEWS

* doc/emacs/programs.texi (Program Modes): Mention tree-sitter and
the modes supported by it.
* etc/NEWS: Mention tree-sitter in the Installation Changes
section.

2 years ago; * etc/NEWS: Rearrange entries for tree-sitter supported modes.
Eli Zaretskii [Thu, 15 Dec 2022 08:25:27 +0000 (10:25 +0200)]
; * etc/NEWS: Rearrange entries for tree-sitter supported modes.

2 years ago; Announce 'toml-ts-mode' in NEWS.
Eli Zaretskii [Thu, 15 Dec 2022 08:09:25 +0000 (10:09 +0200)]
; Announce 'toml-ts-mode' in NEWS.

2 years ago; Auto-commit of loaddefs files.
Stefan Kangas [Thu, 15 Dec 2022 04:11:35 +0000 (05:11 +0100)]
; Auto-commit of loaddefs files.

2 years ago; Don't quote nil in comments
Stefan Kangas [Thu, 15 Dec 2022 01:24:56 +0000 (02:24 +0100)]
; Don't quote nil in comments

2 years ago; Checkdoc fixes in dired-aux.el
Stefan Kangas [Thu, 15 Dec 2022 01:22:45 +0000 (02:22 +0100)]
; Checkdoc fixes in dired-aux.el

* lisp/dired-aux.el (dired-compare-directories, dired-do-chmod)
(dired-do-chgrp, dired-do-chown, dired-do-touch)
(dired-minibuffer-default-add-shell-commands)
(dired-read-shell-command, dired-mark-prefix)
(dired-mark-postfix, dired-mark-separator, dired-kill-line)
(dired-reset-subdir-switches, dired-add-entry)
(dired-remove-file)
(dired-create-destination-dirs-on-trailing-dirsep)
(dired-maybe-insert-subdir, dired-tree-up, dired-tree-down):
Checkdoc fixes.

2 years agoFix ruby-add-log-current-method after nested class definition
Dmitry Gutov [Thu, 15 Dec 2022 01:21:14 +0000 (03:21 +0200)]
Fix ruby-add-log-current-method after nested class definition

* lisp/progmodes/ruby-mode.el (ruby--add-log-current-indent):
New function.
(ruby-add-log-current-method): Use it.
Check for "class" and "module" indentation to filter out the
definitions which don't include the given position.  Also try to
match "def" only once (for performance), because if the closest
one doesn't include the given position, none will.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-after-inner-class-outside-methods)
(ruby-add-log-current-method-after-inner-class-outside-methods-with-text):
New tests.

2 years agoAdd indent rules to js/typescript/tsx-ts-mode (bug#60074)
Theodor Thornhill [Wed, 14 Dec 2022 20:23:33 +0000 (21:23 +0100)]
Add indent rules to js/typescript/tsx-ts-mode (bug#60074)

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Add in binary_expression and
jsx_fragment.
* lisp/progmodes/js.el (js--treesit-indent-rules): Add the same rules.

2 years agoImprove fontification in csharp-ts-mode (bug#59897)
Jostein Kjønigsen [Thu, 8 Dec 2022 10:07:15 +0000 (11:07 +0100)]
Improve fontification in csharp-ts-mode (bug#59897)

Fixes highlighting of generic methods like the one below:

instance.MethodWithTypeArguments<Type>(...);
InClassMethodWithTypeArguments<Type>(...);

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Add new rule.

2 years agoRevert "Add expression for generic_name in csharp-ts-mode"
Yuan Fu [Wed, 14 Dec 2022 22:28:29 +0000 (14:28 -0800)]
Revert "Add expression for generic_name in csharp-ts-mode"

I applied the wrong commit, the next commit will be the right one,
sorry about that!

This reverts commit 647b6a8099f414e5a7b162efd3658e174064dfe7.

2 years agoIntroduce support for TOML config-format
Jostein Kjønigsen [Sun, 11 Dec 2022 12:05:29 +0000 (13:05 +0100)]
Introduce support for TOML config-format

This commit introduces support for the semi-popular TOML
config-format[1] through a new major-mode: toml-ts-mode.

I've read through the full spec[2], and from what I can see this
major-mode should provide correct syntax-highligting for every sort of
config-declaration which adheres to the specification.

Besides that it also adds support for imenu and basic tree-sitter
based navigation.

[1] https://toml.io/en/
[2] https://toml.io/en/v1.0.0

2 years agoFix handling of % when searching in .tex or .dtx files
Arash Esbati [Wed, 14 Dec 2022 20:17:30 +0000 (21:17 +0100)]
Fix handling of % when searching in .tex or .dtx files

* lisp/textmodes/reftex.el (reftex-compile-variables): Consider %
when building the regexp for searching only in .dtx files.
(AUCTeX bug#59638)

2 years agoTreat C++ classes as defuns in C Tree-sitter mode (bug#60047)
Daniel Martín [Tue, 13 Dec 2022 20:35:40 +0000 (21:35 +0100)]
Treat C++ classes as defuns in C Tree-sitter mode (bug#60047)

* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Add "class_specifier"
as a node of type "defun".

2 years agoAdd < and > to the syntax table in c++-ts-mode (bug#60049)
Daniel Martín [Tue, 13 Dec 2022 21:28:13 +0000 (22:28 +0100)]
Add < and > to the syntax table in c++-ts-mode (bug#60049)

* lisp/progmodes/c-ts-mode.el (c++-ts-mode--syntax-table): Add a
specific syntax table for C++.  Consider "<" and ">" open/close
delimiters (C++ templates).
(c++-ts-mode): Use the new syntax table.

2 years agoImprove fontifications in Typescript mode
Jostein Kjønigsen [Wed, 7 Dec 2022 08:27:42 +0000 (09:27 +0100)]
Improve fontifications in Typescript mode

* lisp/progmodes/typescript-ts-mode.el: Improve fontification of
variables.  (Bug#59831)

2 years agoUpdate the documentation of overlays (bug#59996)
Eli Zaretskii [Wed, 14 Dec 2022 18:13:47 +0000 (20:13 +0200)]
Update the documentation of overlays (bug#59996)

* src/buffer.c (Foverlay_recenter, Foverlay_lists): Update the doc
strings.

* lisp/subr.el (copy-overlay): Update comment.

* doc/lispref/internals.texi (Buffer Internals): Remove buffer
fields relevant to the old implementation; add the new interval
tree field.
* doc/lispref/display.texi (Overlays, Managing Overlays): Update
text to be consistent with the new implementation of overlays.
(Managing Overlays): Remove documentation of 'overlay-recenter'.

* etc/NEWS: Mention incompatible aspects of overlay
reimplementation.

2 years ago; Improve description of scoping and let-bindings
Eli Zaretskii [Wed, 14 Dec 2022 15:46:16 +0000 (17:46 +0200)]
; Improve description of scoping and let-bindings

* doc/lispref/variables.texi (Local Variables, Variable Scoping):
Explain the move to lexical-binding and elaborate on 'let*'.
Suggested by Michael Heerdegen <michael_heerdegen@web.de>.
(Bug#60027)

2 years ago; Fix a typo in window.el
Eli Zaretskii [Wed, 14 Dec 2022 15:08:46 +0000 (17:08 +0200)]
; Fix a typo in window.el

* lisp/window.el (switch-to-prev-buffer-skip-p): Fix typo.
Patch by Shuguang Sun <shuguang79@qq.com>.  (Bug#59985)

2 years agoDon't send erc-sasl-user as USER command argument
F. Jason Park [Tue, 13 Dec 2022 07:58:03 +0000 (23:58 -0800)]
Don't send erc-sasl-user as USER command argument

* lisp/erc/erc-sasl.el (erc-sasl--send-cap-ls): Add internal switch
for sending an opening "CAP LS".  The rationale for not enabling this
by default is twofold: one, it more strongly implies that ERC supports
IRCv3 client capability negotiation, which is somewhat disingenuous;
and, two, We'd still be "faking it" by firing and forgetting, and more
balls in the air makes things less predictable.
(erc--register-connection): Possibly send a "CAP LS" before anything
depending on the value of `erc-sasl--send-cap-ls'.  Also, don't
attempt to send `erc-session-username' when it holds an SASL username
because the latter may contain protocol-defying characters.
* test/lisp/erc/resources/base/local-modules/fourth.eld: change user
parameter of "USER" command to reflect nick when `erc-sasl-user' is
set to `:user'.  (Bug#59976.)