]> git.eshelyaron.com Git - emacs.git/log
emacs.git
20 months agoCorrect wrong info in (info)Go to node
glacials [Thu, 22 Dec 2022 20:09:08 +0000 (12:09 -0800)]
Correct wrong info in (info)Go to node

The node (info)Go to node in the Info manual states that 'g'
does not allow the use of abbreviations, however it does.
To test this, type 'gt' from this node and see that it takes
you to (info)Top, then type 'ggo<RET>' and see that it takes
you back to (info)Go to node.  Tested on emacs 28.2.
* doc/misc/info.texi (Go to node): Fix inaccurate information.
(Bug#60263)

Copyright-paperwork-exempt: yes

20 months agoFix typo in TUTORIAL.fr (bug#60261)
Eli Zaretskii [Sat, 24 Dec 2022 07:32:08 +0000 (09:32 +0200)]
Fix typo in TUTORIAL.fr (bug#60261)

* etc/tutorials/TUTORIAL.fr: Fix typo.  Reported by
Clément Escude--Cotinat <clement.escudecotinat@yahoo.fr>.

20 months agoAdd some diff-fixup-modifs tests
Daniel Martín [Thu, 22 Dec 2022 18:10:24 +0000 (19:10 +0100)]
Add some diff-fixup-modifs tests

* test/lisp/vc/diff-mode-tests.el (diff-mode-test-fixups-added-lines):
Test that diff-mode fixes patches with added lines correctly.
* test/lisp/vc/diff-mode-tests.el (diff-mode-test-fixups-empty-hunks):
Ditto for patches with empty hunks.  (Bug#60259)

20 months agoFix quoted argument in emacsclient-mail.desktop Exec key
Ulrich Müller [Mon, 19 Dec 2022 15:51:20 +0000 (16:51 +0100)]
Fix quoted argument in emacsclient-mail.desktop Exec key

Apparently the emacsclient-mail.desktop file doesn't conform to the
Desktop Entry Specification at
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables
which says about the Exec key:

| Field codes must not be used inside a quoted argument, the result of
| field code expansion inside a quoted argument is undefined.

However, the %u field code is used inside a quoted argument of the
Exec key in both the [Desktop Entry] and [Desktop Action new-window]
sections.
* etc/emacsclient-mail.desktop (Exec): The Desktop Entry
Specification does not allow field codes like %u inside a quoted
argument. Work around it by passing %u as first parameter ($1)
to the shell wrapper.
* etc/emacsclient.desktop (Exec): Use `sh` rather than `placeholder`
as the command name of the shell wrapper.  (Bug#60204)

20 months agoert-x: Move window selection logic to its own macro
Richard Hansen [Sat, 17 Dec 2022 23:51:33 +0000 (18:51 -0500)]
ert-x: Move window selection logic to its own macro

* lisp/emacs-lisp/ert-x.el (ert-with-buffer-selected): New macro to
temporarily display a buffer in a selected window and evaluate a body.
(ert-with-test-buffer-selected): Use the new macro.
* test/lisp/whitespace-tests.el
(ert-test-with-buffer-selected/current)
(ert-test-with-buffer-selected/selected)
(ert-test-with-buffer-selected/nil-buffer)
(ert-test-with-buffer-selected/modification-hooks)
(ert-test-with-buffer-selected/read-only)
(ert-test-with-buffer-selected/return-value): Add tests.
(Bug#60189)

20 months ago; ert-x: Simplify `ert-with-test-buffer-selected'
Richard Hansen [Sat, 17 Dec 2022 23:18:39 +0000 (18:18 -0500)]
; ert-x: Simplify `ert-with-test-buffer-selected'

* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected):
Simplify using 'ert-with-test-buffer'.  (Bug#60189)

20 months ago; ert-x: Add test for buffer read-only state
Richard Hansen [Sat, 17 Dec 2022 23:26:33 +0000 (18:26 -0500)]
; ert-x: Add test for buffer read-only state

This test should have been included with commit
29b7d740006fe2190a729bd1c30ccab9356cee36.
* test/lisp/emacs-lisp/ert-x-tests.el
(ert-test-with-test-buffer-selected/read-only): New test.
(Bug#60189)

20 months agoFix crash after X error
Po Lu [Sat, 24 Dec 2022 06:14:51 +0000 (14:14 +0800)]
Fix crash after X error

* src/xdisp.c (redisplay_internal): Catch another crash if
gcscrollbars after an X error.

20 months agoFix ruby-mode.el local command injection vulnerability (bug#60268)
Xi Lu [Fri, 23 Dec 2022 04:52:48 +0000 (12:52 +0800)]
Fix ruby-mode.el local command injection vulnerability (bug#60268)

* lisp/progmodes/ruby-mode.el
(ruby-find-library-file): Fix local command injection vulnerability.

20 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Fri, 23 Dec 2022 18:29:37 +0000 (19:29 +0100)]
; * etc/NEWS: Fix typos.

20 months agoMerge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29
Michael Albinus [Fri, 23 Dec 2022 17:36:08 +0000 (18:36 +0100)]
Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29

20 months agoFix "C-h k" in recursive minibuffers
Eli Zaretskii [Fri, 23 Dec 2022 14:41:08 +0000 (16:41 +0200)]
Fix "C-h k" in recursive minibuffers

* lisp/subr.el (event--posn-at-point): Leave POSN alone if it
doesn't have at least 6 members.  This follows more faithfully
what 'event-start' and 'event-end' did before they started using
this function, see commit c1cead89f5f.  Call posn-at-point with
the minibuffer-window when in the minibuffer.  (Bug#60252)

20 months ago; Improve documentation of "C-x @"
Eli Zaretskii [Fri, 23 Dec 2022 12:37:04 +0000 (14:37 +0200)]
; Improve documentation of "C-x @"

* doc/emacs/custom.texi (Modifier Keys): Document how to enter
Shift, Control, and Meta using "C-x @".

* lisp/simple.el (function-key-map): Add commentary to "C-x @"
bindings to make them easier to discover.

20 months ago; * etc/NEWS: Announce the new behavior of 'C-h f'. (Bug#60252)
Eli Zaretskii [Fri, 23 Dec 2022 11:32:18 +0000 (13:32 +0200)]
; * etc/NEWS: Announce the new behavior of 'C-h f'.  (Bug#60252)

20 months ago; * admin/notes/git-workflow: Adding "Backport:" is optional.
Sean Whitton [Thu, 22 Dec 2022 20:38:48 +0000 (13:38 -0700)]
; * admin/notes/git-workflow: Adding "Backport:" is optional.

20 months agovc-git-checkin: Don't try to apply an empty patch
Sean Whitton [Tue, 20 Dec 2022 22:53:19 +0000 (15:53 -0700)]
vc-git-checkin: Don't try to apply an empty patch

* lisp/vc/vc-git.el (vc-git-checkin): Don't try to apply an empty
patch to the index, because in that case 'git apply' fails.

(cherry picked from commit 1424342225ef5b18c630364dd88e004f4ebb1c7f)

20 months ago; Fix docstring
Ikumi Keita [Thu, 22 Dec 2022 17:23:34 +0000 (18:23 +0100)]
; Fix docstring

* lisp/textmodes/reftex-vars.el
(reftex-allow-detached-macro-args): Fix macro name in docstring.

20 months agoUpdate Tramp version (don't merge with master)
Michael Albinus [Thu, 22 Dec 2022 15:46:00 +0000 (16:46 +0100)]
Update Tramp version (don't merge with master)

* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.6.0.29.1".
(customize-package-emacs-version-alist):
Adapt Tramp version integrated in Emacs 29.1.

20 months agoEglot: eglot--servers-by-xrefed-file doesn't need to be value-weak
João Távora [Thu, 22 Dec 2022 15:44:11 +0000 (15:44 +0000)]
Eglot: eglot--servers-by-xrefed-file doesn't need to be value-weak

* lisp/progmodes/eglot.el (eglot--servers-by-xrefed-file): Doesn't
need to be weak.

20 months agoPrevent stale servers when using eglot-extend-to-xref
João Távora [Thu, 22 Dec 2022 11:29:49 +0000 (11:29 +0000)]
Prevent stale servers when using eglot-extend-to-xref

A weak-valued hash-table is not enough to guarantee that a reference
to a zombie server in eglot--servers-by-xrefed-file variable won't
survive long enough to confuse the next call to eglot--current-server
in some buffers.

So, before this fix it was common to get "Process EGLOT ... not
running" errors if some xref-extended buffers (like system libraries)
were open and M-x eglot-reconnect was issued.  This should be
prevented now.

Note however, that even after this the eglot-extend-to-xref logic is
still flawed.  For example, if a buffer for the xref-extended buffer
happens to be already visited by the time M-. is issued to navigate to
it, Eglot won't be activated.  A half-decent workaround is to kill the
buffer and re-visit it.

* lisp/progmodes/eglot.el (eglot--servers-by-xrefed-file): Move
up.
(eglot--on-shutdown): Make sure to cleanup
eglot--servers-by-xrefed-file.

20 months ago; * src/alloc.c (Fmemory_info): Doc fix.
Eli Zaretskii [Thu, 22 Dec 2022 11:02:45 +0000 (13:02 +0200)]
; * src/alloc.c (Fmemory_info): Doc fix.

21 months ago* etc/tutorials/TUTORIAL.cn: Fix typos. (Bug#60221)
Xi Lu [Tue, 20 Dec 2022 15:19:13 +0000 (23:19 +0800)]
* etc/tutorials/TUTORIAL.cn: Fix typos.  (Bug#60221)

21 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Thu, 22 Dec 2022 09:00:41 +0000 (11:00 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

21 months agoAdd alias for removed font-lock function
Benson Chu [Wed, 21 Dec 2022 23:41:32 +0000 (17:41 -0600)]
Add alias for removed font-lock function

As part of 18947103fabf8070738b3bd9c5a8d02f90988a3d,
`font-lock-fontify-syntactically-region' was renamed to
`font-lock-default-fontify-sytactically'.

* lisp/font-lock.el (font-lock-fontify-syntactically-region): Add
obsolete alias for the renamed function.

Copyright-paperwork-exempt: yes

21 months agoSet beginning/end-of-defun-function in treesit-major-mode-setup
Yuan Fu [Thu, 22 Dec 2022 08:41:58 +0000 (00:41 -0800)]
Set beginning/end-of-defun-function in treesit-major-mode-setup

* lisp/treesit.el (treesit-major-mode-setup): Set them.

21 months agoAdd treesit-defun-at-point and fix c-ts-mode-indent-defun
Yuan Fu [Wed, 21 Dec 2022 05:22:30 +0000 (21:22 -0800)]
Add treesit-defun-at-point and fix c-ts-mode-indent-defun

* lisp/treesit.el (treesit-defun-at-point): New function.
* lisp/progmodes/c-ts-mode.el (c-ts-mode-indent-defun): Implement with
treesit-defun-at-point.

21 months ago; Fix treesit--defuns-around
Yuan Fu [Wed, 21 Dec 2022 05:21:48 +0000 (21:21 -0800)]
; Fix treesit--defuns-around

Now it doesn't move point.

* lisp/treesit.el (treesit--defuns-around): Wrap some code with
save-excursion.

21 months agoUse the new keyword ':repeat' in repeatable keymaps.
Juri Linkov [Thu, 22 Dec 2022 08:03:09 +0000 (10:03 +0200)]
Use the new keyword ':repeat' in repeatable keymaps.

* lisp/bindings.el (undo-repeat-map)
(buffer-navigation-repeat-map, next-error-repeat-map)
(page-navigation-repeat-map):
* lisp/comint.el (comint-repeat-map):
* lisp/dired.el (dired-jump-map):
* lisp/outline.el (outline-navigation-repeat-map)
(outline-editing-repeat-map):
* lisp/shell.el (shell-repeat-map):
* lisp/tab-bar.el (tab-bar-switch-repeat-map)
(tab-bar-move-repeat-map):
* lisp/window.el (other-window-repeat-map)
(resize-window-repeat-map):
* lisp/winner.el (winner-repeat-map):
* lisp/eshell/em-prompt.el (eshell-prompt-repeat-map):
* lisp/eshell/esh-mode.el (eshell-command-repeat-map):
Add the keyword ':repeat' to 'defvar-keymap' instead of
setting the symbol property 'repeat-map' explicitly.

* lisp/keymap.el (defvar-keymap): Check for 'props'
that is used in 'defvar-form'.

21 months agoWhen redirecting in Eshell, check for "/dev/null" specifically
Jim Porter [Wed, 21 Dec 2022 00:20:50 +0000 (16:20 -0800)]
When redirecting in Eshell, check for "/dev/null" specifically

This is so that users can type "cmd ... > /dev/null" in Eshell no
matter what their system's null device is called.  (Users can still
use their system's null device name when redirecting, too.  Eshell
doesn't need to do anything special to support that.)  This partially
reverts 67a8bdb90c9b5865b7f17290c7135b1a5458c36d.  See bug#59545.

Do not merge to master.

* lisp/eshell/esh-io.el (eshell-set-output-handle): Use "/dev/null"
literally.

21 months ago* Invoke spawed Emacs processes with '-Q' when native compiling (bug#60208)
Andrea Corallo [Wed, 21 Dec 2022 22:26:52 +0000 (23:26 +0100)]
* Invoke spawed Emacs processes with '-Q' when native compiling (bug#60208)

* lisp/emacs-lisp/comp.el (comp-final): Invoke spawned Emacs with '-Q'.
(comp-run-async-workers): Likewise.

21 months agoFix Eshell electric slash when used from the root directory of a remote host
montag451 [Wed, 21 Dec 2022 22:21:20 +0000 (14:21 -0800)]
Fix Eshell electric slash when used from the root directory of a remote host

* lisp/eshell/em-elecslash.el (eshell-electric-forward-slash): Insert
the remote prefix as determined by 'file-remote-p'.

Copyright-paperwork-exempt: Yes

21 months agoFix the --without-all build with tree-sitter
Eli Zaretskii [Wed, 21 Dec 2022 19:52:18 +0000 (21:52 +0200)]
Fix the --without-all build with tree-sitter

* configure.ac (HAVE_TREE_SITTER): Set NEED_DYNLIB=yes, since
tree-sitter support requires dynlib.o.  (Bug#60061)

21 months agoFix write-region to null device on MS-Windows
Eli Zaretskii [Wed, 21 Dec 2022 19:23:51 +0000 (21:23 +0200)]
Fix write-region to null device on MS-Windows

* src/fileio.c (write_region) [WINDOWSNT]: Ignore EBADF errors
from fsync -- this means fsync is not supported for this file.
Happens, for example, with the null device.  (Bug#59545)

21 months agomessage: Do not default to eudc-capf-complete yet
Alexander Adolf [Wed, 21 Dec 2022 17:32:36 +0000 (12:32 -0500)]
message: Do not default to eudc-capf-complete yet

* lisp/gnus/message.el (message-mode): No longer add
eudc-capf-complete to the buffer-local value of
completion-at-point-functions.  (Bug#59314)

21 months ago; * lisp/tab-bar.el: Remaining renaming of "fixed-width" to "auto-width".
Juri Linkov [Wed, 21 Dec 2022 17:30:24 +0000 (19:30 +0200)]
; * lisp/tab-bar.el: Remaining renaming of "fixed-width" to "auto-width".

21 months agowhitespace: Avoid mutating original buffer's markers in clones
Richard Hansen [Tue, 13 Dec 2022 06:33:43 +0000 (01:33 -0500)]
whitespace: Avoid mutating original buffer's markers in clones

* lisp/whitespace.el (whitespace--clone): New hook function that is
run after cloning a buffer that copies `whitespace-bob-marker' and
`whitespace-eob-marker' and changes the copies to point to the new
buffer (Bug#59618).
(whitespace-color-on): Register the hook function.
(whitespace-color-off): Unregister the hook function.

* test/lisp/whitespace-tests.el
(whitespace-tests--with-test-buffer): New macro.
(whitespace-tests--check-markers): New function.
(whitespace-tests--indirect-clone-breaks-base-markers)
(whitespace-tests--indirect-clone-markers)
(whitespace-tests--regular-clone-markers): New tests.

21 months agoFix empty pairs in js tree-sitter imenu alist (bug#59945)
Charl P. Botha [Sat, 10 Dec 2022 17:09:38 +0000 (19:09 +0200)]
Fix empty pairs in js tree-sitter imenu alist (bug#59945)

The current js--treesit-imenu, used by the JavaScript, TypeScript and
TSX tree-sitter modes, would return empty pairs in the imenu alist if
there were none of that type of symbol.

This would break both the built in imenu and also packages like
consult-imenu.

See https://github.com/minad/consult/issues/697 for the discussion
there.

* lisp/progmodes/js.el (js--treesit-imenu): Don't add nil indexes.

Copyright-paperwork-exempt: yes

21 months ago; * lisp/treesit.el (treesit-simple-indent-presets): Fix typo.
Yuan Fu [Tue, 20 Dec 2022 01:54:12 +0000 (17:54 -0800)]
; * lisp/treesit.el (treesit-simple-indent-presets): Fix typo.

21 months ago* lisp/repeat.el: Fix repeat-keep-prefix to allow customizing it to non-nil.
Juri Linkov [Tue, 20 Dec 2022 17:22:15 +0000 (19:22 +0200)]
* lisp/repeat.el: Fix repeat-keep-prefix to allow customizing it to non-nil.

* lisp/repeat.el (repeat-keep-prefix): Add or remove
'repeat-pre-hook' depending on the customized value.
(repeat-mode): Add or remove 'repeat-pre-hook' to/from
'pre-command-hook' when 'repeat-keep-prefix' is non-nil.
(repeat-pre-hook): New function.
(repeat-get-map, repeat-check-map): New function refactored from
'repeat-post-hook'.
(repeat-post-hook): Move some code to smaller functions.
(describe-repeat-maps): Set outline-regexp without ^L.

* test/lisp/repeat-tests.el (repeat-tests-keep-prefix):
Uncomment test case that is fixed now in bug#51281 and bug#55986.

21 months agoCorrect capitalization of Lisp in the manual (bug#60222)
Daniel Martín [Tue, 20 Dec 2022 15:32:37 +0000 (16:32 +0100)]
Correct capitalization of Lisp in the manual (bug#60222)

* doc/lispref/compile.texi (Native-Compilation Functions): Fix typo.

21 months agoeglot.el: Add vscode-json-languageserver to eglot-server-programs
Brian Leung [Mon, 19 Dec 2022 23:03:06 +0000 (15:03 -0800)]
eglot.el: Add vscode-json-languageserver to eglot-server-programs

* lisp/progmodes/eglot.el (eglot-server-programs): Add the
alternative name of the vcscode JSON server.  (Bug#60198)

21 months ago; * src/emacs-module.h.in (enum emacs_funcall_exit): Fix typo.
Philipp Stephani [Tue, 20 Dec 2022 12:29:49 +0000 (13:29 +0100)]
; * src/emacs-module.h.in (enum emacs_funcall_exit): Fix typo.

21 months ago; Fix ruby-method-params-indent's :version value
Dmitry Gutov [Tue, 20 Dec 2022 00:58:48 +0000 (02:58 +0200)]
; Fix ruby-method-params-indent's :version value

21 months ago* lisp/progmodes/project.el (project--read-file-cpd-relative): Optimize.
Juri Linkov [Mon, 19 Dec 2022 19:46:40 +0000 (21:46 +0200)]
* lisp/progmodes/project.el (project--read-file-cpd-relative): Optimize.

21 months agoruby-method-params-indent: New user option
Dmitry Gutov [Mon, 19 Dec 2022 19:01:27 +0000 (21:01 +0200)]
ruby-method-params-indent: New user option

* lisp/progmodes/ruby-mode.el (ruby-method-params-indent):
New option (bug#60110).

(ruby-smie-rules): Use it.

* etc/NEWS: Mention it.

* test/lisp/progmodes/ruby-mode-resources/ruby.rb:
Ensure the var's value is default.

* test/lisp/progmodes/ruby-mode-resources/ruby-method-params-indent.rb:
New file.

* test/lisp/progmodes/ruby-mode-tests.el (ruby-deftest-indent):
New macro, use it to run the indentation test using the new file.
Disable the :expensive-test tag, because neither runs for "longer
than some few seconds", both take significantly below 1s.

21 months ago; ruby-indent-level: Improve the docstring
Dmitry Gutov [Mon, 19 Dec 2022 17:37:44 +0000 (19:37 +0200)]
; ruby-indent-level: Improve the docstring

21 months ago* lisp/progmodes/project.el: Filter out empty strings from history (bug#58447)
Juri Linkov [Mon, 19 Dec 2022 17:54:08 +0000 (19:54 +0200)]
* 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).

21 months agoFix storing email into nnmail by Gnus
Eli Zaretskii [Mon, 19 Dec 2022 17:01:04 +0000 (19:01 +0200)]
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>.

21 months ago; Really respect browse-url var in erc-compat
F. Jason Park [Mon, 12 Dec 2022 03:16:07 +0000 (19:16 -0800)]
; Really respect browse-url var in erc-compat

* lisp/erc/erc-compat.el: Do what was supposed to be done by
75f26646d4a569cfb485de4baddcda66ff44b2c3 "; 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.

21 months agowhitespace: Fix unintended change in buffer modification status
Richard Hansen [Mon, 19 Dec 2022 04:04:00 +0000 (23:04 -0500)]
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.

21 months agoMake emacsclient add abbreviated file names to file-name-history
Eli Zaretskii [Mon, 19 Dec 2022 13:33:09 +0000 (15:33 +0200)]
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)

21 months agoRepair setopt test after error demotion to warning
Mattias Engdegård [Mon, 19 Dec 2022 11:05:09 +0000 (12:05 +0100)]
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).

21 months ago; * admin/git-bisect-start: Add mistakenly ommitted commits to skip
Gregory Heytings [Mon, 19 Dec 2022 01:07:16 +0000 (01:07 +0000)]
; * admin/git-bisect-start: Add mistakenly ommitted commits to skip

21 months agoruby-mode: Support endless singleton method definitions too
Dmitry Gutov [Mon, 19 Dec 2022 00:21:51 +0000 (02:21 +0200)]
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.

21 months agoRemove comment-start-skip preset in tree-sitter indentation engine
Yuan Fu [Sun, 18 Dec 2022 22:11:54 +0000 (14:11 -0800)]
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.

21 months agoFix recent change in tramp-smb.el
Michael Albinus [Sun, 18 Dec 2022 19:17:06 +0000 (20:17 +0100)]
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'.

21 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Sun, 18 Dec 2022 15:43:05 +0000 (16:43 +0100)]
; * etc/NEWS: Fix typos.

21 months agoMake tramp-archive autoloads robust for older Emacs versions
Michael Albinus [Sun, 18 Dec 2022 15:42:51 +0000 (16:42 +0100)]
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.

21 months 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'.

21 months 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.

21 months 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)

21 months 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)

21 months 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)

21 months 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.

21 months 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.

21 months 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.

21 months 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.

21 months 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)

21 months 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.

21 months 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.

21 months 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.

21 months 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.

21 months 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.

21 months 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.

21 months 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.

21 months 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.

21 months 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.

21 months 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

21 months 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.

21 months 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.

21 months 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.

21 months 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.

21 months 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)

21 months 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)

21 months 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.

21 months 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)

21 months 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.

21 months 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.

21 months 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.

21 months 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)

21 months 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.

21 months 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.

21 months 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.

21 months 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.

21 months 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

21 months 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)

21 months 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)

21 months 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.

21 months 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.

21 months 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.