1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

163830 commits

Author SHA1 Message Date
Dmitry Gutov
b9e813f79f ; ruby-indent-level: Improve the docstring 2022-12-19 21:06:07 +02:00
Juri Linkov
399433cc2b * lisp/progmodes/project.el: Filter out empty strings from history (bug#58447)
(project--read-file-cpd-relative): Do not include empty strings (when
prefix has the same length as the string).
2022-12-19 19:54:08 +02:00
Eli Zaretskii
23f7c9c2a9 Fix storing email into nnmail by Gnus
* lisp/gnus/nnml.el (nnml--encode-headers): Wrap
'rfc2047-encode-string' calls with 'ignore-errors', to avoid
disrupting email workflows due to possibly-invalid headers.
Reported by Florian Weimer <fweimer@redhat.com>.
2022-12-19 19:01:04 +02:00
F. Jason Park
63cdbd986b ; Really respect browse-url var in erc-compat
* lisp/erc/erc-compat.el: Do what was supposed to be done by
75f26646d4 "; Be nicer when updating
browse-url var in erc-compat".  This is the less harmful version of
that patch (from bug#59976#8) but without the cl-lib requirement since
users may not want to load the main ERC library right away.
* lisp/erc/erc.el: Clarify some comments regarding the core API.
2022-12-19 05:49:08 -08:00
Richard Hansen
64163618d2 whitespace: Fix unintended change in buffer modification status
* lisp/whitespace.el (whitespace--empty-at-bob-matcher)
whitespace--empty-at-eob-matcher, whitespace--update-bob-eob):
Silently add the `font-lock-multiline' text property when
highlighting beginning-of-buffer and end-of-buffer empty lines
to prevent Emacs from running modification hooks or considering
the buffer to be modified (Bug#60066).

* test/lisp/whitespace-tests.el
(whitespace-tests--empty-bob-eob-modified): Add a regression test.
2022-12-19 15:44:07 +02:00
Eli Zaretskii
a75d1da911 Make emacsclient add abbreviated file names to file-name-history
* lisp/server.el (server-visit-files): Use
'file-name-history--add' to add the visited files to history.
(Bug#60097)
2022-12-19 15:33:09 +02:00
Mattias Engdegård
b3e7768a0e Repair setopt test after error demotion to warning
* test/lisp/cus-edit-tests.el (test-setopt):
Check for a warrning instead of an error in attempt to call `setopt`
with a value that does not match the declared type (bug#60162).
2022-12-19 12:05:09 +01:00
Gregory Heytings
12e26cc0c1 ; * admin/git-bisect-start: Add mistakenly ommitted commits to skip 2022-12-19 02:08:23 +01:00
Dmitry Gutov
9a751e0a38 ruby-mode: Support endless singleton method definitions too
* lisp/progmodes/ruby-mode.el (ruby-endless-method-head-re):
Update to match not only 'self.' but 'xyz.' as well (bug#54702).

* test/lisp/progmodes/ruby-mode-resources/ruby.rb (Bar#foo=):
Update example.
2022-12-19 02:22:53 +02:00
Yuan Fu
ce7b7e5af3
Remove comment-start-skip preset in tree-sitter indentation engine
Comment indentation should use a adaptive-fill-based indent, rather
than comment-start-skip.

Also remove manual description of removed variables in treesit.el and
add documentation for n-p-gp upon request.

* doc/lispref/modes.texi (Parser-based Indentation)
* lisp/treesit.el (treesit-simple-indent-presets): Add n-p-gp, remove
treesit-comment-start/end, remove comment-start-skip.

* doc/lispref/parsing.texi (Tree-sitter major modes): Remove
treesit-comment-start/end.
2022-12-18 14:48:38 -08:00
Michael Albinus
c1e015ae32 Fix recent change in tramp-smb.el
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Ignore `make-directory-internal'.
(tramp-smb-handle-make-directory): Move implementation from
`tramp-smb-handle-make-directory-internal' here.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Rearrange `make-directory-internal'.
2022-12-18 20:17:06 +01:00
Michael Albinus
cf1b771864 ; * etc/NEWS: Fix typos. 2022-12-18 16:43:05 +01:00
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