* 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.
* 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.
* 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.
* 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)
* 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.
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.
* 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.
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.
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.
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.
* 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.
* 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.
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.
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.
* 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.
* 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.
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.
* 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.
* 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.
* 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))
* 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.
* 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)
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.
* 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)