]> git.eshelyaron.com Git - emacs.git/log
emacs.git
22 months agoDefault mbox "From " time zone to -0000
Paul Eggert [Fri, 30 Dec 2022 05:27:45 +0000 (21:27 -0800)]
Default mbox "From " time zone to -0000

* lisp/mail/rmailout.el (rmail-nuke-pinhead-header):
Default the time zone to "-0000" instead of "EST", as "-0000" is
the RFC-2822-and-later standard for unknown time zones.

22 months agoIn cal-dst, be consistent re default to UTC
Paul Eggert [Fri, 30 Dec 2022 03:16:09 +0000 (19:16 -0800)]
In cal-dst, be consistent re default to UTC

* lisp/calendar/cal-dst.el (calendar-standard-time-zone-name)
(calendar-daylight-time-zone-name):
When using alphabetic time zone abbreviations, default to "UTC"
rather than to "EST" or "EDT", to be consistent with the behavior
when using numeric time zone abbreviations.
Also, in the numeric time zone use "-0000" rather than "+0000"
to show that the time zone is unknown; this is the RFC 5322
standard.

22 months agoFix newsticker timezone decode
LdBeth [Fri, 30 Dec 2022 03:16:09 +0000 (19:16 -0800)]
Fix newsticker timezone decode

'newsticker--decode-rfc822-date' has the regex pattern for
North American timezones but the actual timezone conversion
for them was not implmented. Now cond cases are added to
handle them as specified in RFC822.

Copyright-paperwork-exempt: yes

22 months agoAllow for indentation in prog-fill-reindent-defun (bug#60322)
Theodor Thornhill [Thu, 29 Dec 2022 19:19:46 +0000 (20:19 +0100)]
Allow for indentation in prog-fill-reindent-defun (bug#60322)

* lisp/progmodes/prog-mode.el (prog-fill-reindent-defun):
Adjust regexp.

22 months ago* etc/NEWS: Mention some recently added byte-compiler warnings
Mattias Engdegård [Thu, 29 Dec 2022 16:38:02 +0000 (17:38 +0100)]
* etc/NEWS: Mention some recently added byte-compiler warnings

22 months agoConsistent empty-body warning messages for let and let*
Mattias Engdegård [Thu, 29 Dec 2022 16:00:01 +0000 (17:00 +0100)]
Consistent empty-body warning messages for let and let*

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings):
Make warning messages for let and let* consistent with other
empty-body warnings.

22 months ago; Suppress empty-body warnings in cedet/semantic
Mattias Engdegård [Thu, 29 Dec 2022 12:15:20 +0000 (13:15 +0100)]
; Suppress empty-body warnings in cedet/semantic

22 months agoAdd empty-body warning for when, unless etc
Mattias Engdegård [Thu, 29 Dec 2022 12:01:47 +0000 (13:01 +0100)]
Add empty-body warning for when, unless etc

Warn about code like (when SOME-CONDITION) because these may indicate
bugs.  Warnings currently apply to `when`, `unless`, `ignore-error`,
`with-suppressed-warnings` and (as before) `let` and `let*`.

* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings):
Update doc string.
* lisp/emacs-lisp/bytecomp.el: (byte-compile-warning-types)
(byte-compile-warnings): Add empty-body.
(byte-compile-initial-macro-environment):
Add empty-body warning for with-suppressed-warnings.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
Use the empty-body category for let and let*.
* lisp/subr.el (when, unless, ignore-error): Add empty-body warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test cases.

22 months agoWarn about `condition-case' with quoted condition names
Mattias Engdegård [Thu, 29 Dec 2022 11:00:50 +0000 (12:00 +0100)]
Warn about `condition-case' with quoted condition names

* lisp/emacs-lisp/bytecomp.el (byte-compile-condition-case):
Add warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-warn-quoted-condition): Add test case.

22 months agoWarn about `ignore-error` with quoted condition argument
Mattias Engdegård [Wed, 28 Dec 2022 13:40:19 +0000 (14:40 +0100)]
Warn about `ignore-error` with quoted condition argument

* lisp/subr.el (ignore-error):
Clarify condition argument in doc string and add warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-warn-quoted-condition): New test.

22 months ago; Fix byte-compilation warnings in admin/*.el
Mattias Engdegård [Wed, 28 Dec 2022 12:25:49 +0000 (13:25 +0100)]
; Fix byte-compilation warnings in admin/*.el

22 months ago* lisp/subr.el (with-demoted-errors): Better message and location.
Mattias Engdegård [Wed, 28 Dec 2022 12:10:35 +0000 (13:10 +0100)]
* lisp/subr.el (with-demoted-errors): Better message and location.

22 months agoMerge from origin/emacs-29
Stefan Kangas [Thu, 29 Dec 2022 05:30:09 +0000 (06:30 +0100)]
Merge from origin/emacs-29

909091d7578 ; Minor cleanup for tree-sitter font-lock rules in js-ts-...
e78e69b3318 Clean up font-lock rules in js-ts-mode
0a61e4e2b71 ; * doc/lispref/parsing.texi (Using Parser): Minor improv...
398ed75c276 ; * lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragrap...
19b8733aa27 Fix syntax for < and > in c++-ts-mode (bug#60351)
f509246ba12 Call tree-sitter parser notifier on the first parse
ec6feeaa191 Fix tree-sitter parser notifier recursion

22 months ago; Minor cleanup for tree-sitter font-lock rules in js-ts-mode
Yuan Fu [Thu, 29 Dec 2022 00:57:21 +0000 (16:57 -0800)]
; Minor cleanup for tree-sitter font-lock rules in js-ts-mode

* lisp/progmodes/js.el (js--treesit-font-lock-settings): Minor cleanup.

22 months agoClean up font-lock rules in js-ts-mode
Yuan Fu [Thu, 29 Dec 2022 00:52:47 +0000 (16:52 -0800)]
Clean up font-lock rules in js-ts-mode

Changes for each feature:

- string: Take out string-interpolation bits.
- string-interpolation: New.
- declaration: Rename to definition.
- identifier: Remove.
- property: Use a pred to filter out methods.
- expression: Rename to assignment.
- function: New.
- pattern: Merge into assignment.

* lisp/progmodes/js.el (js--treesit-font-lock-settings): See above.
(js--treesit-property-not-function-p)
(js--treesit-lhs-identifier-query): New variable.
(js--treesit-fontify-assignment-lhs): New functions.
(js-ts-mode): Update feature list.

22 months ago; * doc/lispref/parsing.texi (Using Parser): Minor improvement.
Yuan Fu [Wed, 28 Dec 2022 23:54:51 +0000 (15:54 -0800)]
; * doc/lispref/parsing.texi (Using Parser): Minor improvement.

22 months ago; * lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragraph): Fix.
Yuan Fu [Wed, 28 Dec 2022 23:47:14 +0000 (15:47 -0800)]
; * lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragraph): Fix.

22 months agoFix syntax for < and > in c++-ts-mode (bug#60351)
Yuan Fu [Wed, 28 Dec 2022 23:44:26 +0000 (15:44 -0800)]
Fix syntax for < and > in c++-ts-mode (bug#60351)

< and > are usually punctuation, e.g., in ->.  But when used for
templates, they should be considered pairs.  Right now we always
consider them as pairs which is incorrect.

* lisp/progmodes/c-ts-mode.el (c++-ts-mode--syntax-table): Remove
variable.
(c-ts-mode--syntax-propertize): New function.
(c++-ts-mode): Remove syntax table.  Setup syntax-propertize-function.

22 months agoCall tree-sitter parser notifier on the first parse
Yuan Fu [Wed, 28 Dec 2022 23:30:10 +0000 (15:30 -0800)]
Call tree-sitter parser notifier on the first parse

* src/treesit.c (treesit_call_after_change_functions): Handle NULL
old_tree.
(treesit_ensure_parsed): Remove check for NULL tree.

22 months agoFix tree-sitter parser notifier recursion
Yuan Fu [Wed, 28 Dec 2022 23:19:34 +0000 (15:19 -0800)]
Fix tree-sitter parser notifier recursion

See the comment for detail.

* src/treesit.c (treesit_ensure_parsed): Move the need_reparse short
circuit to the very beginning.  Move the call to
treesit_call_after_change_functions to the very end.

22 months agoMerge from origin/emacs-29
Stefan Kangas [Wed, 28 Dec 2022 20:40:59 +0000 (21:40 +0100)]
Merge from origin/emacs-29

db96b1282f9 * lisp/help.el: Use 'C-h C-q' to toggle 'help-quick' wind...
489865c21e4 ; Improve markup of long key sequences
d42c2668cf3 ; * etc/NEWS: Fix wording of a recently edited entry.
7a0eaee1980 * lisp/isearch.el: Small fixes.
b69bffeec05 * lisp/vc/diff-mode.el (diff-minor-mode-prefix): Replace ...
9263847ab76 ; * etc/NEWS: Move the paragraph with 'C-u RET' closer to...
62fb2dc37da * doc/emacs/display.texi (Text Scale): Improve section ab...
70480d3b6b7 * lisp/repeat.el (repeat-echo-function): Suggest 'add-fun...
fd48201ffe7 * lisp/tab-line.el (tab-line-cache-key-default): More cac...
b1646602602 * etc/package-keyring.gpg: Update with new key
c0be51389eb ; Yet another declare-function to avoid treesit-related w...
8676bec51de ; * lisp/treesit.el (treesit--simple-imenu-1): Doc fix; w...
2ddc480f441 Warn of absent networks module in ERC
19d00fab9aa Avoid "already compiled" warning in erc-compat
2d8f7b66bcc ; Fix one more treesit byte-compilation warning.
2d0a9214863 ; Avoid treesit-related byte-compiler warnings
8503b370be1 (python--treesit-settings): Remove duplicate matcher
b464e6c490b Make last change of w32 GUI dialogs conditional and rever...
eedc9d79aed Fix tree-sitter typos
248c13dcfe1 Update tree-sitter major modes to use the new Imenu facility
b39dc7ab27a Add tree-sitter helper functions for Imenu
ba1ddea9dab Fix treesit--things-around (bug#60355)
7512b9025a1 ; * lisp/treesit.el (treesit-traverse-parent): Remove alias.
5326b041982 Improve treesit-node-top-level and treesit-parent-until
637f5b164f2 ; Add "src" to the heuristic sub-directory heuristic
8ab6df0c9fd ; * lisp/epa-ks.el (epa-ks-do-key-to-fetch): Fix 'when' u...
2b55a48d3e3 * src/w32menu.c (simple_dialog_show): Use MB_YESNOCANCEL ...
8b8b7915679 ; Improve documentation of TAB/SPC indentation
624e3822110 ; Improve doc strings of some new faces
41f12e1019b ; * lisp/elide-head.el (elide-head): Doc fix to silence c...
e3b4cd0ac1d ; * lisp/htmlfontify.el (hfy-text-p): Fix whitespace.
1b4dc4691c1 Fix htmlfontify.el command injection vulnerability.
1fe4b98b4d5 Improve support for Scheme R6RS and R7RS libraries (bug#5...
2347f37f677 ; * test/src/treesit-tests.el: remove dead store (bytecom...
a6d961ae2fd Add a new tree-sitter query predicate 'pred'
835a80dcc48 ; Fix tree-sitter defun tests
a14821d6151 Improve gnutls-min-prime-bits docstring
b14bbd108e4 Improve handling of tab-bar height.
669160d47b2 ; * nt/INSTALL.W64: More fixes and updates.
26b2ec7cb8c Simplify last change (bug#60311)
082fc6e3088 Fix 'json-available-p' on MS-Windows
6c86faec29e loaddefs-gen: Group results by absolute file name
d90d7d15f2f ; Fix vindexes in parsing.texi
eb268728376 Fix imenu for c-ts-mode (bug#60296)
8f68b6497ee Clean up python-ts-mode font-lock features
28f26b11a1e Add comment indent and filling to other tree-sitter major...
c6b02826450 ; Remove unused function in c-ts-mode
6e52a9fcadc ; * doc/lispref/modes.texi (Parser-based Font Lock): Mino...
2bcd1e9a99d ; * doc/lispref/parsing.texi (Retrieving Nodes): Add notice.
7c7950fe006 Add maintainer stub for tree-sitter files
cf327766226 ; * doc/lispref/parsing.texi (Using Parser): Remove delet...

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

22 months ago* lisp/help.el: Use 'C-h C-q' to toggle 'help-quick' window (bug#60249).
Juri Linkov [Wed, 28 Dec 2022 18:48:40 +0000 (20:48 +0200)]
* lisp/help.el: Use 'C-h C-q' to toggle 'help-quick' window (bug#60249).

(help-map): Bind "C-q" to 'help-quick-toggle'.  Rebind "q" to 'help-quit'.
(help-quick): Replace help-quit-or-quick with help-quick-toggle.
(help-quick-toggle): New command.
(help-quit-or-quick): Remove command.
(help-for-help): Replace help-quick-or-quit with help-quick-toggle.

22 months ago; Improve markup of long key sequences
Eli Zaretskii [Wed, 28 Dec 2022 18:33:58 +0000 (20:33 +0200)]
; Improve markup of long key sequences

* doc/emacs/display.texi (Text Scale): Avoid breaking key
sequences between lines by using @w{..}.

22 months ago; * etc/NEWS: Fix wording of a recently edited entry.
Eli Zaretskii [Wed, 28 Dec 2022 18:30:56 +0000 (20:30 +0200)]
; * etc/NEWS: Fix wording of a recently edited entry.

22 months ago* lisp/isearch.el: Small fixes.
Juri Linkov [Wed, 28 Dec 2022 18:27:07 +0000 (20:27 +0200)]
* lisp/isearch.el: Small fixes.

(isearch-wrap-pause): Mention the new feature of `no' and `no-ding'
in the docstring.
(isearch-lax-whitespace, isearch-forward-thing-at-point): Add the
group 'isearch' since another defgroup changed the default group.
(isearch-delete-char): Use 'isearch-invisible' instead of 'search-invisible'
since the users might change the current value with 'M-s i'.

22 months ago* lisp/vc/diff-mode.el (diff-minor-mode-prefix): Replace "ESC" with "\e".
Juri Linkov [Wed, 28 Dec 2022 18:14:43 +0000 (20:14 +0200)]
* lisp/vc/diff-mode.el (diff-minor-mode-prefix): Replace "ESC" with "\e".

"ESC" looks like an attempt to use kbd syntax in customization.
But actually now 'key-description' is used in 'diff-minor-mode-map'
to convert "\e" to "ESC".

22 months ago; * etc/NEWS: Move the paragraph with 'C-u RET' closer to the related section.
Juri Linkov [Wed, 28 Dec 2022 18:09:46 +0000 (20:09 +0200)]
; * etc/NEWS: Move the paragraph with 'C-u RET' closer to the related section.

22 months ago* doc/emacs/display.texi (Text Scale): Improve section about repeating keys.
Juri Linkov [Wed, 28 Dec 2022 18:06:18 +0000 (20:06 +0200)]
* doc/emacs/display.texi (Text Scale): Improve section about repeating keys.

Mention that it's possible to use repeating keys without the modifiers
and copy an example from etc/NEWS.

22 months agoAdd treesit-transpose-sexps (bug#60128)
Theodor Thornhill [Sun, 25 Dec 2022 19:11:59 +0000 (20:11 +0100)]
Add treesit-transpose-sexps (bug#60128)

We don't really need to rely on forward-sexp to define what to
transpose.  In tree-sitter we can consider siblings as "balanced
expressions", and swap them without doing any movement to calculate
where the siblings in question are.

* lisp/simple.el (transpose-sexps-function): New defvar-local.
(transpose-sexps): Use the new defvar-local if available.
(transpose-subr): Check whether the mover function returns a cons of
conses, then run transpose-subr-1 on the position-pairs.
* lisp/treesit.el (treesit-transpose-sexps): New function.

22 months ago* lisp/repeat.el (repeat-echo-function): Suggest 'add-function' in docstring.
Juri Linkov [Wed, 28 Dec 2022 17:58:44 +0000 (19:58 +0200)]
* lisp/repeat.el (repeat-echo-function): Suggest 'add-function' in docstring.

(bug#60353)

22 months ago* lisp/tab-line.el (tab-line-cache-key-default): More cache keys (bug#60340).
Juri Linkov [Wed, 28 Dec 2022 17:47:52 +0000 (19:47 +0200)]
* lisp/tab-line.el (tab-line-cache-key-default): More cache keys (bug#60340).

Move more cache keys here from 'tab-line-format' to give users more freedom.

22 months ago; Merge from origin/emacs-29
Stefan Kangas [Wed, 28 Dec 2022 17:47:25 +0000 (18:47 +0100)]
; Merge from origin/emacs-29

The following commit was skipped:

2608e5edcca ; Fix typos

22 months agoFixes in prog-fill-reindent-defun
Theodor Thornhill [Sun, 25 Dec 2022 21:47:36 +0000 (22:47 +0100)]
Fixes in prog-fill-reindent-defun

Ensure that we don't consider lines such as

    switch (foo) {
        case 2:  // If point on 'c' in 'case'
            return 2;

not to be considered for filling.

Also make sure we check for the active region, to replicate the normal
fill-paragraph behavior.

* lisp/progmodes/prog-mode.el (prog-fill-reindent-defun): Adjust
regex, and make sure fill-paragraph checks for active region.

(bug#60360, bug#60322)

22 months ago* etc/package-keyring.gpg: Update with new key
Stefan Monnier [Wed, 28 Dec 2022 17:19:02 +0000 (12:19 -0500)]
* etc/package-keyring.gpg: Update with new key

22 months ago; Yet another declare-function to avoid treesit-related warning
Eli Zaretskii [Wed, 28 Dec 2022 17:08:19 +0000 (19:08 +0200)]
; Yet another declare-function to avoid treesit-related warning

22 months ago; * lisp/treesit.el (treesit--simple-imenu-1): Doc fix; wording.
Stefan Kangas [Wed, 28 Dec 2022 16:37:46 +0000 (17:37 +0100)]
; * lisp/treesit.el (treesit--simple-imenu-1): Doc fix; wording.

22 months agoWarn of absent networks module in ERC
F. Jason Park [Mon, 26 Dec 2022 05:36:53 +0000 (21:36 -0800)]
Warn of absent networks module in ERC

* doc/misc/erc.texi: Add linkable note in Modules chapter about some
modules being required.  Also tweak markup in auth-source section.
* etc/ERC-NEWS: Mention the special role of `networks'.
* lisp/erc/erc-backend.el (erc--server-post-connect-hook): Add
internal hook for core modules to perform post-network-process,
pre-protocol config validation even when they haven't been loaded.
(erc--register-connection): Run `erc--server-post-connect-hook'.
* lisp/erc/erc-networks.el (erc-networks--bouncer-targets,
erc-networks-on-MOTD-end): Fix comments and doc strings.  Also change
former from constant to internal variable in case adjustment needed
between releases.
(erc-networks--warn-on-connect): New function to warn about the
`networks' module being absent from `erc-modules'.  This could
probably run at any time up to and including when the logical IRC
connection is established, but doing so at the process/protocol
boundary seems ideal.
* lisp/erc/erc-sasl.el (erc--register-connection): Defer to base
method instead of calling `erc-login' explicitly.
* lisp/erc/erc.el (erc-generate-new-buffer-name): Don't reconcile
buffer names when networks module not in play.
(erc-format-target-and/or-network): Don't assume networks module
loaded.
* test/lisp/erc/erc-scenarios-base-unstable.el:
(erc-scenarios-networks-no-module): New test.
* test/lisp/erc/resources/networks/no-module/basic.eld: New test data
file.  (Bug#60331.)

22 months agoAvoid "already compiled" warning in erc-compat
F. Jason Park [Wed, 28 Dec 2022 14:18:01 +0000 (06:18 -0800)]
Avoid "already compiled" warning in erc-compat

* lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search):
Don't `byte-compile' sub-29 secrets wrapper.  This was especially
noisy in tests.  Ditch closed-over vars via HOF instead of suppressing
because compiling emits "unused lexical" warning on Emacs 27.

22 months ago; Fix one more treesit byte-compilation warning.
Eli Zaretskii [Wed, 28 Dec 2022 14:48:22 +0000 (16:48 +0200)]
; Fix one more treesit byte-compilation warning.

22 months ago; Avoid treesit-related byte-compiler warnings
Eli Zaretskii [Wed, 28 Dec 2022 14:41:58 +0000 (16:41 +0200)]
; Avoid treesit-related byte-compiler warnings

* lisp/progmodes/json-ts-mode.el (treesit-node-child-by-field-name):
* lisp/textmodes/toml-ts-mode.el (treesit-node-child-by-field-name):
* lisp/progmodes/java-ts-mode.el (treesit-node-child-by-field-name):
* lisp/progmodes/csharp-mode.el
(treesit-node-child-by-field-name): Avoid byte-compilation
warnings about treesit-node-type.

22 months ago(python--treesit-settings): Remove duplicate matcher
Dmitry Gutov [Wed, 28 Dec 2022 13:12:44 +0000 (15:12 +0200)]
(python--treesit-settings): Remove duplicate matcher

* lisp/progmodes/python.el (python--treesit-settings): Remove
duplicate matcher (which found itself under 'function' in addition
to 'definition').

22 months agoMake last change of w32 GUI dialogs conditional and reversible
Eli Zaretskii [Wed, 28 Dec 2022 13:10:39 +0000 (15:10 +0200)]
Make last change of w32 GUI dialogs conditional and reversible

* src/w32term.c (syms_of_w32term) <w32-yes-no-dialog-show-cancel>:
New boolean variable.
(w32_initialize): Fix query for visible system caret: 'bool' is a
single-byte data type, whereas SystemParametersInfo wants a BOOL,
which is a 32-bit int.
* src/w32menu.c (simple_dialog_show): Show "Cancel" button only if
'w32-yes-no-dialog-show-cancel' is non-nil.

* etc/NEWS: Announce the change.

22 months agoFix tree-sitter typos
Yuan Fu [Wed, 28 Dec 2022 08:32:37 +0000 (00:32 -0800)]
Fix tree-sitter typos

* doc/lispref/parsing.texi (Tree-sitter major modes):
* lisp/progmodes/java-ts-mode.el:
* test/src/treesit-tests.el (treesit-defun-navigation-nested-4): Fix
typo.

22 months agoUpdate tree-sitter major modes to use the new Imenu facility
Yuan Fu [Wed, 28 Dec 2022 04:57:12 +0000 (20:57 -0800)]
Update tree-sitter major modes to use the new Imenu facility

See previous commit for more explanation.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-name): Handle more
types.
(c-ts-mode--imenu-1)
(c-ts-mode--imenu): Remove functions.
(c-ts-base-mode): Setup Imenu.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--imenu-1)
(csharp-ts-mode--imenu): Remove functions.
(csharp-ts-mode): Setup Imenu.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--imenu-1)
(java-ts-mode--imenu): Remove functions.
(java-ts-mode): Setup Imenu.
* lisp/progmodes/js.el (js--treesit-imenu-1)
(js--treesit-imenu): Remove functions.
(js--treesit-valid-imenu-entry): New function.
(js-ts-mode): Setup Imenu.
* lisp/progmodes/json-ts-mode.el (json-ts-mode--defun-name): Trim the
quotes.
(json-ts-mode--imenu-1)
(json-ts-mode--imenu): Remove functions.
(json-ts-mode): Setup Imenu.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--imenu)
(rust-ts-mode--imenu-1): Remove functions.
(rust-ts-mode): Setup Imenu.
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-base-mode): Remove treesit-defun-prefer-top-level, it's
not used anymore.  Setup Imenu.  Setup treesit-defun-name-function.
* lisp/textmodes/css-mode.el (css--treesit-imenu-1)
(css--treesit-imenu): Remove functions.
(css-ts-mode): Setup Imenu.
* lisp/textmodes/toml-ts-mode.el (toml-ts-mode--defun-name): Fix it
and add a fallback.
(toml-ts-mode--imenu-1)
(toml-ts-mode--imenu): Remove functions.
(toml-ts-mode): Setup Imenu.

22 months agoAdd tree-sitter helper functions for Imenu
Yuan Fu [Wed, 28 Dec 2022 04:37:29 +0000 (20:37 -0800)]
Add tree-sitter helper functions for Imenu

We didn't add an integration for Imenu because we aren't sure what
should it look like.  Now we have a pretty good idea.  All the major
modes copy-paste the two Imenu functions and tweaks them in a standard
way.  With the addition of treesit-defun-type-regexp and
treesit-defun-name-function, now is a good time to standardize Imenu
integration.

In the next commit we update all the major modes to use this
integration.

* doc/lispref/modes.texi (Imenu): Add manual.
* doc/lispref/parsing.texi (Tree-sitter major modes): Update manual.
* lisp/treesit.el (treesit-simple-imenu-settings): New varaible.
(treesit--simple-imenu-1)
(treesit-simple-imenu): New functions.
(treesit-major-mode-setup): Setup Imenu.

22 months agoFix treesit--things-around (bug#60355)
Yuan Fu [Wed, 28 Dec 2022 01:02:03 +0000 (17:02 -0800)]
Fix treesit--things-around (bug#60355)

Current implementation of treesit--things-around only searches forward
for REGEXP and go up the tree until it finds a valid thing, if nothing
matches it gives up.  This makes it sometimes miss defuns.  The new
implementation tries multiple times (of search forward + go up) until
it exhausts all possible defun nodes.

* lisp/treesit.el (treesit--things-around): New implementation.
(treesit--navigate-defun): Refactor to use treesit-node-top-level to
simplify code, and add some guards in the predicate function.
* test/src/treesit-tests.el:
(treesit--ert-defun-navigation-elixir-program): New variable.
(treesit-defun-navigation-nested-4): New test.

22 months ago; * lisp/treesit.el (treesit-traverse-parent): Remove alias.
Yuan Fu [Tue, 27 Dec 2022 23:08:07 +0000 (15:08 -0800)]
; * lisp/treesit.el (treesit-traverse-parent): Remove alias.

It was added with treesit-traverse-xxx functions, since now they are
gone, this alias doesn't make sense by itself anymore.

22 months agoImprove treesit-node-top-level and treesit-parent-until
Yuan Fu [Tue, 27 Dec 2022 23:07:03 +0000 (15:07 -0800)]
Improve treesit-node-top-level and treesit-parent-until

* lisp/treesit.el (treesit-node-top-level): Now it can accept a
predicate function.  Add an optional argument INCLUDE-NODE.
(treesit-parent-until): Add an optional argument INCLUDE-NODE.

22 months ago; Add "src" to the heuristic sub-directory heuristic
Philip Kaludercic [Tue, 27 Dec 2022 19:28:05 +0000 (20:28 +0100)]
; Add "src" to the heuristic sub-directory heuristic

* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check for "src"
directories, next to "lisp".

22 months ago; * lisp/epa-ks.el (epa-ks-do-key-to-fetch): Fix 'when' usage
Philip Kaludercic [Tue, 27 Dec 2022 12:46:40 +0000 (13:46 +0100)]
; * lisp/epa-ks.el (epa-ks-do-key-to-fetch): Fix 'when' usage

22 months ago* src/w32menu.c (simple_dialog_show): Use MB_YESNOCANCEL style.
Eli Zaretskii [Tue, 27 Dec 2022 18:55:12 +0000 (20:55 +0200)]
* src/w32menu.c (simple_dialog_show): Use MB_YESNOCANCEL style.

22 months ago; Improve documentation of TAB/SPC indentation
Eli Zaretskii [Tue, 27 Dec 2022 18:23:16 +0000 (20:23 +0200)]
; Improve documentation of TAB/SPC indentation

* lisp/indent.el (tab-to-tab-stop):
* src/indent.c (Findent_to): Mention 'indent-tabs-mode' in doc
strings.

22 months agoSupport Apache License 2.0 in elide-head-mode
Stefan Kangas [Tue, 27 Dec 2022 17:12:02 +0000 (18:12 +0100)]
Support Apache License 2.0 in elide-head-mode

* lisp/elide-head.el (elide-head-headers-to-hide): Add the Apache
License, Version 2.0.
* test/lisp/elide-head-tests.el (apache1-1): New test.

22 months agoMake elide-head-headers-to-hide more forgiving
Stefan Kangas [Tue, 27 Dec 2022 16:24:18 +0000 (17:24 +0100)]
Make elide-head-headers-to-hide more forgiving

* lisp/elide-head.el (elide-head-headers-to-hide): Make regexp
more forgiving of line breaks and comment characters in address.
* test/lisp/elide-head-tests.el (gpl3-6): New test.

22 months ago; Improve doc strings of some new faces
Eli Zaretskii [Tue, 27 Dec 2022 16:59:59 +0000 (18:59 +0200)]
; Improve doc strings of some new faces

* lisp/font-lock.el (font-lock-punctuation-face)
(font-lock-delimiter-face): Doc fix.

22 months ago; * lisp/elide-head.el (elide-head): Doc fix to silence checkdoc.
Stefan Kangas [Tue, 27 Dec 2022 16:28:08 +0000 (17:28 +0100)]
; * lisp/elide-head.el (elide-head): Doc fix to silence checkdoc.

22 months ago; * lisp/htmlfontify.el (hfy-text-p): Fix whitespace.
Eli Zaretskii [Tue, 27 Dec 2022 14:10:42 +0000 (16:10 +0200)]
; * lisp/htmlfontify.el (hfy-text-p): Fix whitespace.

22 months agoFix htmlfontify.el command injection vulnerability.
Xi Lu [Sat, 24 Dec 2022 08:28:54 +0000 (16:28 +0800)]
Fix htmlfontify.el command injection vulnerability.

* lisp/htmlfontify.el (hfy-text-p): Fix command injection
vulnerability.  (Bug#60295)

22 months agoImprove support for Scheme R6RS and R7RS libraries (bug#54704)
Rudolf Adamkovič [Sat, 24 Dec 2022 00:00:32 +0000 (01:00 +0100)]
Improve support for Scheme R6RS and R7RS libraries (bug#54704)

* etc/NEWS (Scheme mode): Document improved file-type auto-detection
and Imenu support for R6RS and R7RS Scheme libraries.
* lisp/files.el (auto-mode-alist): Associate the '.sls' (R6RS Scheme
Library Source) and '.sld' (R7RS Scheme Library Definition) file name
extensions with the Scheme mode.
* lisp/progmodes/scheme.el (scheme-imenu-generic-expression): Make
Imenu recognize the members nested (and so indented) inside of
'library' (R6RS) or 'define-library' (R7RS) forms.

22 months ago; * test/src/treesit-tests.el: remove dead store (bytecomp warning)
Mattias Engdegård [Tue, 27 Dec 2022 10:18:02 +0000 (11:18 +0100)]
; * test/src/treesit-tests.el: remove dead store (bytecomp warning)

22 months agoAdd a new tree-sitter query predicate 'pred'
Yuan Fu [Tue, 27 Dec 2022 01:16:59 +0000 (17:16 -0800)]
Add a new tree-sitter query predicate 'pred'

I realized that using an arbitrary function as the predicate in
queries is very helpful for some queries I'm writing for python and
javascript, and presumably most other languages[1].

Granted, we can already filter out unwanted nodes by using a function
instead of a face for the capture name, and (1) determine whether the
captured node is valid and (2) fontify that node if it's valid.

However, such approach is a bit more cumbersome and more importantly
gets in the way of another potential use of the fontification queries:
context extraction.

For example, I could use the query for the 'variable' feature to get
all the variables in a certain region.  In this use-case, we want the
filtering happen before returning the captured nodes.

Besides, the change is relatively small and straightforward: most code
are already there, I just need to add some boilerplate.

[1] For a code like aa.bb(cc), we want bb to be in function face,
because obviously its a function.  But for aa.bb, we want bb to be in
property face, because it's a property.  In the AST, bb is always a
property, the difference between the two cases is the enclosing node:
in the first case, aa.bb is in a "call_expression" node, indicating
that bb is used as a function (a method).  So we want a predicate
function that checks whether bb is used as a function or a property,
and determine whether it should be in function or property face.

* doc/lispref/parsing.texi (Pattern Matching): Update manual.
* src/treesit.c (Ftreesit_pattern_expand): Handle :pred.
(treesit_predicate_capture_name_to_node): A new function extracted
from treesit_predicate_capture_name_to_text.
(treesit_predicate_capture_name_to_text): Use the newly extracted
function.
(treesit_predicate_pred): New predicate function.
(treesit_eval_predicates): Add new predicate.  Also fix a bug: we want
to AND the results of each predicate.
* test/src/treesit-tests.el (treesit--ert-pred-last-sibling): New
helper function.
(treesit-query-api): Test #pred predicate.

22 months ago; Fix tree-sitter defun tests
Yuan Fu [Tue, 27 Dec 2022 01:15:37 +0000 (17:15 -0800)]
; Fix tree-sitter defun tests

* test/src/treesit-tests.el (treesit--ert-test-defun-navigation):
Change treesit--navigate-defun to treesit--navigate-thing.

22 months agoImprove gnutls-min-prime-bits docstring
Stefan Kangas [Mon, 26 Dec 2022 20:22:42 +0000 (21:22 +0100)]
Improve gnutls-min-prime-bits docstring

* lisp/net/gnutls.el (gnutls-min-prime-bits): Doc fix: delete
out-of-date and now misleading sentence, added back when Emacs'
default minimum prime bits for a Diffie-Hellman handshake was only 256
bits.  These days, the default is nil, which means to let GnuTLS
decide the value.  (See also `nsm-protocol-check--dhe-prime-kx`.)

22 months agoImprove handling of tab-bar height.
Gregory Heytings [Mon, 26 Dec 2022 00:20:59 +0000 (00:20 +0000)]
Improve handling of tab-bar height.

* src/xdisp.c (redisplay_tab_bar): When 'auto-resize-tab-bar' is
not 'grow-only', also consider the case when the tab-bar height
needs to shrink.  Fixes bug#60210.

22 months agoAvoid duplicate inclusion of stdalign.h
Paul Eggert [Mon, 26 Dec 2022 16:46:36 +0000 (08:46 -0800)]
Avoid duplicate inclusion of stdalign.h

* src/lisp.h: Do not include stdalign.h, as Gnulib now
approximates C23 (where stdalign.h does nothing) and config.h
already includes stdalign.h as needed on pre-C23 platforms.

22 months ago; * nt/INSTALL.W64: More fixes and updates.
Eli Zaretskii [Mon, 26 Dec 2022 14:26:28 +0000 (16:26 +0200)]
; * nt/INSTALL.W64: More fixes and updates.

22 months ago; * etc/NEWS: Fix wording of a recently added entry.
Eli Zaretskii [Mon, 26 Dec 2022 14:10:44 +0000 (16:10 +0200)]
; * etc/NEWS: Fix wording of a recently added entry.

22 months agoSimplify last change (bug#60311)
Eli Zaretskii [Mon, 26 Dec 2022 13:26:48 +0000 (15:26 +0200)]
Simplify last change (bug#60311)

* src/json.c (json_available_p): Use original code.  Always return
true for !WINDOWSNT.
(ensure_json_available): Now defined only on WINDOWSNT.
(Fjson_serialize, Fjson_insert, Fjson_parse_string)
(Fjson_parse_buffer): Call ensure_json_available only on
WINDOWSNT.

* lisp/subr.el (json-available-p): Simplify.

22 months agoFix 'json-available-p' on MS-Windows
Mattias Engdegård [Sun, 25 Dec 2022 14:32:06 +0000 (15:32 +0100)]
Fix 'json-available-p' on MS-Windows

* src/json.c (json_available_p, ensure_json_available)
(Fjson__available_p): New functions.
(Fjson_serialize, Fjson_insert, Fjson_parse_string)
(Fjson_parse_buffer): Use ensure_json_available.
(syms_of_json): Defsubr json--available-p.

* lisp/subr.el (json-available-p): Rewrite.

22 months agoloaddefs-gen: Group results by absolute file name
Kyle Meyer [Sun, 25 Dec 2022 20:31:33 +0000 (15:31 -0500)]
loaddefs-gen: Group results by absolute file name

loaddefs-generate produced an incomplete output file if 1) it
was called with a relative file name and 2) that same file was
specified via a generated-autoload-file cookie in a subset of
the input files.  In that case, autoload entries were lost
because loaddefs-generate writes the same output file twice:
once for the relative name specified by the caller and once
for the absolute name that loaddefs-generate--parse-file
returns for the generated-autoload-file value.
This has been fixed.  (Bug#60318)

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Expand file
names when grouping loaddef files.

22 months ago; Fix vindexes in parsing.texi
Yuan Fu [Mon, 26 Dec 2022 09:39:02 +0000 (01:39 -0800)]
; Fix vindexes in parsing.texi

* doc/lispref/parsing.texi (Tree-sitter major modes): Replace vindex
with cross-reference to modes.texi.  Add manual entry for
treesit-defun-type-regexp.
* lisp/treesit.el (treesit-defun-type-regexp): Use pred in docstring
since we use pred everywhere else.

22 months agoFix imenu for c-ts-mode (bug#60296)
Yuan Fu [Mon, 26 Dec 2022 09:01:41 +0000 (01:01 -0800)]
Fix imenu for c-ts-mode (bug#60296)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--imenu-1): Use
c-ts-mode--defun-valid-p to filter out nested matches.
(c-ts-mode--defun-valid-p): Handle more types of nodes.

22 months agoClean up python-ts-mode font-lock features
Yuan Fu [Mon, 26 Dec 2022 08:43:42 +0000 (00:43 -0800)]
Clean up python-ts-mode font-lock features

* lisp/progmodes/python.el (python--treesit-settings): Remove
unnecessary override flags, add function and variable feature, fix
assignment feature.
(python--treesit-variable-p)
(python--treesit-fontify-variable): New functions.
(python-ts-mode): Add function and variable feature.

22 months agoAdd comment indent and filling to other tree-sitter major modes
Yuan Fu [Sun, 25 Dec 2022 19:21:50 +0000 (11:21 -0800)]
Add comment indent and filling to other tree-sitter major modes

Extract the setup into a function, and use it in other major modes.

* lisp/progmodes/c-ts-mode.el (c-ts-mode-comment-setup): New function.
(c-ts-base-mode): Extract out.
(c-ts-mode)
(c++-ts-mode): Remove old setup.

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules): New
indent rules.
(csharp-ts-mode): Use new setup function.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New
indent rules.
(java-ts-mode): Use new setup function.
* lisp/progmodes/js.el (js--treesit-indent-rules): New indent rules.
(js-ts-mode): Use new setup function.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--indent-rules): New
indent rules.
(rust-ts-mode): Use new setup function.
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--indent-rules): New indent rules.
(typescript-ts-base-mode): Use new setup function.

22 months ago; Remove unused function in c-ts-mode
Yuan Fu [Sun, 25 Dec 2022 19:11:00 +0000 (11:11 -0800)]
; Remove unused function in c-ts-mode

* lisp/progmodes/c-ts-mode.el (c-ts-mode--end-of-defun): Remove.
(c-ts-mode)
(c++-ts-mode): Remove setup.

22 months ago; * doc/lispref/modes.texi (Parser-based Font Lock): Minor fixes.
Yuan Fu [Sun, 25 Dec 2022 18:44:53 +0000 (10:44 -0800)]
; * doc/lispref/modes.texi (Parser-based Font Lock): Minor fixes.

22 months ago; * doc/lispref/parsing.texi (Retrieving Nodes): Add notice.
Yuan Fu [Sun, 25 Dec 2022 18:38:05 +0000 (10:38 -0800)]
; * doc/lispref/parsing.texi (Retrieving Nodes): Add notice.

22 months agoAdd maintainer stub for tree-sitter files
Yuan Fu [Sun, 25 Dec 2022 18:22:40 +0000 (10:22 -0800)]
Add maintainer stub for tree-sitter files

* lisp/treesit.el:
* src/treesit.c: Add maintainer.

22 months ago; * doc/lispref/parsing.texi (Using Parser): Remove deleted function.
Yuan Fu [Sun, 25 Dec 2022 18:05:06 +0000 (10:05 -0800)]
; * doc/lispref/parsing.texi (Using Parser): Remove deleted function.

22 months ago; Fix typos
Stefan Kangas [Fri, 23 Dec 2022 17:21:10 +0000 (18:21 +0100)]
; Fix typos

(cherry picked from commit a5d39e11443fa30c8e8bc58254a1a59550dcd99e)

22 months agoRedisplay "invisible" frames that are actually visible on modern X
Po Lu [Mon, 26 Dec 2022 07:57:06 +0000 (15:57 +0800)]
Redisplay "invisible" frames that are actually visible on modern X

* etc/NEWS: Document that "invisible" frames are now redisplayed
if the compositing manager is still displaying it as part of a
thumbnail out of Emacs's control.

* src/dispnew.c (Fredraw_display): Use FRAME_REDISPLAY_P.
* src/frame.h (FRAME_REDISPLAY_P): New macro.

* src/xdisp.c (clear_garbaged_frames, echo_area_display)
(prepare_menu_bars, redisplay_internal, display_and_set_cursor)
(gui_clear_cursor): Use FRAME_REDISPLAY_P to determine whether
or not a frame should be redisplayed.
* src/xfns.c (Fx_create_frame): Set visibility state initially.
* src/xterm.c (handle_one_xevent): Likewise.
* src/xterm.h (struct x_output): New field `visibility_state'.

22 months agoMerge from origin/emacs-29
Stefan Kangas [Mon, 26 Dec 2022 05:30:21 +0000 (06:30 +0100)]
Merge from origin/emacs-29

6c00d126e7f Remove remaining mentions of 'eval-current-buffer'
1073e96170b ; * doc/lispref/text.texi (Database): Fix a typo.  (Bug#6...
b1e68a33d89 Update to Org 9.6-61-g63e073f
dad73e4de19 ; Review and fix NEWS and related documentation
72786ae237e ; Restore ARGS argument in c-ts-mode--fontify-declarator
940ab2423ca ; Always consider :lisp-dir when locating main file of VC...
9ab98cd42aa Add heuristic to locate lisp code in source packages
dda011c78d1 ; * doc/lispref/parsing.texi (Tree-sitter major modes): F...
d62b634d8fc ; * src/process.c (Fprocess_running_child_p): Doc fix.
f6c5b3d635e ; * doc/lispref/parsing.texi: Add a reminder.
e6c49c0454e ; Fix byte-copmiler warning in c-ts-mode--fontify-declarator
4234033a47a ; * lisp/treesit.el: Add some comments.
79584a206b9 Further generalize treesit-defun functions
a819ca5a93c Generalize treesit-defun functions to "things"
e8b34109eeb Reorder optional arguments to 'package-vc-install'
b38e56d8a98 Handle missing dependencies for source packages
7bc7b6b4dd9 ; Partial revert of f3e7820b
2cec78254ea ; * nt/INSTALL.W64: Fix wording.
ecee3bd4209 ; Fix recent changes in treesit documentation

# Conflicts:
# etc/NEWS

22 months agoRemove remaining mentions of 'eval-current-buffer'
Gregory Heytings [Mon, 26 Dec 2022 01:21:16 +0000 (01:21 +0000)]
Remove remaining mentions of 'eval-current-buffer'

* lisp/emacs-lisp/edebug.el (edebug-all-defs):
* doc/lispref/eval.texi (Eval):
* doc/lispref/edebug.texi (Instrumenting, Edebug Options):
Remove remaining mentions of 'eval-current-buffer', obsoleted in
Emacs 22 and removed in Emacs 26.

22 months ago; * doc/lispref/text.texi (Database): Fix a typo. (Bug#60317)
Eli Zaretskii [Sun, 25 Dec 2022 17:43:49 +0000 (19:43 +0200)]
; * doc/lispref/text.texi (Database): Fix a typo.  (Bug#60317)

22 months agoUpdate to Org 9.6-61-g63e073f
Kyle Meyer [Sun, 25 Dec 2022 16:36:36 +0000 (11:36 -0500)]
Update to Org 9.6-61-g63e073f

22 months ago; Review and fix NEWS and related documentation
Eli Zaretskii [Sun, 25 Dec 2022 12:54:33 +0000 (14:54 +0200)]
; Review and fix NEWS and related documentation

* etc/NEWS: Fix wording, punctuation, and markup.

* lisp/emacs-lisp/subr-x.el (string-glyph-split): Doc fix.

* doc/lispref/display.texi (Displaying Messages): Document
'set-message-functions'.

22 months ago; Restore ARGS argument in c-ts-mode--fontify-declarator
Juanma Barranquero [Sun, 25 Dec 2022 11:59:06 +0000 (12:59 +0100)]
; Restore ARGS argument in c-ts-mode--fontify-declarator

* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-declarator):
Restore argument name referenced in the docstring.

22 months ago; Always consider :lisp-dir when locating main file of VC packages
Philip Kaludercic [Sun, 25 Dec 2022 10:20:30 +0000 (11:20 +0100)]
; Always consider :lisp-dir when locating main file of VC packages

* lisp/emacs-lisp/package-vc.el (package-vc--main-file): Check the
:lisp-dir entry in the "extras" of a package description to find the
directory with a main file.

22 months agoAdd heuristic to locate lisp code in source packages
Philip Kaludercic [Sun, 25 Dec 2022 10:18:51 +0000 (11:18 +0100)]
Add heuristic to locate lisp code in source packages

* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check if a
"lisp" directory exists and use that instead of PKG-DIR.

(Bug#60155)

22 months ago; * doc/lispref/parsing.texi (Tree-sitter major modes): Fix @cindex.
Eli Zaretskii [Sun, 25 Dec 2022 09:34:12 +0000 (11:34 +0200)]
; * doc/lispref/parsing.texi (Tree-sitter major modes): Fix @cindex.

22 months ago; * src/process.c (Fprocess_running_child_p): Doc fix.
Eli Zaretskii [Sun, 25 Dec 2022 09:23:07 +0000 (11:23 +0200)]
; * src/process.c (Fprocess_running_child_p): Doc fix.

22 months ago; * doc/lispref/parsing.texi: Add a reminder.
Yuan Fu [Sun, 25 Dec 2022 08:42:57 +0000 (00:42 -0800)]
; * doc/lispref/parsing.texi: Add a reminder.

22 months ago; Fix byte-copmiler warning in c-ts-mode--fontify-declarator
Yuan Fu [Sun, 25 Dec 2022 08:29:15 +0000 (00:29 -0800)]
; Fix byte-copmiler warning in c-ts-mode--fontify-declarator

* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-declarator): Ignore
the rest args.

22 months ago; * lisp/treesit.el: Add some comments.
Yuan Fu [Sun, 25 Dec 2022 07:46:19 +0000 (23:46 -0800)]
; * lisp/treesit.el: Add some comments.

22 months agoFurther generalize treesit-defun functions
Yuan Fu [Sun, 25 Dec 2022 06:08:17 +0000 (22:08 -0800)]
Further generalize treesit-defun functions

Two new functions, treesit-beginning/end-of-thing.  And
treesit-thing-at-point's signature changes.

* lisp/treesit.el (treesit-block-type-regexp): New variable.
(treesit-beginning-of-thing)
(treesit-end-of-thing): Generalized from
treesit-beginning/end-of-defun.
(treesit-beginning-of-defun)
(treesit-end-of-defun): Use the new functions.
(treesit-thing-at-point): Accept PATTERN rather than REGEXP and PRED.
(treesit-defun-at-point): Adjust for the new signature of
treesit-thing-at-point.

22 months agoGeneralize treesit-defun functions to "things"
Yuan Fu [Sun, 25 Dec 2022 04:17:08 +0000 (20:17 -0800)]
Generalize treesit-defun functions to "things"

Change the "defun" in some functions (e.g. treesit--defuns-around) to
"thing".  Add a function treesit-thing-at-point.

* lisp/treesit.el (treesit--thing-unpack-pattern): New subroutine.
(treesit-beginning-of-defun)
(treesit-end-of-defun): Use new function treesit--navigate-thing.
(treesit--defuns-around): Generalize into treesit--thing-around.
(treesit--top-level-defun): Generalize into treesit--top-level-thing.
(treesit--navigate-defun): Generalize into treesit--navigate-thing.
(treesit-thing-at-point): Generalized from treesit-defun-at-point.
(treesit-defun-at-point): Use treesit-thing-at-point to do tht work.

22 months agoReorder optional arguments to 'package-vc-install'
Philip Kaludercic [Sun, 25 Dec 2022 08:53:07 +0000 (09:53 +0100)]
Reorder optional arguments to 'package-vc-install'

* lisp/emacs-lisp/package-vc.el (package-vc-install-selected-packages):
Update 'package-vc-install' invocation.
(package-vc-install): Reorder and update documentation.

22 months agoHandle missing dependencies for source packages
Philip Kaludercic [Sun, 25 Dec 2022 08:35:36 +0000 (09:35 +0100)]
Handle missing dependencies for source packages

* lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies): Add
new function.
(package-vc--unpack-1): Call 'package-vc-install-dependencies' instead
of 'package-compute-transaction' and 'package-download-transaction'.

It is unreasonable to abort the installation, since we cannot expect
all dependencies to be available in the regular archives.  Instead we
note which packages couldn't be found, and warn the user that these
will be missing.

22 months ago; Partial revert of f3e7820b
Philip Kaludercic [Mon, 19 Dec 2022 16:00:36 +0000 (17:00 +0100)]
; Partial revert of f3e7820b

* lisp/emacs-lisp/package.el (package-install-from-archive): Check if
a package is a directory package, not a VC package

22 months ago; * nt/INSTALL.W64: Fix wording.
Eli Zaretskii [Sun, 25 Dec 2022 08:26:59 +0000 (10:26 +0200)]
; * nt/INSTALL.W64: Fix wording.