1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00
Commit Graph

163818 Commits

Author SHA1 Message Date
Michael Albinus
50d18bb6ea Make tramp-archive autoloads robust for older Emacs versions
* lisp/net/tramp-archive.el (tramp-archive-file-name-regexp):
Use `eval-when-compile'.  Set it explicitly for older Emacs versions.
2022-12-18 16:42:51 +01:00
Eli Zaretskii
3941cc29df ; Improve documentation of 'setopt'
* doc/lispref/variables.texi (Setting Variables): Note about the
differences between 'setopt' and 'customize-set-variable'.
2022-12-18 14:26:54 +02:00
Dmitry Gutov
6f88de109c 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.
2022-12-18 14:04:17 +02:00
Eli Zaretskii
91dd893e34 ; * lisp/progmodes/sql.el (sql-product-interactive): Doc fix (bug#60175) 2022-12-18 13:54:43 +02:00
Philip Kaludercic
138d9dc4cb * lisp/cus-edit.el (setopt--set): Warn instead of rasing an error
(Bug#60162)
2022-12-18 12:45:22 +01:00
Philip Kaludercic
d1e0542f33 Allow customising windmove user options with an empty prefix
* lisp/windmove.el (windmove--default-keybindings-type): Handle nil
as a prefix value.  (Bug#60161)
2022-12-18 12:45:22 +01:00
Gregory Heytings
c2375e7791 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.
2022-12-18 11:48:58 +01:00
Andrea Monaco
7cc2313eb0 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.
2022-12-18 12:22:27 +02:00
Eli Zaretskii
88e59b16cb ; Improve documentation of installing tree-sitter and grammars.
* etc/NEWS: Enhance tree-sitter sections wrt grammar libraries.
2022-12-18 12:08:22 +02:00
Po Lu
897f33bf31 Fix the MS-DOS build
* src/lread.c (syms_of_lread): Make the MS-DOS build work again.
2022-12-18 18:05:57 +08:00
Eli Zaretskii
660e941235 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)
2022-12-18 10:29:34 +02:00
Eli Zaretskii
0fc5fb2d05 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.
2022-12-18 07:57:34 +02:00
Theodor Thornhill
5b2e6d04ce
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.
2022-12-17 16:30:46 -08:00
Randy Taylor
cb8ccdd267
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.
2022-12-17 15:40:53 -08:00
Theodor Thornhill
9fcf764dd7
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.
2022-12-17 15:35:48 -08:00
Theodor Thornhill
69f2c71135
Fix treesit-query-validate problem with view-mode
* lisp/treesit.el (treesit-query-validate): Move the (view-mode) into
the correct scope.
2022-12-17 15:33:55 -08:00
Yuan Fu
1fc7535546
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.
2022-12-17 15:33:54 -08:00
Yuan Fu
5f0286c0af
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.
2022-12-17 15:33:54 -08:00
Yuan Fu
a275e436df
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.
2022-12-17 15:33:54 -08:00
Paul Eggert
a54c7a8df0 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.
2022-12-17 14:53:19 -08:00
Kyle Meyer
3e02029642 Update to Org 9.6-49-g47d129 2022-12-17 17:28:27 -05:00
Paul Eggert
4a8ff671b0 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.
2022-12-17 14:24:17 -08:00
Paul Eggert
44c83b239d 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.
2022-12-17 14:24:16 -08:00
Paul Eggert
bef1edc9ca 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.
2022-12-17 14:24:16 -08:00
Paul Eggert
8a9579ca29 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.
2022-12-17 14:24:16 -08:00
Eli Zaretskii
627e7e0243 Improve documentation of 'file-exists-p'
* doc/lispref/files.texi (Testing Accessibility): Document better
how to test for existing dangling symlinks.  (Bug#60146)
2022-12-17 22:14:40 +02:00
Eli Zaretskii
c9015ef55f Fix resizing of mini-windows by 'set-minibuffer-message'
* src/xdisp.c (redisplay_window): Always resize mini-windows
displaying the active minibuffer.  (Bug#60015)
2022-12-17 20:43:56 +02:00
Eli Zaretskii
5a245bc786 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.
2022-12-17 20:35:11 +02:00
Eli Zaretskii
4d1e4a4893 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)
2022-12-17 14:04:14 +02:00
Eli Zaretskii
d65beb820c ; Revert "; * lisp/subr.el (internal--with-narrowing): Simplify"
This reverts commit d9add66161.

Please install on the release branch only changes that fix
incorrect behavior.  Cleanups don't belong here.
2022-12-17 09:49:43 +02:00
Dmitry Gutov
1c0b90e5f7 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.
2022-12-17 03:31:11 +02:00
Dmitry Gutov
3356c0cb16 Fix end-of-defun in ruby-mode
* lisp/progmodes/ruby-mode.el (ruby-beginning-of-defun):
Return t in case of success.
2022-12-17 03:31:11 +02:00
Philip Kaludercic
d9add66161 ; * lisp/subr.el (internal--with-narrowing): Simplify
(Bug#60130)
2022-12-17 00:41:14 +01:00
Yuan Fu
67bc96c9d9
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.
2022-12-16 15:04:32 -08:00
Randy Taylor
4f9bccef55
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.
2022-12-16 14:55:02 -08:00
Jostein Kjønigsen
f9cb144d45
Fix indentation in json-ts-mode (bug#60123)
* lisp/progmodes/json-ts-mode.el
(json-ts--indent-rules): Add indentation rules for arrays.
2022-12-16 14:53:45 -08:00
Yuan Fu
3d348c46e7
; Handle nil ARG in treesit-beginning/end-of-defun
* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Handle nil ARG.
2022-12-16 14:53:45 -08:00
Eli Zaretskii
1a66435dda 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
2022-12-16 22:05:52 +02:00
Eli Zaretskii
b9227c502d ; Improve wording of 'format' doc string
* src/editfns.c (Fformat): Use "produce" instead of "print".
(Bug#60125)
2022-12-16 20:46:00 +02:00
Juanma Barranquero
65b0040f9f Backport: ; * lisp/bs.el: Small doc and whitespace fixes
(cherry picked from commit 8624734504)
2022-12-16 19:05:56 +01:00
Eli Zaretskii
de2239a584 Revert "alist-get testfn argument evaluation correction"
This reverts commit 17d65c99cd.

Please don't install unnecessary improvements on the release
branch.
2022-12-16 19:29:30 +02:00
Eli Zaretskii
856d889f3a Revert "Elide broken but unnecessary if optimisations"
This reverts commit 13aa376e93.

Please don't install anything on the release branch that is
not a clear bugfix for a known bug.
2022-12-16 19:27:33 +02:00
Eli Zaretskii
8e42e20ed7 Revert "Use equal and member instead of eq and memq"
This reverts commit f4b430140f.

Please don't install anything on the release branch that is not
strictly necessary fro Emacs 29.
2022-12-16 19:25:45 +02:00
Mattias Engdegård
f4b430140f 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.
2022-12-16 17:19:21 +01:00
Mattias Engdegård
13aa376e93 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))
2022-12-16 17:17:23 +01:00
Mattias Engdegård
17d65c99cd 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.
2022-12-16 17:17:23 +01:00
Eli Zaretskii
b01d0246d7 * lisp/term/xterm.el (xterm-function-map): Add M-SPC. (Bug#60077) 2022-12-16 18:02:57 +02:00
Eli Zaretskii
303d6ac142 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)
2022-12-16 17:54:35 +02:00
Manuel Giraud
dc78779c0c 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.
2022-12-16 17:47:37 +02:00
Eli Zaretskii
10415d9651 ; 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)
2022-12-16 17:43:46 +02:00