]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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.

22 months ago; Fix recent changes in treesit documentation
Eli Zaretskii [Sun, 25 Dec 2022 07:29:47 +0000 (09:29 +0200)]
; Fix recent changes in treesit documentation

* lisp/treesit.el (treesit-defun-name-function, treesit-node-at)
(treesit-node-on): Doc fixes.

* doc/lispref/parsing.texi (Tree-sitter major modes): Fix wording,
punctuation, and indexing.
(Retrieving Nodes): Fix wording and add cross-references.

22 months agoFix c-ts-mode imenu defun name (bug#60296)
Yuan Fu [Sun, 25 Dec 2022 02:59:39 +0000 (18:59 -0800)]
Fix c-ts-mode imenu defun name (bug#60296)

Extract out c-ts-mode--declarator-identifier from
c-ts-mode--fontify-declarator.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--declarator-identifier): New
function.
(c-ts-mode--fontify-defun): Extract out.
(c-ts-mode--defun-name): Use the new function.

22 months agoFix treesit--children-covering-range-recurse (bug#60301)
Yuan Fu [Sun, 25 Dec 2022 02:45:36 +0000 (18:45 -0800)]
Fix treesit--children-covering-range-recurse (bug#60301)

* lisp/treesit.el (treesit--children-covering-range-recurse): Always
return a list of node.

22 months agoSupport treesit-defun-name in tree-sitter major modes
Yuan Fu [Sun, 25 Dec 2022 02:24:01 +0000 (18:24 -0800)]
Support treesit-defun-name in tree-sitter major modes

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--defun-name): New
function.
(csharp-ts-mode--imenu-1): Extract into new function.
(csharp-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--defun-name): New
function.
(java-ts-mode--imenu-1): Extract into new function.
(java-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/js.el (js-treesit-current-defun): Remove function.
This function is not used (for a while already).
(js--treesit-defun-name): New function.
(js--treesit-imenu-1): Extract into new function.
(js-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/json-ts-mode.el (json-ts-mode--defun-name): New
function.
(json-ts-mode--imenu-1): Extract into new function.
(json-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/python.el (python--treesit-defun-name): New function.
(python--imenu-treesit-create-index-1): Extract into new function.
(python-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--defun-name): New
function.
(rust-ts-mode--imenu-1): Extract into new function.
(rust-ts-mode): Setup treesit-defun-name-function.
* lisp/textmodes/css-mode.el (css--treesit-defun-name): New function.
(css--treesit-imenu-1): Extract into new function.
(css-ts-mode): Setup treesit-defun-name-function.
* lisp/textmodes/toml-ts-mode.el (toml-ts-mode--get-table-name):
Remove function.
(toml-ts-mode--defun-name): New function.
(toml-ts-mode--imenu-1): Extract into new function.
(toml-ts-mode): Setup treesit-defun-name-function.

22 months ago; * lisp/treesit.el (treesit-defun-at-point): Guard against nil.
Yuan Fu [Sun, 25 Dec 2022 00:40:00 +0000 (16:40 -0800)]
; * lisp/treesit.el (treesit-defun-at-point): Guard against nil.

22 months agoAdd treesit-defun-name and friends
Yuan Fu [Sun, 25 Dec 2022 00:33:35 +0000 (16:33 -0800)]
Add treesit-defun-name and friends

1. We now have treesit-defun-name, powered by
treesit-defun-name-function.
2. We now have treesit-add-log-current-defun, which powers
add-log-current-defun.
3. c-ts-mode updates its code to take advantage of these new features.
4. Manual updates.

* doc/lispref/parsing.texi (Tree-sitter major modes): Add manual for
new functions.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-name): New function.
(c-ts-mode--imenu-1): Extract out into c-ts-mode--defun-name.
(c-ts-base-mode): Setup treesit-defun-name-function.
* lisp/treesit.el (treesit-defun-name-function)
(treesit-add-log-defun-delimiter): New variables.
(treesit-defun-at-point)
(treesit-defun-name): New functions.
(treesit-major-mode-setup): Setup add-log-current-defun-function.

22 months agoMake treesit-node-at/on guess language at point
Yuan Fu [Sat, 24 Dec 2022 23:31:03 +0000 (15:31 -0800)]
Make treesit-node-at/on guess language at point

If PARSER-OR-LANG is nil, it makes more sense to guess the language at
point by treesit-language-at than to simply use the first parser in
the parser list.

* doc/lispref/parsing.texi (Retrieving Nodes): Update manual.
* lisp/treesit.el (treesit-node-at)
(treesit-node-on): Guess language at point.  Update docstring.
(treesit-buffer-root-node): Update docstring.

22 months ago; Add treesit-no-parser error
Yuan Fu [Sat, 24 Dec 2022 22:48:50 +0000 (14:48 -0800)]
; Add treesit-no-parser error

* lisp/treesit.el (treesit-no-parser): New error.
(treesit-buffer-root-node): Use the new error.

22 months ago* nt/INSTALL.W64: update instructions for setting up W64 environment
Óscar Fuentes [Sun, 25 Dec 2022 02:18:28 +0000 (03:18 +0100)]
* nt/INSTALL.W64: update instructions for setting up W64 environment

22 months agoRevert "; Bump minimum supported Windows version for MinGW64 to Windows 10."
Eli Zaretskii [Sat, 24 Dec 2022 19:39:26 +0000 (21:39 +0200)]
Revert "; Bump minimum supported Windows version for MinGW64 to Windows 10."

This reverts commit 75155e458601a3597d382660d0be863ab4d512c0.
Evidently, some MSYS2/MinGW64 folks still think Windows 8.1
is the minimum supported version, even though MinGW-w64 switched
to Windows 10 as the default target in January 2022.

22 months ago; Bump minimum supported Windows version for MinGW64 to Windows 10.
Eli Zaretskii [Sat, 24 Dec 2022 18:45:08 +0000 (20:45 +0200)]
; Bump minimum supported Windows version for MinGW64 to Windows 10.

22 months ago; Update minimum requirements of MinGW-w64
Eli Zaretskii [Sat, 24 Dec 2022 16:46:58 +0000 (18:46 +0200)]
; Update minimum requirements of MinGW-w64

* etc/PROBLEMS (Dumping):
* nt/INSTALL.W64: Update the minimum OS version supported by
MinGW-w64.

22 months ago; * lisp/progmodes/c-ts-mode.el: quote literal string in regexp
Mattias Engdegård [Sat, 24 Dec 2022 16:01:36 +0000 (17:01 +0100)]
; * lisp/progmodes/c-ts-mode.el: quote literal string in regexp

22 months ago; * src/xdisp.c (redisplay_internal): Reinstate the FRAME_LIVE_P test.
Eli Zaretskii [Sat, 24 Dec 2022 10:27:17 +0000 (12:27 +0200)]
; * src/xdisp.c (redisplay_internal): Reinstate the FRAME_LIVE_P test.

22 months agoFix definition of CNS 11643-15 charset
Eli Zaretskii [Sat, 24 Dec 2022 10:08:43 +0000 (12:08 +0200)]
Fix definition of CNS 11643-15 charset

* lisp/international/mule-conf.el (chinese-cns11643-15): Fix
:code-offset value.  (Bug#60275)
* lisp/international/characters.el: Add chinese-cns11643-15 to
charsets whose characters have categories c and C.

22 months ago; * lisp/progmodes/c-ts-mode.el: Add outline section headers.
Yuan Fu [Sat, 24 Dec 2022 08:16:45 +0000 (00:16 -0800)]
; * lisp/progmodes/c-ts-mode.el: Add outline section headers.

22 months agoImprove c-ts-mode block comment indent (bug#60270)
Yuan Fu [Sat, 24 Dec 2022 08:15:48 +0000 (00:15 -0800)]
Improve c-ts-mode block comment indent (bug#60270)

Now it handles stuff like

/**
 * @some_func:
 * @arg1:
 */

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Use new
matcher and anchor.
(c-ts-mode--looking-at-star): New matcher.
(c-ts-mode--comment-start-after-first-star): New anchor.

22 months ago; Add treesit_recursion_limit
Yuan Fu [Sat, 24 Dec 2022 01:17:25 +0000 (17:17 -0800)]
; Add treesit_recursion_limit

* src/treesit.c (treesit_recursion_limit): New constant.
(treesit_cursor_helper)
(Ftreesit_search_subtree)
(Ftreesit_induce_sparse_tree): Use the new constant.

22 months agoFix block comment indent and filling for c-ts-mode (bug#59763)
Yuan Fu [Sat, 24 Dec 2022 01:12:32 +0000 (17:12 -0800)]
Fix block comment indent and filling for c-ts-mode (bug#59763)

Now indent and filling works like in c-mode.  The only noticeable
missing piece is that the "*/" is not attached to the last sentence
when filling.  c-mode does it by replacing whitespaces between the
"*/" and the end of the last sentence with xxx, fill it, then change
the xxx back. I don't know if we should do that in c-ts-mode's filling.

* doc/lispref/modes.texi (Parser-based Indentation): Add new preset.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add new
indent rule.
(c-ts-mode--fill-paragraph): New function.
(c-ts-base-mode): Setup paragraph-start, adaptive-fill, etc.
* lisp/treesit.el (treesit-simple-indent-presets): Add new preset.

22 months agoFix treesit_cursor_helper (bug#60267)
Yuan Fu [Fri, 23 Dec 2022 23:22:31 +0000 (15:22 -0800)]
Fix treesit_cursor_helper (bug#60267)

The cause of that bug is that in a particular parse tree, the node
treesit_cursor_helper tries to go to is a missing node, not only is it
a missing node, it is the first node of a subtree.  So when
treesit_cursor_helper follows the algorithm and goes down the tree, it
goes down the previous subtree (because that subtree's end = end_pos,
because the target node has zero width).

    o
    |
 o--+-o
 |    |
 +-+  +-+-+
 | |  | | |
 o x  t o o

(We ended up in x when the target is t, because t has zero width.)

One way to solve it is to go back up the tree if we are at a leaf node
and still haven't matched the target node.  That's too ugly and
finicky so I resorted to recursion.  Now one more functions will
return give up (treesit_node_parent) if we are in a werid parse tree
that is super deep.  But since we already kind of give up on this kind
of parse trees (bug#59426), it doesn't really hurt.

* src/treesit.c (treesit_cursor_helper_1): New function.
(treesit_cursor_helper): Use the new function.  Change return type to
bool, and accept a cursor pointer.

(Ftreesit_node_parent)
(Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree): Use the new signature.

22 months agoFix restart-emacs alarms (Bug#60220)
Paul Eggert [Sat, 24 Dec 2022 07:36:06 +0000 (23:36 -0800)]
Fix restart-emacs alarms (Bug#60220)

* src/emacs.c (Fkill_emacs): Turn timers off before execing,
so that the re-execed Emacs doesn’t get a timer alarm.

22 months agoFix alternate stack test in configure
Florian Weimer [Fri, 23 Dec 2022 17:51:08 +0000 (18:51 +0100)]
Fix alternate stack test in configure

* configure.ac (emacs_cv_alternate_stack): Include <stdlib.h>
for 'malloc's prototype.

22 months agoAdd more functions to "string" shortdoc
Xi Lu [Fri, 23 Dec 2022 15:50:39 +0000 (23:50 +0800)]
Add more functions to "string" shortdoc

* lisp/emacs-lisp/shortdoc.el: Add 'string-or-null-p',
'char-or-string-p', 'char-uppercase-p'.  (Bug#60279)

22 months agoMake the Contour terminal an alias of xterm-256color
Yaraslau Tamashevich [Fri, 23 Dec 2022 09:39:25 +0000 (11:39 +0200)]
Make the Contour terminal an alias of xterm-256color

* lisp/faces.el (term-file-aliases): Make the Contour terminal an
alias of xterm-256color.  (Bug#60278)

Copyright-paperwork-exempt: yes

22 months ago; Fix punctuation in last change.
Eli Zaretskii [Sat, 24 Dec 2022 07:40:56 +0000 (09:40 +0200)]
; Fix punctuation in last change.

22 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

22 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>.

22 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)

22 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)

22 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)

22 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)

22 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)

22 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.

22 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.

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

22 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

22 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)

22 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.

22 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)

22 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.

22 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)

22 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.

22 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.

22 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.

22 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.

22 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.

22 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)

22 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

22 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

22 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.

22 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.

22 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.

22 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'.

22 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.

22 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.

22 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

22 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)

22 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)

22 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)

22 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".

22 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.

22 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

22 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.

22 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.

22 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.

22 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)

22 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.

22 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

22 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.

22 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.

22 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

22 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).

22 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>.

22 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.

22 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.

22 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)

22 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).

22 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

22 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.

22 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.

22 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'.

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