aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-12-23 06:30:12 +0100
committerStefan Kangas2022-12-23 06:30:12 +0100
commit99feed933ac8b8a3384eeb40254ef2e2de4f31de (patch)
tree5f28e85fd3915dd9350375c067762d857bbdfbb5
parent17bf6a829ca2fd2920c01e1aee30ab16b9c672eb (diff)
parent0754173c923a1888a1b18b4c6c5d1dc72e6cc6af (diff)
downloademacs-99feed933ac8b8a3384eeb40254ef2e2de4f31de.tar.gz
emacs-99feed933ac8b8a3384eeb40254ef2e2de4f31de.zip
Merge from origin/emacs-29
0754173c923 ; Fix docstring 014232d3840 Eglot: eglot--servers-by-xrefed-file doesn't need to be v... bbe35c280c2 Prevent stale servers when using eglot-extend-to-xref 9bf13a3fb9e ; * src/alloc.c (Fmemory_info): Doc fix. baa33a5c054 * etc/tutorials/TUTORIAL.cn: Fix typos. (Bug#60221) 98d7f76b451 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... a488a6870ac Add alias for removed font-lock function 02e046566e2 Set beginning/end-of-defun-function in treesit-major-mode... 7dea58b88db Add treesit-defun-at-point and fix c-ts-mode-indent-defun 69123d4aa4e ; Fix treesit--defuns-around 05d8310fb5d Use the new keyword ':repeat' in repeatable keymaps.
-rw-r--r--etc/tutorials/TUTORIAL.cn4
-rw-r--r--lisp/bindings.el13
-rw-r--r--lisp/comint.el4
-rw-r--r--lisp/dired.el2
-rw-r--r--lisp/eshell/em-prompt.el4
-rw-r--r--lisp/eshell/esh-mode.el4
-rw-r--r--lisp/font-lock.el1
-rw-r--r--lisp/keymap.el2
-rw-r--r--lisp/outline.el15
-rw-r--r--lisp/progmodes/c-ts-mode.el11
-rw-r--r--lisp/progmodes/eglot.el8
-rw-r--r--lisp/shell.el4
-rw-r--r--lisp/tab-bar.el6
-rw-r--r--lisp/textmodes/reftex-vars.el4
-rw-r--r--lisp/treesit.el41
-rw-r--r--lisp/window.el7
-rw-r--r--lisp/winner.el4
-rw-r--r--src/alloc.c2
18 files changed, 70 insertions, 66 deletions
diff --git a/etc/tutorials/TUTORIAL.cn b/etc/tutorials/TUTORIAL.cn
index 770d9a83be3..cb430d3fdb0 100644
--- a/etc/tutorials/TUTORIAL.cn
+++ b/etc/tutorials/TUTORIAL.cn
@@ -299,7 +299,7 @@ Emacs 可以有多个“窗格”,每个窗格显示不同的文字。后面
299 299
300>> 试试 C-u 8 *,这将会插入 ********。 300>> 试试 C-u 8 *,这将会插入 ********。
301 301
302好,现在你应该已经掌握了最基本的文本插入和修改功能,其实删除还可以 302好,现在你应该已经掌握了最基本的文本插入和修改功能,其实删除还可以
303“以词为单位”进行,下面是一个关于“删除”操作的小结: 303“以词为单位”进行,下面是一个关于“删除”操作的小结:
304 304
305 <DEL> 删除光标前的一个字符 305 <DEL> 删除光标前的一个字符
@@ -316,7 +316,7 @@ Emacs 可以有多个“窗格”,每个窗格显示不同的文字。后面
316 316
317注意“<DEL> 和 C-d”还有“M-<DEL> 和 M-d”是根据前述惯例从 C-f和 M-f 衍生 317注意“<DEL> 和 C-d”还有“M-<DEL> 和 M-d”是根据前述惯例从 C-f和 M-f 衍生
318出来的(其实<DEL>不是控制字符,我们先忽略这一点)。C-k和 M-k 的关系在 318出来的(其实<DEL>不是控制字符,我们先忽略这一点)。C-k和 M-k 的关系在
319某种程度上与 C-e 和 M-e 一样――如果把“一行”和“一句”个类比的话。 319某种程度上与 C-e 和 M-e 一样――如果把“一行”和“一句”一个类比的话。
320 320
321你也可以用一种通用的办法来移除缓冲区里的任何一部分:首先把光标移动到你 321你也可以用一种通用的办法来移除缓冲区里的任何一部分:首先把光标移动到你
322想要移除的区域的一端,然后按 C-<SPC>(<SPC>指空格)【注意,C-<SPC> 往 322想要移除的区域的一端,然后按 C-<SPC>(<SPC>指空格)【注意,C-<SPC> 往
diff --git a/lisp/bindings.el b/lisp/bindings.el
index a3f51ebb315..f2e0799f72b 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1012,8 +1012,8 @@ if `inhibit-field-text-motion' is non-nil."
1012;; (define-key ctl-x-map "U" 'undo-only) 1012;; (define-key ctl-x-map "U" 'undo-only)
1013(defvar-keymap undo-repeat-map 1013(defvar-keymap undo-repeat-map
1014 :doc "Keymap to repeat undo key sequences \\`C-x u u'. Used in `repeat-mode'." 1014 :doc "Keymap to repeat undo key sequences \\`C-x u u'. Used in `repeat-mode'."
1015 :repeat t
1015 "u" #'undo) 1016 "u" #'undo)
1016(put 'undo 'repeat-map 'undo-repeat-map)
1017 1017
1018(define-key global-map '[(control ??)] 'undo-redo) 1018(define-key global-map '[(control ??)] 'undo-redo)
1019(define-key global-map [?\C-\M-_] 'undo-redo) 1019(define-key global-map [?\C-\M-_] 'undo-redo)
@@ -1033,12 +1033,10 @@ if `inhibit-field-text-motion' is non-nil."
1033 1033
1034(defvar-keymap buffer-navigation-repeat-map 1034(defvar-keymap buffer-navigation-repeat-map
1035 :doc "Keymap to repeat `next-buffer' and `previous-buffer'. Used in `repeat-mode'." 1035 :doc "Keymap to repeat `next-buffer' and `previous-buffer'. Used in `repeat-mode'."
1036 :repeat t
1036 "<right>" #'next-buffer 1037 "<right>" #'next-buffer
1037 "<left>" #'previous-buffer) 1038 "<left>" #'previous-buffer)
1038 1039
1039(put 'next-buffer 'repeat-map 'buffer-navigation-repeat-map)
1040(put 'previous-buffer 'repeat-map 'buffer-navigation-repeat-map)
1041
1042(let ((map minibuffer-local-map)) 1040(let ((map minibuffer-local-map))
1043 (define-key map "\en" 'next-history-element) 1041 (define-key map "\en" 'next-history-element)
1044 (define-key map [next] 'next-history-element) 1042 (define-key map [next] 'next-history-element)
@@ -1111,12 +1109,11 @@ if `inhibit-field-text-motion' is non-nil."
1111 1109
1112(defvar-keymap next-error-repeat-map 1110(defvar-keymap next-error-repeat-map
1113 :doc "Keymap to repeat `next-error' key sequences. Used in `repeat-mode'." 1111 :doc "Keymap to repeat `next-error' key sequences. Used in `repeat-mode'."
1112 :repeat t
1114 "n" #'next-error 1113 "n" #'next-error
1115 "M-n" #'next-error 1114 "M-n" #'next-error
1116 "p" #'previous-error 1115 "p" #'previous-error
1117 "M-p" #'previous-error) 1116 "M-p" #'previous-error)
1118(put 'next-error 'repeat-map 'next-error-repeat-map)
1119(put 'previous-error 'repeat-map 'next-error-repeat-map)
1120 1117
1121(defvar-keymap goto-map 1118(defvar-keymap goto-map
1122 :doc "Keymap for navigation commands." 1119 :doc "Keymap for navigation commands."
@@ -1474,12 +1471,10 @@ if `inhibit-field-text-motion' is non-nil."
1474 1471
1475(defvar-keymap page-navigation-repeat-map 1472(defvar-keymap page-navigation-repeat-map
1476 :doc "Keymap to repeat page navigation key sequences. Used in `repeat-mode'." 1473 :doc "Keymap to repeat page navigation key sequences. Used in `repeat-mode'."
1474 :repeat t
1477 "]" #'forward-page 1475 "]" #'forward-page
1478 "[" #'backward-page) 1476 "[" #'backward-page)
1479 1477
1480(put 'forward-page 'repeat-map 'page-navigation-repeat-map)
1481(put 'backward-page 'repeat-map 'page-navigation-repeat-map)
1482
1483(define-key ctl-x-map "\C-p" 'mark-page) 1478(define-key ctl-x-map "\C-p" 'mark-page)
1484(define-key ctl-x-map "l" 'count-lines-page) 1479(define-key ctl-x-map "l" 'count-lines-page)
1485(define-key ctl-x-map "np" 'narrow-to-page) 1480(define-key ctl-x-map "np" 'narrow-to-page)
diff --git a/lisp/comint.el b/lisp/comint.el
index 7ba423e65de..77d213574f3 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -606,12 +606,10 @@ via PTYs.")
606 606
607(defvar-keymap comint-repeat-map 607(defvar-keymap comint-repeat-map
608 :doc "Keymap to repeat comint key sequences. Used in `repeat-mode'." 608 :doc "Keymap to repeat comint key sequences. Used in `repeat-mode'."
609 :repeat t
609 "C-n" #'comint-next-prompt 610 "C-n" #'comint-next-prompt
610 "C-p" #'comint-previous-prompt) 611 "C-p" #'comint-previous-prompt)
611 612
612(put #'comint-next-prompt 'repeat-map 'comint-repeat-map)
613(put #'comint-previous-prompt 'repeat-map 'comint-repeat-map)
614
615;; Fixme: Is this still relevant? 613;; Fixme: Is this still relevant?
616(defvar comint-ptyp t 614(defvar comint-ptyp t
617 "Non-nil if communications via pty; false if by pipe. Buffer local. 615 "Non-nil if communications via pty; false if by pipe. Buffer local.
diff --git a/lisp/dired.el b/lisp/dired.el
index 81e62f88cf1..f5d1b90abf4 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -4882,9 +4882,9 @@ Interactively with prefix argument, read FILE-NAME."
4882 4882
4883(defvar-keymap dired-jump-map 4883(defvar-keymap dired-jump-map
4884 :doc "Keymap to repeat `dired-jump'. Used in `repeat-mode'." 4884 :doc "Keymap to repeat `dired-jump'. Used in `repeat-mode'."
4885 :repeat t
4885 "j" #'dired-jump 4886 "j" #'dired-jump
4886 "C-j" #'dired-jump) 4887 "C-j" #'dired-jump)
4887(put 'dired-jump 'repeat-map 'dired-jump-map)
4888 4888
4889 4889
4890;;; Miscellaneous commands 4890;;; Miscellaneous commands
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index a8744de1dba..abb123bcff2 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -102,12 +102,10 @@ arriving, or after."
102 102
103(defvar-keymap eshell-prompt-repeat-map 103(defvar-keymap eshell-prompt-repeat-map
104 :doc "Keymap to repeat eshell-prompt key sequences. Used in `repeat-mode'." 104 :doc "Keymap to repeat eshell-prompt key sequences. Used in `repeat-mode'."
105 :repeat t
105 "C-n" #'eshell-next-prompt 106 "C-n" #'eshell-next-prompt
106 "C-p" #'eshell-previous-prompt) 107 "C-p" #'eshell-previous-prompt)
107 108
108(put #'eshell-next-prompt 'repeat-map 'eshell-prompt-repeat-map)
109(put #'eshell-previous-prompt 'repeat-map 'eshell-prompt-repeat-map)
110
111;;; Functions: 109;;; Functions:
112 110
113(define-minor-mode eshell-prompt-mode 111(define-minor-mode eshell-prompt-mode
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 4357a0e29a0..b3db0f6af45 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -282,12 +282,10 @@ This is used by `eshell-watch-for-password-prompt'."
282 282
283(defvar-keymap eshell-command-repeat-map 283(defvar-keymap eshell-command-repeat-map
284 :doc "Keymap to repeat eshell-command key sequences. Used in `repeat-mode'." 284 :doc "Keymap to repeat eshell-command key sequences. Used in `repeat-mode'."
285 :repeat t
285 "C-f" #'eshell-forward-argument 286 "C-f" #'eshell-forward-argument
286 "C-b" #'eshell-backward-argument) 287 "C-b" #'eshell-backward-argument)
287 288
288(put #'eshell-forward-argument 'repeat-map 'eshell-command-repeat-map)
289(put #'eshell-backward-argument 'repeat-map 'eshell-command-repeat-map)
290
291;;; User Functions: 289;;; User Functions:
292 290
293(defun eshell-kill-buffer-function () 291(defun eshell-kill-buffer-function ()
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index bf9a179d6ae..2dfbe3ad232 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2361,6 +2361,7 @@ in which C preprocessor directives are used, e.g. `asm-mode' and
2361 2361
2362(define-obsolete-function-alias 'font-lock-after-fontify-buffer #'ignore "29.1") 2362(define-obsolete-function-alias 'font-lock-after-fontify-buffer #'ignore "29.1")
2363(define-obsolete-function-alias 'font-lock-after-unfontify-buffer #'ignore "29.1") 2363(define-obsolete-function-alias 'font-lock-after-unfontify-buffer #'ignore "29.1")
2364(define-obsolete-function-alias 'font-lock-fontify-syntactically-region #'font-lock-default-fontify-syntactically "29.1")
2364 2365
2365 2366
2366(provide 'font-lock) 2367(provide 'font-lock)
diff --git a/lisp/keymap.el b/lisp/keymap.el
index b355f68aa2f..e93e3c5f3bc 100644
--- a/lisp/keymap.el
+++ b/lisp/keymap.el
@@ -625,7 +625,7 @@ command exists in this specific map, but it doesn't have the
625 `(defvar ,variable-name 625 `(defvar ,variable-name
626 (define-keymap ,@(nreverse opts) ,@defs) 626 (define-keymap ,@(nreverse opts) ,@defs)
627 ,@(and doc (list doc))))) 627 ,@(and doc (list doc)))))
628 (if repeat 628 (if props
629 `(progn 629 `(progn
630 ,defvar-form 630 ,defvar-form
631 ,@(nreverse props)) 631 ,@(nreverse props))
diff --git a/lisp/outline.el b/lisp/outline.el
index 53bfc4d556f..c2b33b4c58f 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -1868,6 +1868,7 @@ With a prefix argument, show headings up to that LEVEL."
1868 1868
1869 1869
1870(defvar-keymap outline-navigation-repeat-map 1870(defvar-keymap outline-navigation-repeat-map
1871 :repeat t
1871 "C-b" #'outline-backward-same-level 1872 "C-b" #'outline-backward-same-level
1872 "b" #'outline-backward-same-level 1873 "b" #'outline-backward-same-level
1873 "C-f" #'outline-forward-same-level 1874 "C-f" #'outline-forward-same-level
@@ -1879,14 +1880,8 @@ With a prefix argument, show headings up to that LEVEL."
1879 "C-u" #'outline-up-heading 1880 "C-u" #'outline-up-heading
1880 "u" #'outline-up-heading) 1881 "u" #'outline-up-heading)
1881 1882
1882(dolist (command '(outline-backward-same-level
1883 outline-forward-same-level
1884 outline-next-visible-heading
1885 outline-previous-visible-heading
1886 outline-up-heading))
1887 (put command 'repeat-map 'outline-navigation-repeat-map))
1888
1889(defvar-keymap outline-editing-repeat-map 1883(defvar-keymap outline-editing-repeat-map
1884 :repeat t
1890 "C-v" #'outline-move-subtree-down 1885 "C-v" #'outline-move-subtree-down
1891 "v" #'outline-move-subtree-down 1886 "v" #'outline-move-subtree-down
1892 "C-^" #'outline-move-subtree-up 1887 "C-^" #'outline-move-subtree-up
@@ -1896,12 +1891,6 @@ With a prefix argument, show headings up to that LEVEL."
1896 "C-<" #'outline-promote 1891 "C-<" #'outline-promote
1897 "<" #'outline-promote) 1892 "<" #'outline-promote)
1898 1893
1899(dolist (command '(outline-move-subtree-down
1900 outline-move-subtree-up
1901 outline-demote
1902 outline-promote))
1903 (put command 'repeat-map 'outline-editing-repeat-map))
1904
1905 1894
1906(provide 'outline) 1895(provide 'outline)
1907(provide 'noutline) 1896(provide 'noutline)
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index cf941236f82..6f7056864f3 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -556,13 +556,10 @@ the semicolon. This function skips the semicolon."
556 556
557`treesit-defun-type-regexp' defines what constructs to indent." 557`treesit-defun-type-regexp' defines what constructs to indent."
558 (interactive "*") 558 (interactive "*")
559 (let ((orig-point (point-marker))) 559 (when-let ((orig-point (point-marker))
560 ;; If `treesit-beginning-of-defun' returns nil, we are not in a 560 (node (treesit-defun-at-point)))
561 ;; defun, so don't indent anything. 561 (indent-region (treesit-node-start node)
562 (when (treesit-beginning-of-defun) 562 (treesit-node-end node))
563 (let ((start (point)))
564 (treesit-end-of-defun)
565 (indent-region start (point))))
566 (goto-char orig-point))) 563 (goto-char orig-point)))
567 564
568(defvar-keymap c-ts-mode-map 565(defvar-keymap c-ts-mode-map
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 0f1bfd0447d..15cb1b6fad0 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -908,6 +908,8 @@ PRESERVE-BUFFERS as in `eglot-shutdown', which see."
908 do (with-demoted-errors "[eglot] shutdown all: %s" 908 do (with-demoted-errors "[eglot] shutdown all: %s"
909 (cl-loop for s in ss do (eglot-shutdown s nil nil preserve-buffers))))) 909 (cl-loop for s in ss do (eglot-shutdown s nil nil preserve-buffers)))))
910 910
911(defvar eglot--servers-by-xrefed-file (make-hash-table :test 'equal))
912
911(defun eglot--on-shutdown (server) 913(defun eglot--on-shutdown (server)
912 "Called by jsonrpc.el when SERVER is already dead." 914 "Called by jsonrpc.el when SERVER is already dead."
913 ;; Turn off `eglot--managed-mode' where appropriate. 915 ;; Turn off `eglot--managed-mode' where appropriate.
@@ -926,6 +928,9 @@ PRESERVE-BUFFERS as in `eglot-shutdown', which see."
926 (setf (gethash (eglot--project server) eglot--servers-by-project) 928 (setf (gethash (eglot--project server) eglot--servers-by-project)
927 (delq server 929 (delq server
928 (gethash (eglot--project server) eglot--servers-by-project))) 930 (gethash (eglot--project server) eglot--servers-by-project)))
931 (maphash (lambda (f s)
932 (when (eq s server) (remhash f eglot--servers-by-xrefed-file)))
933 eglot--servers-by-xrefed-file)
929 (cond ((eglot--shutdown-requested server) 934 (cond ((eglot--shutdown-requested server)
930 t) 935 t)
931 ((not (eglot--inhibit-autoreconnect server)) 936 ((not (eglot--inhibit-autoreconnect server))
@@ -1057,9 +1062,6 @@ be guessed."
1057(put 'eglot-lsp-context 'variable-documentation 1062(put 'eglot-lsp-context 'variable-documentation
1058 "Dynamically non-nil when searching for projects in LSP context.") 1063 "Dynamically non-nil when searching for projects in LSP context.")
1059 1064
1060(defvar eglot--servers-by-xrefed-file
1061 (make-hash-table :test 'equal :weakness 'value))
1062
1063(defun eglot--current-project () 1065(defun eglot--current-project ()
1064 "Return a project object for Eglot's LSP purposes. 1066 "Return a project object for Eglot's LSP purposes.
1065This relies on `project-current' and thus on 1067This relies on `project-current' and thus on
diff --git a/lisp/shell.el b/lisp/shell.el
index dadbdcbc034..727f2aa0dd7 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -395,12 +395,10 @@ Useful for shells like zsh that has this feature."
395 395
396(defvar-keymap shell-repeat-map 396(defvar-keymap shell-repeat-map
397 :doc "Keymap to repeat shell key sequences. Used in `repeat-mode'." 397 :doc "Keymap to repeat shell key sequences. Used in `repeat-mode'."
398 :repeat t
398 "C-f" #'shell-forward-command 399 "C-f" #'shell-forward-command
399 "C-b" #'shell-backward-command) 400 "C-b" #'shell-backward-command)
400 401
401(put #'shell-forward-command 'repeat-map 'shell-repeat-map)
402(put #'shell-backward-command 'repeat-map 'shell-repeat-map)
403
404(defcustom shell-mode-hook '() 402(defcustom shell-mode-hook '()
405 "Hook for customizing Shell mode." 403 "Hook for customizing Shell mode."
406 :type 'hook 404 :type 'hook
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 69283cce145..0bab3aba801 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -2654,18 +2654,16 @@ When `switch-to-buffer-obey-display-actions' is non-nil,
2654(defvar-keymap tab-bar-switch-repeat-map 2654(defvar-keymap tab-bar-switch-repeat-map
2655 :doc "Keymap to repeat tab switch key sequences \\`C-x t o o O'. 2655 :doc "Keymap to repeat tab switch key sequences \\`C-x t o o O'.
2656Used in `repeat-mode'." 2656Used in `repeat-mode'."
2657 :repeat t
2657 "o" #'tab-next 2658 "o" #'tab-next
2658 "O" #'tab-previous) 2659 "O" #'tab-previous)
2659(put 'tab-next 'repeat-map 'tab-bar-switch-repeat-map)
2660(put 'tab-previous 'repeat-map 'tab-bar-switch-repeat-map)
2661 2660
2662(defvar-keymap tab-bar-move-repeat-map 2661(defvar-keymap tab-bar-move-repeat-map
2663 :doc "Keymap to repeat tab move key sequences \\`C-x t m m M'. 2662 :doc "Keymap to repeat tab move key sequences \\`C-x t m m M'.
2664Used in `repeat-mode'." 2663Used in `repeat-mode'."
2664 :repeat t
2665 "m" #'tab-move 2665 "m" #'tab-move
2666 "M" #'tab-bar-move-tab-backward) 2666 "M" #'tab-bar-move-tab-backward)
2667(put 'tab-move 'repeat-map 'tab-bar-move-repeat-map)
2668(put 'tab-bar-move-tab-backward 'repeat-map 'tab-bar-move-repeat-map)
2669 2667
2670 2668
2671(provide 'tab-bar) 2669(provide 'tab-bar)
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index ee94cc5d693..51dedddf3a5 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -2096,8 +2096,8 @@ may require a restart of Emacs in order to become effective."
2096 2096
2097(defcustom reftex-allow-detached-macro-args nil 2097(defcustom reftex-allow-detached-macro-args nil
2098 "Non-nil means, allow arguments of macros to be detached by whitespace. 2098 "Non-nil means, allow arguments of macros to be detached by whitespace.
2099When this is t, `aaa' will be considered as argument of \\bb in the following 2099When this is t, `aaa' will be considered as argument of \\bbb in
2100construct: \\bbb [xxx] {aaa}." 2100the following construct: \\bbb [xxx] {aaa}."
2101 :group 'reftex-miscellaneous-configurations 2101 :group 'reftex-miscellaneous-configurations
2102 :type 'boolean) 2102 :type 'boolean)
2103 2103
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 04019cae609..75330ac121a 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1666,10 +1666,13 @@ REGEXP and PRED are the same as in `treesit-defun-type-regexp'."
1666 ;; defun, in that case we want to use a node that's actually 1666 ;; defun, in that case we want to use a node that's actually
1667 ;; before/after point. 1667 ;; before/after point.
1668 (node-before (if (>= (treesit-node-start node) pos) 1668 (node-before (if (>= (treesit-node-start node) pos)
1669 (treesit-search-forward-goto node "" t t t) 1669 (save-excursion
1670 (treesit-search-forward-goto node "" t t t))
1670 node)) 1671 node))
1671 (node-after (if (<= (treesit-node-end node) pos) 1672 (node-after (if (<= (treesit-node-end node) pos)
1672 (treesit-search-forward-goto node "" nil nil t) 1673 (save-excursion
1674 (treesit-search-forward-goto
1675 node "" nil nil t))
1673 node)) 1676 node))
1674 (result (list nil nil nil)) 1677 (result (list nil nil nil))
1675 (pred (or pred (lambda (_) t)))) 1678 (pred (or pred (lambda (_) t))))
@@ -1840,6 +1843,29 @@ function is called recursively."
1840 ;; Counter equal to 0 means we successfully stepped ARG steps. 1843 ;; Counter equal to 0 means we successfully stepped ARG steps.
1841 (if (eq counter 0) pos nil))) 1844 (if (eq counter 0) pos nil)))
1842 1845
1846;; TODO: In corporate into thing-at-point.
1847(defun treesit-defun-at-point ()
1848 "Return the defun at point or nil if none is found.
1849
1850Respects `treesit-defun-tactic': return the top-level defun if it
1851is `top-level', return the immediate parent defun if it is
1852`nested'."
1853 (pcase-let* ((`(,regexp . ,pred)
1854 (if (consp treesit-defun-type-regexp)
1855 treesit-defun-type-regexp
1856 (cons treesit-defun-type-regexp nil)))
1857 (`(,_ ,next ,parent)
1858 (treesit--defuns-around (point) regexp pred))
1859 ;; If point is at the beginning of a defun, we
1860 ;; prioritize that defun over the parent in nested
1861 ;; mode.
1862 (node (or (and (eq (treesit-node-start next) (point))
1863 next)
1864 parent)))
1865 (if (eq treesit-defun-tactic 'top-level)
1866 (treesit--top-level-defun node regexp pred)
1867 node)))
1868
1843;;; Activating tree-sitter 1869;;; Activating tree-sitter
1844 1870
1845(defun treesit-ready-p (language &optional quiet) 1871(defun treesit-ready-p (language &optional quiet)
@@ -1924,7 +1950,16 @@ before calling this function."
1924 (keymap-set (current-local-map) "<remap> <beginning-of-defun>" 1950 (keymap-set (current-local-map) "<remap> <beginning-of-defun>"
1925 #'treesit-beginning-of-defun) 1951 #'treesit-beginning-of-defun)
1926 (keymap-set (current-local-map) "<remap> <end-of-defun>" 1952 (keymap-set (current-local-map) "<remap> <end-of-defun>"
1927 #'treesit-end-of-defun))) 1953 #'treesit-end-of-defun)
1954 ;; `end-of-defun' will not work completely correctly in nested
1955 ;; defuns due to its implementation. However, many lisp programs
1956 ;; use `beginning/end-of-defun', so we should still set
1957 ;; `beginning/end-of-defun-function' so they still mostly work.
1958 ;; This is also what `cc-mode' does: rebind user commands and set
1959 ;; the variables. In future we should update `end-of-defun' to
1960 ;; work with nested defuns.
1961 (setq-local beginning-of-defun-function #'treesit-beginning-of-defun)
1962 (setq-local end-of-defun-function #'treesit-end-of-defun)))
1928 1963
1929;;; Debugging 1964;;; Debugging
1930 1965
diff --git a/lisp/window.el b/lisp/window.el
index a4a84218818..5dd5b808831 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -10561,26 +10561,23 @@ displaying that processes's buffer."
10561(defvar-keymap other-window-repeat-map 10561(defvar-keymap other-window-repeat-map
10562 :doc "Keymap to repeat `other-window' key sequences. 10562 :doc "Keymap to repeat `other-window' key sequences.
10563Used in `repeat-mode'." 10563Used in `repeat-mode'."
10564 :repeat t
10564 "o" #'other-window 10565 "o" #'other-window
10565 "O" (lambda () 10566 "O" (lambda ()
10566 (interactive) 10567 (interactive)
10567 (setq repeat-map 'other-window-repeat-map) 10568 (setq repeat-map 'other-window-repeat-map)
10568 (other-window -1))) 10569 (other-window -1)))
10569(put 'other-window 'repeat-map 'other-window-repeat-map)
10570 10570
10571(defvar-keymap resize-window-repeat-map 10571(defvar-keymap resize-window-repeat-map
10572 :doc "Keymap to repeat window resizing commands. 10572 :doc "Keymap to repeat window resizing commands.
10573Used in `repeat-mode'." 10573Used in `repeat-mode'."
10574 :repeat t
10574 ;; Standard keys: 10575 ;; Standard keys:
10575 "^" #'enlarge-window 10576 "^" #'enlarge-window
10576 "}" #'enlarge-window-horizontally 10577 "}" #'enlarge-window-horizontally
10577 "{" #'shrink-window-horizontally 10578 "{" #'shrink-window-horizontally
10578 ;; Additional keys: 10579 ;; Additional keys:
10579 "v" #'shrink-window) 10580 "v" #'shrink-window)
10580(put 'enlarge-window 'repeat-map 'resize-window-repeat-map)
10581(put 'enlarge-window-horizontally 'repeat-map 'resize-window-repeat-map)
10582(put 'shrink-window-horizontally 'repeat-map 'resize-window-repeat-map)
10583(put 'shrink-window 'repeat-map 'resize-window-repeat-map)
10584 10581
10585(defvar-keymap window-prefix-map 10582(defvar-keymap window-prefix-map
10586 :doc "Keymap for subcommands of \\`C-x w'." 10583 :doc "Keymap for subcommands of \\`C-x w'."
diff --git a/lisp/winner.el b/lisp/winner.el
index c8354b18bec..aed57aa0371 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -330,12 +330,10 @@ You may want to include buffer names such as *Help*, *Apropos*,
330 330
331(defvar-keymap winner-repeat-map 331(defvar-keymap winner-repeat-map
332 :doc "Keymap to repeat winner key sequences. Used in `repeat-mode'." 332 :doc "Keymap to repeat winner key sequences. Used in `repeat-mode'."
333 :repeat t
333 "<left>" #'winner-undo 334 "<left>" #'winner-undo
334 "<right>" #'winner-redo) 335 "<right>" #'winner-redo)
335 336
336(put #'winner-undo 'repeat-map 'winner-repeat-map)
337(put #'winner-redo 'repeat-map 'winner-repeat-map)
338
339 337
340;;;###autoload 338;;;###autoload
341(define-minor-mode winner-mode 339(define-minor-mode winner-mode
diff --git a/src/alloc.c b/src/alloc.c
index 2975754124a..e7edc0595b3 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -7693,7 +7693,7 @@ DEFUN ("memory-info", Fmemory_info, Smemory_info, 0, 0, 0,
7693All values are in Kbytes. If there is no swap space, 7693All values are in Kbytes. If there is no swap space,
7694last two values are zero. If the system is not supported 7694last two values are zero. If the system is not supported
7695or memory information can't be obtained, return nil. 7695or memory information can't be obtained, return nil.
7696If `default-directory is remote, return memory information of the 7696If `default-directory' is remote, return memory information of the
7697respective remote host. */) 7697respective remote host. */)
7698 (void) 7698 (void)
7699{ 7699{