]> git.eshelyaron.com Git - emacs.git/log
emacs.git
20 months agoRequire custom values of `boolean` type to be nil or t
Mattias Engdegård [Mon, 24 Apr 2023 14:03:47 +0000 (16:03 +0200)]
Require custom values of `boolean` type to be nil or t

This helps detecting mistakes in types and/or initial values.

* lisp/wid-edit.el (boolean): Add :match function.

20 months agoAdd option to control default outlining in 'C-h b'
Eshel Yaron [Fri, 7 Apr 2023 10:09:59 +0000 (13:09 +0300)]
Add option to control default outlining in 'C-h b'

* lisp/help.el (describe-bindings-outline-rules): New user option.
(describe-bindings): Use it instead of hardcoding "Key translations".
(Bug#62708)

20 months agoFix build when Org's version changes
Eli Zaretskii [Mon, 24 Apr 2023 11:16:05 +0000 (14:16 +0300)]
Fix build when Org's version changes

* lisp/org/org-macs.el (org--inhibit-version-check): Rename from
'org--built-in-p' and make it a defvar.  All users changed.
(Bug#62762)

20 months ago; Fix last change
Jim Porter [Sun, 23 Apr 2023 19:08:32 +0000 (12:08 -0700)]
; Fix last change

20 months agoWhen examining merge commits in our Git hooks, only check the first parent
Jim Porter [Sun, 23 Apr 2023 18:43:07 +0000 (11:43 -0700)]
When examining merge commits in our Git hooks, only check the first parent

This does two things:

  1. We can properly validate log entries in merge commits.
  2. We don't check commits that were merged in from other branches.

* build-aux/git-hooks/commit-msg-files.awk (get_commit_changes): Get
the changes compared to the first parent.

* build-aux/git-hooks/pre-push: Only get the first parent of merge
commits when returning the rev-list, and only check "master" or
"emacs-NN" branches.

20 months ago; Fix logic of Git pre-push hook when pushing a new branch
Jim Porter [Sun, 23 Apr 2023 19:04:34 +0000 (12:04 -0700)]
; Fix logic of Git pre-push hook when pushing a new branch

* build-aux/git-hooks/pre-push: Update the Git command to run on each
iteration.

20 months agoImprove the logic of the file entry Git hooks to support more cases
Jim Porter [Fri, 21 Apr 2023 17:06:49 +0000 (10:06 -0700)]
Improve the logic of the file entry Git hooks to support more cases

In addition to starting with a "*", file entries now need a ":"
somewhere in them.  This helps reduce false positives with bulleted
lists.  Also, support multiple files separated by commas after a "*".

* build-aux/git-hooks/commit-msg-files.awk (check_commit_msg_files):
Accumulate file entries over multiple lines to support the above.

20 months agoAdd new Tramp method "flatpak"
Michael Albinus [Sun, 23 Apr 2023 11:37:39 +0000 (13:37 +0200)]
Add new Tramp method "flatpak"

* doc/misc/tramp.texi (Inline methods): Add flatpak.

* etc/NEWS: Add new Tramp method "flatpak".  Fix typos.

* lisp/net/tramp-container.el (tramp-flatpak-program): New defcustom.
(tramp-flatpak-method): New defconst.
(tramp-flatpak--completion-function): New defun.  Set it for "flatpak".
(tramp-methods) <flatpak>: Add.
(tramp-container-connection-local-default-flatpak-variables):
New defconst.  Set respective connection-local variables.

20 months agoImprove docstring of python-indent-def-block-scale
kobarity [Thu, 20 Apr 2023 13:55:29 +0000 (22:55 +0900)]
Improve docstring of python-indent-def-block-scale

* lisp/progmodes/python.el (python-indent-def-block-scale): Improve
docstring.  (Bug#62696)

20 months ago; * etc/NEWS: Fix last change. (Bug#62696)
Eli Zaretskii [Sat, 22 Apr 2023 09:29:55 +0000 (12:29 +0300)]
; * etc/NEWS: Fix last change.  (Bug#62696)

20 months agoAdd a new user option in Python mode to improve the indentation
kobarity [Sun, 16 Apr 2023 13:18:39 +0000 (22:18 +0900)]
Add a new user option in Python mode to improve the indentation

* lisp/progmodes/python.el (python-indent-block-paren-deeper): New
user option.
(python-indent-context): Add a new context :inside-paren-from-block.
(python-indent--calculate-indentation): Modify according to
`python-indent-block-paren-deeper' and :inside-paren-from-block.
* test/lisp/progmodes/python-tests.el
(python-indent-inside-paren-block-1)
(python-indent-inside-paren-block-2)
(python-indent-inside-paren-block-3)
(python-indent-inside-paren-block-4): New tests.
(python-indent-inside-paren-5, python-indent-dedenters-8): Modify
according to the new context.
* etc/NEWS: Document the new user option.  (Bug#62696)

20 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 22 Apr 2023 08:56:57 +0000 (04:56 -0400)]
Merge from origin/emacs-29

44145bf07e2 Add indentation style setting for c-ts-mode in .dir-local...
e7db6c59cc6 ; * .dir-locals.el (c-ts-mode): Add settings.
d041f01b02f ; Minor fix in Emacs Lisp Intro manual

20 months agoImproved nconc and append compiler optimisations
Mattias Engdegård [Thu, 20 Apr 2023 13:07:06 +0000 (15:07 +0200)]
Improved nconc and append compiler optimisations

Add the transforms:

  (nconc) -> nil
  (nconc X) -> X

and for arguments to `nconc`:

  nil -> <elided>
  (list X...) (list Y...) -> (list X... Y...)
  (list X) Y -> (cons X Y)

* lisp/emacs-lisp/byte-opt.el (byte-optimize-nconc): New.
(byte-optimize-append): Fix minor flaws and generalise.

20 months agoAdd indentation style setting for c-ts-mode in .dir-locals.el
Eli Zaretskii [Sat, 22 Apr 2023 06:41:50 +0000 (09:41 +0300)]
Add indentation style setting for c-ts-mode in .dir-locals.el

* lisp/progmodes/c-ts-mode.el (c-ts-indent-style-safep): New
predicate.
(c-ts-mode-indent-style): Use it to test the value for being safe.

* .dir-locals.el (c-ts-mode): Set 'c-ts-mode-indent-style' to 'gnu'.

20 months agoproject--read-project-buffer: Fixup default-directory if needed
Dmitry Gutov [Fri, 21 Apr 2023 23:27:22 +0000 (02:27 +0300)]
project--read-project-buffer: Fixup default-directory if needed

* lisp/progmodes/project.el (project--read-project-buffer):
Make sure that when the read buffer is new, its default-directory
belongs to the project (bug#62974).

20 months ago; * etc/NEWS: Mention the new symbol images.
Yuan Fu [Fri, 21 Apr 2023 20:48:51 +0000 (13:48 -0700)]
; * etc/NEWS: Mention the new symbol images.

20 months ago; * .dir-locals.el (c-ts-mode): Add settings.
Eli Zaretskii [Fri, 21 Apr 2023 17:54:15 +0000 (20:54 +0300)]
; * .dir-locals.el (c-ts-mode): Add settings.

20 months ago; Minor fix in Emacs Lisp Intro manual
Eli Zaretskii [Fri, 21 Apr 2023 16:16:52 +0000 (19:16 +0300)]
; Minor fix in Emacs Lisp Intro manual

* doc/lispintro/emacs-lisp-intro.texi (what-line): Fix punctuation
and wording.  Reported by Holger Kienle <hkienle@posteo.de>.
(Bug#62998)

20 months agoMerge from origin/emacs-29
Eli Zaretskii [Fri, 21 Apr 2023 11:29:14 +0000 (07:29 -0400)]
Merge from origin/emacs-29

3899acbb336 ; * src/fringe.c: Fix description of large circle.  (Bug#...
2b10e1827d3 sql: add missing postgresql types
9ac12592781 Fix display of menu-bar bindings of commands in *Help* bu...
ecdd3a9efac Improve Completion Example section in the Emacs manual
626e1ac62b2 Improve 'message-server-alist' docstring
327986936c3 Add index entry for fallback modes
1c4783c3300 ; * etc/NEWS: Copyedits and grammar fixes.
3d6f7553319 xref-search-program-alist: Fix searching larger file list...
1b8b2cf61bd Fix typo and inaccuracy in the ELisp Reference manual
df17682ebf1 ; Support 'dart-ts-mode' in Eglot
e0dc60e0780 ; Fix typos in gdb-mi.el
60560cc7adf Fix description of lexical environment's internals
1456adf4248 ; Eglot: fix a typo in a customization type
2f59595f5f4 ; * etc/NEWS: Grammar fixes.
596b780ab71 Update to Org 9.6.4-2-g0f6ae7
a0b04a22479 Documentation copyedits for 'package-install-upgrade-buil...
580d8278c5f Allow upgrading built-in packages with 'package-install'
329304c23fa ; * src/term.c (init_tty): Fix last change.  (Bug#62877)
200dbf7d302 Minor changes in c-ts-mode.el's support of DEFUNs
9686b015a0d Fix strike-through attribute support on TTY frames
39035fbfc5f Avoid crashes in 'describe-keymap' due to shadowing

# Conflicts:
# etc/NEWS
# lisp/progmodes/c-ts-mode.el
# lisp/progmodes/eglot.el

20 months agoAdd Git hooks to check filenames listed in the commit message
Jim Porter [Thu, 13 Apr 2023 06:03:31 +0000 (23:03 -0700)]
Add Git hooks to check filenames listed in the commit message

See <https://lists.gnu.org/archive/html/emacs-devel/2023-04/msg00274.html>.

* build-aux/git-hooks/commit-msg-files.awk:
* build-aux/git-hooks/post-commit:
* build-aux/git-hooks/pre-push: New files...
* autogen.sh: ... add them.

20 months ago* lisp/emacs-lisp/gv.el: Silly typo
Stefan Monnier [Thu, 20 Apr 2023 19:51:44 +0000 (15:51 -0400)]
* lisp/emacs-lisp/gv.el: Silly typo

20 months ago; * src/fringe.c: Fix description of large circle. (Bug#62961)
Eli Zaretskii [Thu, 20 Apr 2023 10:06:24 +0000 (13:06 +0300)]
; * src/fringe.c: Fix description of large circle.  (Bug#62961)

20 months agoHandle modifications in extensionless zip files (bug#61326)
Ruijie Yu [Mon, 6 Mar 2023 03:03:32 +0000 (11:03 +0800)]
Handle modifications in extensionless zip files (bug#61326)

* lisp/arc-mode.el (archive-*-write-file-member)
(archive-*-expunge): Refactor to correctly modify
extensionless zip archives.
(archive-expunge): Move implementation to a separate helper
function to facilitate testing.
(archive--act-files): New helper function to wrap around
`call-process' calls.
(archive--need-rename-p): New helper function to check whether
a temporary rename is necessary.
(archive--ensure-extension) (archive--maybe-rename): New helper
functions to rename archive if the caller deems it necessary.
(archive--with-ensure-extension): New helper function to handle
writing an archive while ensuring extensionless archives work
correctly by temporarily renaming them.

* test/lisp/arc-mode-tests.el (arc-mode-test-zip-ensure-ext):
New regression test for bug#61326.

20 months ago; Minor fixes for user-facing text in last vc-cvs.el changes
Eli Zaretskii [Thu, 20 Apr 2023 08:53:32 +0000 (11:53 +0300)]
; Minor fixes for user-facing text in last vc-cvs.el changes

* lisp/vc/vc-cvs.el (vc-cvs-repository-hostname)
(vc-cvs-parse-root): Fix doc strings, text of messages, and use of
"pathname".  (Bug#62693)

20 months agosql: add missing postgresql types
Nicolas Martyanoff [Sun, 16 Apr 2023 13:30:47 +0000 (15:30 +0200)]
sql: add missing postgresql types

* lisp/progmodes/sql.el: Add multiple missing PostgreSQL types: bigserial,
smallserial, macaddr8, jsonb, jsonpath, built-in range types, object
identifier types (oid & co).

20 months agoFix treesit-install-language-grammar for non-interactive call
Yuan Fu [Wed, 19 Apr 2023 23:23:25 +0000 (16:23 -0700)]
Fix treesit-install-language-grammar for non-interactive call

A continuation of bug#62704.

* lisp/treesit.el (treesit-install-language-grammar): Differentiate
between interactive and non-interactive call, and don't prompt when
it's called non-interactively.

20 months agoFix display of menu-bar bindings of commands in *Help* buffers
Eli Zaretskii [Wed, 19 Apr 2023 17:46:40 +0000 (20:46 +0300)]
Fix display of menu-bar bindings of commands in *Help* buffers

* lisp/help-fns.el (help-fns--insert-menu-bindings): Propertize
with 'help-key-binding' face only the menu items, not the arrows
between successive items.  This is because 'char-displayable-p' is
unreliable when we propertize the character with an arbitrary
face: that face could specify a font which doesn't support the
character after all, while 'char-displayable-p' assumes there are
no restrictions on fonts that can be used for displaying the
character.  Also, make the code more efficient by avoiding the
call to 'char-displayable-p' inside the loop.

20 months ago; * src/fns.c (assq_no_signal): Fix a typo in a comment.
Eli Zaretskii [Wed, 19 Apr 2023 16:30:55 +0000 (19:30 +0300)]
; * src/fns.c (assq_no_signal): Fix a typo in a comment.

20 months agoImprove Completion Example section in the Emacs manual
Spencer Baugh [Tue, 18 Apr 2023 22:03:36 +0000 (18:03 -0400)]
Improve Completion Example section in the Emacs manual

This can be a useful substitute for full-on fuzzy completion, as
provided by other completion styles and completion packages.
* doc/emacs/mini.texi (Completion Example): Give an example of
completion with point not at end of minibuffer.  Also, use
@kbd{@key{TAB}} when telling the user to hit TAB.  (Bug#62836)

20 months agoImprove 'message-server-alist' docstring
Robert Pluim [Wed, 19 Apr 2023 10:33:18 +0000 (12:33 +0200)]
Improve 'message-server-alist' docstring

* lisp/gnus/message.el (message-server-alist): Fix typo and clarify
what happens if there is already an X-Message-SMTP-Method header.

20 months agoAdd index entry for fallback modes
Robert Pluim [Wed, 19 Apr 2023 10:29:57 +0000 (12:29 +0200)]
Add index entry for fallback modes

* doc/emacs/custom.texi (Specifying File Variables): Add index for
'fallback modes'.

20 months ago; Double space at end of sentence for vc-cvs.el
Robert Pluim [Wed, 19 Apr 2023 07:48:02 +0000 (09:48 +0200)]
; Double space at end of sentence for vc-cvs.el

* lisp/vc/vc-cvs.el (vc-cvs-repository-hostname, vc-cvs-parse-root)
(vc-cvs-parse-status, vc-cvs-after-dir-status): Double space at end of
sentence.
* test/lisp/vc/vc-cvs-tests.el: Double space at end of sentence.

20 months ago; * etc/NEWS: Copyedits and grammar fixes.
Robert Pluim [Tue, 18 Apr 2023 14:10:10 +0000 (16:10 +0200)]
; * etc/NEWS: Copyedits and grammar fixes.

20 months agoVC: Allow `vc-default-revert' (and CVS) to revert a missing file
Olivier Certner [Thu, 6 Apr 2023 09:25:33 +0000 (11:25 +0200)]
VC: Allow `vc-default-revert' (and CVS) to revert a missing file

* lisp/vc/vc.el (vc-default-revert): Fix reverting a missing file case
by not trying to create a backup through `copy-file'.  Notably impacts
CVS, where `vc-cvs-revert' calls `vc-default-revert'.

20 months agoVC: CVS: Fix parsing of 'cvs -qn update' for missing files for 1.12
Olivier Certner [Thu, 6 Apr 2023 08:52:23 +0000 (10:52 +0200)]
VC: CVS: Fix parsing of 'cvs -qn update' for missing files for 1.12

* lisp/vc/vc-cvs.el (vc-cvs-after-dir-status): Fix the name reported
for missing files in the case of CVS 1.12.3+ where name is quoted in
the warning line (it was not before this version).  Use instead the
following U line, where the name is never quoted on all versions.

20 months agoVC: CVS: Fix "Root" file parsing
Olivier Certner [Thu, 6 Apr 2023 08:16:33 +0000 (10:16 +0200)]
VC: CVS: Fix "Root" file parsing

The new "Root" file parsing has been based on CVS' documentation,
which gives the following format for *remote* repositories:
[:method:][[user][:password]@]hostname[:[port]]/pathname/to/repository
and for local ones:
:local:/pathname/to/repository
or
:local:c:/pathname/to/repository
or alternatively ':local:' replaced by ':fork:', or ':local:' omitted
when the path starts with a slash.

[The actual parsing code in CVS is actually a bit more restrictive.
See 'root.c'.]

Most notably, the previous version could not parse an absolute
pathname without an explicit :local: method or :pserver: lines with
passwords.

* lisp/vc/vc-cvs.el (vc-cvs-parse-root): Rewrite.

(vc-cvs-repository-hostname): Cope with `vc-cvs-parse-root' returning
an empty hostname (can only happen if the "Root" file is invalid),
returning nil in this case.

(vc-cvs-parse-uhp): Remove this standalone function formerly used only
by `vc-cvs-parse-root' and which doesn't allow correct parsing anyway.

* test/lisp/vc/vc-cvs-tests.el: New file, with tests for common "Root"
file content.

20 months agoEglot: unbreak activation/management of derived modes (bug#62907)
João Távora [Tue, 18 Apr 2023 23:59:17 +0000 (00:59 +0100)]
Eglot: unbreak activation/management of derived modes (bug#62907)

After recent changes to how LSP "languageId" is computed from major
modes and stored in the eglot-lsp-server object, the activation of the
'eglot--managed-mode' minor mode in modes _derived_ from some
major-mode mentioned in 'eglot-server-programs' was broken.

This commit restores that by introducing a new helper which uses the
same logic to provide the current-buffer's "languageId" to the server
and to discover if the server should manage the mode at all.  This
ensures the two things stay in sync.

Also, this helper uses the function 'provided-mode-derived-p' to fix
this bug#62907.

* lisp/progmodes/eglot.el (eglot--languageId): New helper.
(eglot-current-server, eglot--TextDocumentItem): Use it.

20 months agoflymake-end-of-line-diagnostics-face: Tweak a little
Dmitry Gutov [Tue, 18 Apr 2023 22:56:57 +0000 (01:56 +0300)]
flymake-end-of-line-diagnostics-face: Tweak a little

* lisp/progmodes/flymake.el
(flymake-end-of-line-diagnostics-face):
Use height 0.85 and ensure the box doesn't change the line height
(https://debbugs.gnu.org/62029#86).

20 months agoxref-search-program-alist: Fix searching larger file lists on MS Windows
Dmitry Gutov [Tue, 18 Apr 2023 22:29:20 +0000 (01:29 +0300)]
xref-search-program-alist: Fix searching larger file lists on MS Windows

* lisp/progmodes/xref.el (xref-search-program-alist):
Add '-s 10000' to xargs' options when on Windows or DOS.
Apparently the xargs port doesn't currently know how to obey the
system-wide limits (https://debbugs.gnu.org/bug=61667#521).

20 months agoFix typo and inaccuracy in the ELisp Reference manual
Shynur [Sun, 16 Apr 2023 18:13:32 +0000 (02:13 +0800)]
Fix typo and inaccuracy in the ELisp Reference manual

* doc/lispref/loading.texi (Dynamic Modules): Fix a typo.
* doc/lispref/customize.texi (Group Definitions): Faces are also
in the 'custom-group' property of a customization group.
(Bug#62887)

Copyright-paperwork-exempt: yes

20 months ago; Support 'dart-ts-mode' in Eglot
Eli Zaretskii [Tue, 18 Apr 2023 11:49:18 +0000 (14:49 +0300)]
; Support 'dart-ts-mode' in Eglot

* lisp/progmodes/eglot.el (eglot-server-programs): Add
'dart-ts-mode'.  Patch by Mou Tong <mou.tong@outlook.com>.
(Bug#62879)

20 months ago; Fix typos in gdb-mi.el
Eli Zaretskii [Tue, 18 Apr 2023 11:36:28 +0000 (14:36 +0300)]
; Fix typos in gdb-mi.el

* lisp/progmodes/gdb-mi.el (gdbmi-bnf-result-state-configs): Fix
typos introduced while fixing bug#10580.  (Bug#62858)

20 months agoFix description of lexical environment's internals
Eli Zaretskii [Tue, 18 Apr 2023 11:30:28 +0000 (14:30 +0300)]
Fix description of lexical environment's internals

* doc/lispref/variables.texi (Lexical Binding): Update the
description of how the lexical environment is represented
internally.  (Bug#62840)

20 months ago; Eglot: fix a typo in a customization type
Idir Lankri [Fri, 14 Apr 2023 13:52:24 +0000 (15:52 +0200)]
; Eglot: fix a typo in a customization type

* lisp/progmodes/eglot.el (eglot-ignored-server-capabilities): Fix the
value associated with the tag "Go to declaration".  (Bug#62849)

Copyright-paperwork-exempt: yes

20 months agoFix verilog-diff-file-with-buffer
Basil L. Contovounesios [Sun, 2 Apr 2023 15:46:33 +0000 (16:46 +0100)]
Fix verilog-diff-file-with-buffer

* lisp/progmodes/verilog-mode.el: Fix commentary to avoid implying
XEmacs defines diff-command.
(verilog-diff-file-with-buffer): Claim compatibility with Emacs 21
rather than XEmacs in commentary, since the latter does not seem to
define diff-command.  Use get-buffer in place of likely thinko
with-temp-buffer + BUFNAME + current-buffer.  Fix unused
unwind-protect: move temporary file deletion to its unwind
forms (bug#62620).  Avoid race condition between file existence
check and deletion.  Handle list-valued diff-switches.  Avoid
passing empty argument to diff-command.

20 months agoFix :package-version in flymake.el
Michael Albinus [Tue, 18 Apr 2023 09:10:12 +0000 (11:10 +0200)]
Fix :package-version in flymake.el

* lisp/progmodes/flymake.el (flymake-end-of-line-diagnostics-face)
(flymake-error-echo-at-eol, flymake-warning-echo-at-eol)
(flymake-note-echo-at-eol): Fix :package-version.

20 months ago* lisp/gnus/gnus-sum.el (gnus-summary-refer-thread): Fix limiting
Andrew G Cohen [Tue, 18 Apr 2023 03:12:54 +0000 (11:12 +0800)]
* lisp/gnus/gnus-sum.el (gnus-summary-refer-thread): Fix limiting

20 months ago* lisp/emacs-lisp/gv.el (error): Add gv-expander
Stefan Monnier [Mon, 17 Apr 2023 22:15:45 +0000 (18:15 -0400)]
* lisp/emacs-lisp/gv.el (error): Add gv-expander

This fixes incorrect expansion of (setf (case-exhaustive ..) ..),
as found for example in `elpa-admin.el`.

20 months agoFlymake: improve new flymake-show-diagnostics-at-end-of-line feature
João Távora [Mon, 17 Apr 2023 12:04:39 +0000 (13:04 +0100)]
Flymake: improve new flymake-show-diagnostics-at-end-of-line feature

* lisp/progmodes/flymake.el (flymake-end-of-line-diagnostics-face)
(flymake-error-echo-at-eol, flymake-warning-echo-at-eol)
(flymake-note-echo-at-eol): New faces
(flymake-error, flymake-warning, flymake-note): Use new faces.
(flymake--highlight-line): Rework.
(flymake-after-change-function): Rework.

20 months ago; * etc/NEWS: Grammar fixes.
Robert Pluim [Mon, 17 Apr 2023 10:24:30 +0000 (12:24 +0200)]
; * etc/NEWS: Grammar fixes.

20 months ago; Fix typos in treesit.c
Yuan Fu [Mon, 17 Apr 2023 03:35:45 +0000 (20:35 -0700)]
; Fix typos in treesit.c

* src/treesit.c (treesit_traverse_validate_predicate)
(Ftreesit_node_match_p): Fix typos.

20 months agoNew helper function assq_no_signal
Yuan Fu [Mon, 17 Apr 2023 03:33:51 +0000 (20:33 -0700)]
New helper function assq_no_signal

* src/fns.c (assq_no_signal): New function.
* src/lisp.h (assoc_no_signal): Declare it.
* src/treesit.c (safe_assq): Remove function.
(treesit_traverse_get_predicate): Change safe_assq to assq_no_signal.

20 months agoUpdate to Org 9.6.4-2-g0f6ae7
Kyle Meyer [Mon, 17 Apr 2023 01:13:08 +0000 (21:13 -0400)]
Update to Org 9.6.4-2-g0f6ae7

20 months agoInclude previous summary buffer articles in gnus thread referrals
Andrew G Cohen [Mon, 17 Apr 2023 00:09:12 +0000 (08:09 +0800)]
Include previous summary buffer articles in gnus thread referrals

* lisp/gnus/gnus-search.el (gnus-search-thread): Include all the
current articles along with the thread when searching outside the
current group.

20 months agoEglot: guard against empty 'textDocument/documentSymbol' response
João Távora [Mon, 17 Apr 2023 00:37:19 +0000 (01:37 +0100)]
Eglot: guard against empty 'textDocument/documentSymbol' response

* lisp/progmodes/eglot.el (eglot-imenu): Protect against missing response.

20 months agoDocumentation copyedits for 'package-install-upgrade-built-in' etc
Eli Zaretskii [Sun, 16 Apr 2023 15:11:07 +0000 (18:11 +0300)]
Documentation copyedits for 'package-install-upgrade-built-in' etc

* etc/NEWS: More details about the new option
'package-install-upgrade-built-in'.

* lisp/emacs-lisp/package.el (package-install-upgrade-built-in)
(package--active-built-in-p, package-install): Doc fixes.
(Bug#62720)

20 months agoAllow upgrading built-in packages with 'package-install'
Philip Kaludercic [Thu, 13 Apr 2023 18:13:59 +0000 (20:13 +0200)]
Allow upgrading built-in packages with 'package-install'

* etc/NEWS: Mention the change
* lisp/emacs-lisp/package.el (package--upgradable-built-in-p): Add new
predicate.
(package-install-upgrade-built-in): Add new user option to enable
feature.
(package-install): Respect new user option.

20 months agoFit symbol_redirect snugly in two bits
Mattias Engdegård [Sun, 16 Apr 2023 09:20:05 +0000 (11:20 +0200)]
Fit symbol_redirect snugly in two bits

This allows the C compiler to do away with all default clauses when
switching on the `redirect` field.

* src/lisp.h (enum symbol_redirect): Use values in the 0..3 range,
which also matches the old comment in struct Lisp_Symbol.
(enum symbol_interned, enum symbol_redirect)
(enum symbol_trapped_write): Comment members.  Remove explicit values.
(struct Lisp_Symbol): Shrink the `redirect` member to 2 bits.
Use the correct type for the `interned` field.
Move value comments to their types.
* src/pdumper.c (dump_symbol): Update hashes.

20 months ago; * src/term.c (init_tty): Fix last change. (Bug#62877)
Eli Zaretskii [Sun, 16 Apr 2023 08:16:45 +0000 (11:16 +0300)]
; * src/term.c (init_tty): Fix last change.  (Bug#62877)

20 months agoMinor changes in c-ts-mode.el's support of DEFUNs
Eli Zaretskii [Sun, 16 Apr 2023 08:12:39 +0000 (11:12 +0300)]
Minor changes in c-ts-mode.el's support of DEFUNs

* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-DEFUN): Renamed
from 'c-ts-mode--fontify-defun'; all callers changed.
(c-ts-mode-emacs-sources-support): Renamed from
'c-ts-mode-emacs-devel' and made into a defcustom; all users
changed.
(c-ts-mode--emacs-defun-p, c-ts-mode--emacs-defun-at-point)
(c-ts-mode--emacs-current-defun-name): Doc fixes.  (Bug#62825)

20 months agoFix strike-through attribute support on TTY frames
Eli Zaretskii [Sun, 16 Apr 2023 06:19:15 +0000 (09:19 +0300)]
Fix strike-through attribute support on TTY frames

* src/term.c (init_tty): Fix setting the strike-through capability
with "smxx".  (Bug#62265)

20 months agoAvoid crashes in 'describe-keymap' due to shadowing
Eli Zaretskii [Sun, 16 Apr 2023 05:51:22 +0000 (08:51 +0300)]
Avoid crashes in 'describe-keymap' due to shadowing

* src/keymap.c (describe_vector): Handle shadowing by something
other than a symbol.  (Bug#62867)

20 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 17:05:04 +0000 (13:05 -0400)]
Merge from origin/emacs-29

b7023da6627 Make image-map bindings available on image links
d9e96c029bb * CONTRIBUTE: Fix a typo
3f71a2a0cf6 ; * lisp/progmodes/c-ts-mode.el (treesit-node-next-siblin...
adf9c956c28 Add to Eglot support for additional language-servers.
b3603b84bd9 Partial support for DEFUN in c-ts-mode (bug#62825)

# Conflicts:
# lisp/progmodes/c-ts-mode.el

20 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 17:02:06 +0000 (13:02 -0400)]
; Merge from origin/emacs-29

The following commits were skipped:

14e809ddff1 Fix style and unwinding code in treesit.c
759cdf1e510 Catch signals produced by PRED in tree-sitter search func...

20 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 17:02:04 +0000 (13:02 -0400)]
Merge from origin/emacs-29

864a4dc2363 Fix compilation of w32.c with old MinGW system headers
a22eb9ae0f9 ruby-add-log-current-method: Reduce the use of 'nreverse'
17d803d0a75 Fix detection of WebP images by their signature
43290391ce2 ; Eglot: make version parseable by version-to-list
6e6e8b5c974 Add more documentation for the keys of `package-vc-select...
7972b76c2c7 ; vc-checkout: Wrap var lookup in 'bound-and-true-p'
e9fef1d70ff vc-checkout: Try to use the vc-dir's backend first
372e024accd ; Fix wallpaper-tests on XFCE
7055fd8e43e Improve documentation related to 'ispell-complete-word'
61fd017abde * configure.ac: Add -lbsd on Haiku.
05971c4d9a4 Add menu to 'c-ts-mode' and 'c++-ts-mode'

# Conflicts:
# lisp/progmodes/eglot.el
# lisp/progmodes/ruby-mode.el

20 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:44:49 +0000 (12:44 -0400)]
; Merge from origin/emacs-29

The following commit was skipped:

954e2d96a92 Update manual about `sort`

20 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:44:48 +0000 (12:44 -0400)]
Merge from origin/emacs-29

c62afb10cf0 Fix wallpaper-tests on MS-Windows
f2d212c6966 Fix a couple of eglot-tests
338b3718b6c Fix visiting RPM files
b4afee03193 Fix ff-quiet-mode doc
2445100d7d6 ; Improve documentation of 'match-buffers'
d4d0da96f0b ; Update make-tarball.txt for Emacs 29.
9b0bf694da4 ; Fix ldefs-boot.el.
0cb86a348c7 ; Update ChangeLog.4.

# Conflicts:
# ChangeLog.4

20 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:43:41 +0000 (12:43 -0400)]
; Merge from origin/emacs-29

The following commit was skipped:

5e039d5a6e9 * lisp/ldefs-boot.el: Regenerate.

20 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:43:41 +0000 (12:43 -0400)]
Merge from origin/emacs-29

671abd0cc40 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ...

20 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:43:41 +0000 (12:43 -0400)]
; Merge from origin/emacs-29

The following commit was skipped:

4bc678ec9f4 Bump Emacs version to 29.0.90

20 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:43:40 +0000 (12:43 -0400)]
Merge from origin/emacs-29

db8f207e52f Fix some cases of incomplete code's indentation [c/c++-ts...
589959fb09d project-search: Pipe the list of files through 'file-regu...

20 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:43:40 +0000 (12:43 -0400)]
; Merge from origin/emacs-29

The following commit was skipped:

2b91567bf61 Update ChangeLog and AUTHORS for Emacs 29

20 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:43:40 +0000 (12:43 -0400)]
Merge from origin/emacs-29

d6af1f14982 ; doc/lispref/windows.texi: Fix @pxref paren.

20 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:43:40 +0000 (12:43 -0400)]
; Merge from origin/emacs-29

The following commits were skipped:

57490fff6ec ; Backport: Eglot: fix misplaced parenthesis in last comm...
2a62273f3bf Backport: Eglot: no more tests based on Pylsp (bug#62694)

20 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 15 Apr 2023 16:43:37 +0000 (12:43 -0400)]
Merge from origin/emacs-29

5ef7ff05736 ; Start a new ChangeLog.4 file.
11126c6d30a Fix 'C-h k' for "Paste from Kill Menu" in context menus
74ddfe811f9 ; * doc/misc/calc.texi (Rewrites Tutorial): Fix a typo (b...
08cda286c3f Improve the documentation of the XDS support
14d1c00e806 Allow reindentation of images inserted by 'mm-inline-image'
b63a9eda01c Fix "C-h k" and "C-h c" with Paste from Kill Menu
b36c21e27dc Change cursor color on NS port when it matches the face b...
96714c106b7 Improve documentation of image-related commands
6a2863ca016 Fix handling of sliced images
5be79fd05a5 ; * etc/NEWS: Announce 'cyrillic-mongolian' IM.
ca1a0fda98a ; Fix last change.
ce63462dbda Add cyrillic-mongolian input method
58801792706 ; Minor addition to the Emacs FAQ
88847dee125 Jsonrpc: don't bind inhibit-read-only to t so early
cb8c87a423a Allow active region when IM is used

# Conflicts:
# etc/NEWS

20 months agoMake image-map bindings available on image links
Andreas Schwab [Sat, 15 Apr 2023 10:35:24 +0000 (12:35 +0200)]
Make image-map bindings available on image links

* lisp/net/shr.el (shr-map): Move shr-browse-image to "M-i".
* lisp/net/eww.el (eww-image-link-keymap): Use shr-image-map.

20 months ago* CONTRIBUTE: Fix a typo
Alan Mackenzie [Sat, 15 Apr 2023 11:00:38 +0000 (11:00 +0000)]
* CONTRIBUTE: Fix a typo

20 months agoCleaner solution for Org version updates
Eli Zaretskii [Sat, 15 Apr 2023 10:47:00 +0000 (13:47 +0300)]
Cleaner solution for Org version updates

* lisp/Makefile.in (BYTE_COMPILE_FLAGS): Set org--built-in-p
non-nil, to avoid aborting the build when Org's version is bumped.
($(lisp)/org/org.elc): Remove dependencies of org-version.el, as
no longer needed.  (Bug#62762)

20 months ago; * lisp/progmodes/c-ts-mode.el (treesit-node-next-sibling): Declare.
Eli Zaretskii [Sat, 15 Apr 2023 10:12:20 +0000 (13:12 +0300)]
; * lisp/progmodes/c-ts-mode.el (treesit-node-next-sibling): Declare.

20 months ago; * lisp/treesit.el (treesit-node-top-level): Fix typo.
Eli Zaretskii [Sat, 15 Apr 2023 10:02:25 +0000 (13:02 +0300)]
; * lisp/treesit.el (treesit-node-top-level): Fix typo.

20 months ago; * doc/misc/gnus.texi (Finding the Parent): Fix whitespace.
Eli Zaretskii [Sat, 15 Apr 2023 09:55:35 +0000 (12:55 +0300)]
; * doc/misc/gnus.texi (Finding the Parent): Fix whitespace.

20 months agoAdd to Eglot support for additional language-servers.
Jostein Kjønigsen [Fri, 14 Apr 2023 21:11:02 +0000 (23:11 +0200)]
Add to Eglot support for additional language-servers.

* lisp/progmodes/eglot.el (eglot-server-programs): Add
'vscode-markdown-language-server' for Markdown and
'dot-language-server' for GraphViz.  (Bug#62844)

20 months agoFix errors when nnselect-always-regenerate is t (bug#61539)
Andrew G Cohen [Thu, 30 Mar 2023 02:11:06 +0000 (10:11 +0800)]
Fix errors when nnselect-always-regenerate is t (bug#61539)

The group parameter nnselect-always-regenerate causes the list of
articles in the group to be generated each time it is needed. For this
to work reliably the list of articles has to be generated at the
appropriate time and to have a reproducible ordering.

* lisp/gnus/gnus-search.el (gnus-search-run-search): For nnselect
groups if the article list has not been stored, regenerate it.
* lisp/gnus/nnselect.el (nnselect-generate-artlist): Sort the
generated list of articles by RSV, group, and number.  Store the
artlist after generation. When the new optional argument INFO is
non-nil, update the group info.
(nnselect-compress-artlist, nnselect-uncompress-artlist): Preserve the
article list ordering.
(nnselect-get-artlist): Return nil when nnselect-always-regenerate is t.
(nnselect-store-artlist): Store the group active range along with the
artlist. Don't keep the artlist if nnselect-always-regenerate is t.
(nnselect-request-group): The full article list isn't needed at this
stage, only the active range.
(nnselect-retrieve-headers): Regenerate the article list if there
is no stored value. Inhibit gnus-demon while retrieving headers.
(nnselect-request-group-scan): Don't generate the article list when
nnselect-always-regenerate is t since it will be generated again later
on.
(nnselect-request-create-group): Allow the artlist to be passed as an
argument to the function. Update the group info and store the artlist.

20 months agoImprove gnus thread-referral
Andrew G Cohen [Tue, 22 Nov 2022 07:39:01 +0000 (15:39 +0800)]
Improve gnus thread-referral

Allow thread referral to use search whenever possible, displaying the
results in the current summary buffer if possible and a new nnselect
buffer if not.

* lisp/gnus/nnimap.el (nnimap-request-thread): Obsolete function.
* lisp/gnus/gnus-search.el (gnus-search-thread): Allow detailed
specification of how/where to search. Add found articles to the
current summary buffer if possible, or create a new ephemeral nnselect
group if not.
* lisp/gnus/gnus-sum.el (gnus-refer-thread-use-search): Allow a list
of servers and groups to search.
(gnus-summary-refer-thread): Find thread-related articles by using a
backend-specific method, gnus-search, or retrieving nearby headers in
the current group.
* lisp/gnus/nnselect.el (nnselect-search-thread): Obsolete function.
(nnselect-request-thread): Allow thread referral from nnselect groups.
* doc/misc/gnus.texi (Finding the Parent): Document changes to thread
referral.

20 months agoSupport treesit-thing-settings in search functions
Yuan Fu [Fri, 14 Apr 2023 22:13:11 +0000 (15:13 -0700)]
Support treesit-thing-settings in search functions

* src/treesit.c (safe_assq)
(treesit_traverse_get_predicate): New functions.
(treesit_traverse_validate_predicate)
(treesit_traverse_match_predicate): Support symbols.
(Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree)
(Ftreesit_node_match_p): Move validation down so we can pass LANGUAGE
to it.

20 months agoAdd a recursion level limit for tree-sitter search predicates
Yuan Fu [Fri, 14 Apr 2023 20:32:55 +0000 (13:32 -0700)]
Add a recursion level limit for tree-sitter search predicates

* src/treesit.c:
(treesit_traverse_validate_predicate): Check for recursion level.
(Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree)
(Ftreesit_node_match_p): Update uses of
treesit_traverse_validate_predicate.

20 months ago; Minor fixes in treesit.c
Yuan Fu [Fri, 14 Apr 2023 18:19:25 +0000 (11:19 -0700)]
; Minor fixes in treesit.c

* src/treesit.c:
(treesit_initialized): Make static.
(treesit_find_override_name): Add check for XCAR (tail).
(Ftreesit_parser_set_included_ranges): Fix comment.

(treesit_recursion_limit): Change to a compile time
constant.
(treesit_symbol_to_c_name): Precompute the length.
(Ftreesit_pattern_expand): Use predefined symbols.
(treesit_cursor_helper)
(Ftreesit_search_subtree)
(Ftreesit_induce_sparse_tree): Update treesit_recursion_limit.
(syms_of_treesit): New symbols.

20 months agoAdd treesit-thing-settings
Yuan Fu [Fri, 14 Apr 2023 17:37:10 +0000 (10:37 -0700)]
Add treesit-thing-settings

* lisp/treesit.el (treesit--things-around)
(treesit--navigate-thing)
(treesit-thing-at-point): Update docstring.
* src/treesit.c (treesit_traverse_validate_predicate): Refer to
treesit-thing-settings.
(syms_of_treesit): Add Vtreesit_thing_settings.

20 months agoConvert PATTERN and REGEXP to PRED in tree-sitter functions
Yuan Fu [Fri, 14 Apr 2023 04:58:52 +0000 (21:58 -0700)]
Convert PATTERN and REGEXP to PRED in tree-sitter functions

Just changing names.

* lisp/treesit.el (treesit-beginning-of-thing):
(treesit-end-of-thing)
(treesit--things-around)
(treesit--navigate-thing)
(treesit-thing-at-point): Change REGEXP and PATTERN to PRED.

20 months agoMake use of the new pred shapes in treesit.el
Yuan Fu [Fri, 14 Apr 2023 02:48:57 +0000 (19:48 -0700)]
Make use of the new pred shapes in treesit.el

treesit-search-forward and friends now accept more shapes for PRED,
make use of it in navigation functions.

* lisp/treesit.el (treesit-node-top-level): Use treesit-node-match-p.
(treesit--thing-unpack-pattern): Remove function.
(treesit-beginning-of-thing)
(treesit-end-of-thing): Remove PRED argument.
(treesit--things-around): Remove PRED argument, use
treesit-node-match-p.
(treesit--top-level-thing): Remove function.
(treesit--navigate-thing): Remove PRED argument.
(treesit-thing-at-point): Update docstring, don't unpack PATTERN.

* test/src/treesit-tests.el:
(treesit--ert-test-defun-navigation): Don't unpack pattern.

20 months agoAdd treesit-node-match-p
Yuan Fu [Fri, 14 Apr 2023 02:20:53 +0000 (19:20 -0700)]
Add treesit-node-match-p

* src/treesit.c (Ftreesit_node_match_p): New function.

20 months agoPartial support for DEFUN in c-ts-mode (bug#62825)
Yuan Fu [Fri, 14 Apr 2023 19:52:46 +0000 (12:52 -0700)]
Partial support for DEFUN in c-ts-mode (bug#62825)

The DEFUN is hard to incorporate because it's made of two nodes rather
than one, and most tree-sitter functionalities assume a defun is one
node.  I fixed the indent-defun and add-log functionality, but
beginning/end-of-defun and imenu still don't recognize DEFUN.

* lisp/progmodes/c-ts-mode.el (c-ts-mode-emacs-devel): New variable.
(c-ts-mode--defun-name): Support DEFUN.
(c-ts-mode--defun-valid-p): Support DEFUN.
(c-ts-mode--emacs-defun-p)
(c-ts-mode--emacs-defun-at-point): New functions.
(c-ts-mode-indent-defun): Use c-ts-mode--emacs-defun-at-point.
(c-ts-mode--emacs-current-defun-name): New function.
(c-ts-mode, c++-ts-mode): Optionally setup custom defun-name function.

20 months agoDisallow creation of circular variable alias chains
Mattias Engdegård [Fri, 14 Apr 2023 16:26:27 +0000 (18:26 +0200)]
Disallow creation of circular variable alias chains

Make `defvaralias` signal an error upon attempts to create variable
alias cycles.  This detects errors earlier and makes the alias
traversal during execution simpler and faster since no cycle detection
is needed elsewhere.
Now variable and function aliases are handled identically in these
respects.

* src/lisp.h (indirect_variable): Remove declaration.
* src/data.c (indirect_variable): Remove.
(Findirect_variable): Update doc string.  Simplify alias resolution.
(Fboundp, find_symbol_value, set_internal, default_value)
(set_default_internal, Fmake_variable_buffer_local)
(Fmake_local_variable, Fkill_local_variable, Flocal_variable_p)
(Flocal_variable_if_set_p, Fvariable_binding_locus):
* src/buffer.c (buffer_local_value):
* src/eval.c (specbind): Simplify variable alias resolution.
(Fdefvaralias): Update doc string.  Check for cycles.
* doc/lispref/variables.texi (Variable Aliases):
Mention that `defvaralias` can signal `cyclic-variable-indirection`
but `indirect-variable` cannot.
* etc/NEWS: Announce the change.
* test/src/eval-tests.el (eval-tests-defvaralias): New test.

20 months agoImprove C++ concept indentation.
Alan Mackenzie [Fri, 14 Apr 2023 16:37:33 +0000 (16:37 +0000)]
Improve C++ concept indentation.

This fixes bug #62386.

* lisp/progmodes/cc-engine.el (c-forward-over-compound-identifier): Don't
move forward over whitespace following the identifier.
(c-forward-primary-expression): Add parameter stop-at-end meaning don't move
forward over whitespace after the construct when non-nil.  Don't recognise a
primary expression when an open brace follows a parenthesized expression.
(c-forward-constraint-clause): Extracted from c-forward-c++-requires-clause.
Add parameter stop-at-end as above.
(c-forward-c++-requires-clause): New stop-at-end parameter as above.  Call the
new function c-forward-constraint-clause.
(c-forward-concept-fragment, c-looking-at-concept)
(c-in-requires-or-at-end-of-clause, c-c++-vsemi-p): New functions.
(c-guess-basic-syntax): New CASE 5A.7: "defun" open in a requires expression.
CASE 5F: Close of a non-class declaration level block: Move to earlier in the
function.
CASE 5D: Also check for being in or at end of a constraint.
New CASE 20: A C++ requires sub-clause.
New CASE 16G: The closing brace of a requires clause.
New CASE 17J: First "statement" inside a requires "function".
(c-forward-primary-expression, c-forward-declarator, c-forward-decl-or-cast-1)
(c-looking-at-or-maybe-in-bracelist): Amend the method of detecting end of
symbol "requires" (aka c-fun-name-substitute-key).

* lisp/progmodes/cc-fonts.el (c-get-fontification-context): Amend the method
of detecting end of symbol "requires".

* lisp/progmodes/cc-langs.el (c-at-vsemi-p-fn): Change the C++ entry to
c-c++-vsemi-p.
(c-fun-name-substitute-key): Change to an unadorned regexp.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Add new syntactic symbol
constraint-cont.

* doc/misc/cc-mode.texi (Syntactic Symbols): Add an entry for contraint-cont.
(Constraint Symbols): New node under Syntactic Symbols.

20 months ago* src/nsterm.m (check_native_fs): Add missing void arg.
Robert Pluim [Thu, 13 Apr 2023 08:05:17 +0000 (10:05 +0200)]
* src/nsterm.m (check_native_fs): Add missing void arg.

20 months ago; Fix typos
Michael Albinus [Fri, 14 Apr 2023 12:36:29 +0000 (14:36 +0200)]
; Fix typos

* etc/NEWS: Fix typos.

* lisp/progmodes/flymake.el (flymake-error-echo)
(flymake-warning-echo, flymake-note-echo)
(flymake-show-diagnostics-at-end-of-line): Fix :package-version.

20 months agoUse BASE_EQ in treesit.c
Mattias Engdegård [Fri, 14 Apr 2023 10:15:13 +0000 (12:15 +0200)]
Use BASE_EQ in treesit.c

* src/treesit.c (Ftreesit_node_check, Ftreesit_pattern_expand)
(Ftreesit_query_capture, treesit_traverse_validate_predicate)
(treesit_traverse_match_predicate):
Use BASE_EQ instead of EQ where this is obviously correct.

20 months agoMake c-emacs-features use the proper binding of parse-sexp-lookup-properties
Alan Mackenzie [Fri, 14 Apr 2023 10:33:03 +0000 (10:33 +0000)]
Make c-emacs-features use the proper binding of parse-sexp-lookup-properties

This is relevant for bug #58558, although it does not fix it.  Due to a wrong
ordering of with-current-buffer and a let form, the function overwrote the
global value of parse-sexp-lookup-properties and two other variables.

* lisp/progmodes/cc-defs.el (c-emacs-features): Change the nesting of
with-current-buffer and let so that the let bindings get used.

20 months agoFix style and unwinding code in treesit.c
Eli Zaretskii [Fri, 14 Apr 2023 06:21:05 +0000 (09:21 +0300)]
Fix style and unwinding code in treesit.c

This was supposed to be a cherry-pick from master, but
isn't, due to the unnecessary rush to fix master without
cleaning up the mess first and without separating changes
that can and cannot be backported.
* src/treesit.c (treesit_traverse_cleanup_cursor): Fix indentation
style.
(Ftreesit_search_subtree, Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree): Fix specpdl unwinding.  (Bug#62823)
Do not merge to master.

20 months agoCatch signals produced by PRED in tree-sitter search functions
Yuan Fu [Thu, 13 Apr 2023 21:36:46 +0000 (14:36 -0700)]
Catch signals produced by PRED in tree-sitter search functions

Earlier we switched to using cursors rather than nodes to traverse the
parse tree.  Because cursors need cleanup, we have to catch signals
thrown by the predicate functions and free the cursor. Failing to do
this will result in leaking the cursor whenever the predicate function
signals in a search function.  This change fixes the leak.
* src/treesit.c (treesit_traverse_cleanup_cursor): New function.
(Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree): Catch signals.  (Bug#62823)

(cherry picked from commit a5eb9f6ad4e6f5a2819b540a477f1e889f6ef355)