diff options
| author | Stefan Kangas | 2023-02-02 06:30:28 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2023-02-02 06:30:28 +0100 |
| commit | 0571a3cc87f7c449796bb3eef38af4b2719b0bdf (patch) | |
| tree | 18b41402977f6200ca563b348e98ca3a82d04203 | |
| parent | c831f55b234725a99f908656f996f3e6addc8825 (diff) | |
| parent | 9715715ac163fc0b3ce6e170eb9c74b5f4ad8267 (diff) | |
| download | emacs-0571a3cc87f7c449796bb3eef38af4b2719b0bdf.tar.gz emacs-0571a3cc87f7c449796bb3eef38af4b2719b0bdf.zip | |
Merge from origin/emacs-29
9715715ac16 (eshell--complete-commands-list): Fix regression in fix t...
ea1bb263153 * doc/emacs/basic.texi (Repeating): Mention describe-repe...
f91bf9df892 Unbreak the MS-Windows build
| -rw-r--r-- | doc/emacs/basic.texi | 17 | ||||
| -rw-r--r-- | lisp/eshell/em-cmpl.el | 43 | ||||
| -rw-r--r-- | lisp/repeat.el | 3 | ||||
| -rw-r--r-- | src/treesit.c | 4 |
4 files changed, 28 insertions, 39 deletions
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index 2cc45a8805e..d8a354ff42d 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi | |||
| @@ -887,6 +887,7 @@ z z z}. The first @kbd{C-x z} repeats the command once, and each | |||
| 887 | subsequent @kbd{z} repeats it once again. | 887 | subsequent @kbd{z} repeats it once again. |
| 888 | 888 | ||
| 889 | @findex repeat-mode | 889 | @findex repeat-mode |
| 890 | @findex describe-repeat-maps | ||
| 890 | @vindex repeat-exit-key | 891 | @vindex repeat-exit-key |
| 891 | @vindex repeat-exit-timeout | 892 | @vindex repeat-exit-timeout |
| 892 | Also you can activate @code{repeat-mode} that temporarily enables a | 893 | Also you can activate @code{repeat-mode} that temporarily enables a |
| @@ -895,11 +896,11 @@ Currently supported shorter key sequences are @kbd{C-x u u} instead of | |||
| 895 | @kbd{C-x u C-x u} to undo many changes, @kbd{C-x o o} instead of | 896 | @kbd{C-x u C-x u} to undo many changes, @kbd{C-x o o} instead of |
| 896 | @kbd{C-x o C-x o} to switch several windows, @kbd{C-x @{ @{ @} @} ^ ^ | 897 | @kbd{C-x o C-x o} to switch several windows, @kbd{C-x @{ @{ @} @} ^ ^ |
| 897 | v v} to resize the selected window interactively, @kbd{M-g n n p p} to | 898 | v v} to resize the selected window interactively, @kbd{M-g n n p p} to |
| 898 | navigate @code{next-error} matches, and @kbd{C-x ] ] [ [} to navigate | 899 | navigate @code{next-error} matches, @kbd{C-x ] ] [ [} to navigate |
| 899 | through pages. Any other key exits transient mode and then is | 900 | through pages, and other keys listed by @code{describe-repeat-maps}. |
| 900 | executed normally. The user option @code{repeat-exit-key} defines an | 901 | Any other key exits transient mode and then is executed normally. The |
| 901 | additional key to exit this transient mode. Also it's possible to | 902 | user option @code{repeat-exit-key} defines an additional key to exit |
| 902 | break the repetition chain automatically after some idle time by | 903 | this transient mode. Also it's possible to break the repetition chain |
| 903 | customizing the user option @code{repeat-exit-timeout} to specify the | 904 | automatically after some idle time by customizing the user option |
| 904 | idle time in seconds after which this transient mode will be turned | 905 | @code{repeat-exit-timeout} to specify the idle time in seconds after |
| 905 | off. | 906 | which this transient mode will be turned off. |
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index acbf206a3c6..2439f1ed804 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el | |||
| @@ -402,31 +402,6 @@ to writing a completion function." | |||
| 402 | args) | 402 | args) |
| 403 | posns))) | 403 | posns))) |
| 404 | 404 | ||
| 405 | (defun eshell--pcomplete-executables () | ||
| 406 | "Complete amongst a list of directories and executables. | ||
| 407 | |||
| 408 | Wrapper for `pcomplete-executables' or `pcomplete-dirs-or-entries', | ||
| 409 | depending on the value of `eshell-force-execution'. | ||
| 410 | |||
| 411 | Adds path prefix to candidates independent of `action' value." | ||
| 412 | ;; `pcomplete-entries' returns filenames without path on `action' to | ||
| 413 | ;; use current string directory as done in `completion-file-name-table' | ||
| 414 | ;; when `action' is nil to construct executable candidates. | ||
| 415 | (let ((table (if eshell-force-execution | ||
| 416 | (pcomplete-dirs-or-entries nil #'file-readable-p) | ||
| 417 | (pcomplete-executables)))) | ||
| 418 | (lambda (string pred action) | ||
| 419 | (let ((cands (funcall table string pred action))) | ||
| 420 | (if (eq action t) | ||
| 421 | (let ((specdir (file-name-directory string))) | ||
| 422 | (mapcar | ||
| 423 | (lambda (cand) | ||
| 424 | (if (stringp cand) | ||
| 425 | (file-name-concat specdir cand) | ||
| 426 | cand)) | ||
| 427 | cands)) | ||
| 428 | cands))))) | ||
| 429 | |||
| 430 | (defun eshell--complete-commands-list () | 405 | (defun eshell--complete-commands-list () |
| 431 | "Generate list of applicable, visible commands." | 406 | "Generate list of applicable, visible commands." |
| 432 | ;; Building the commands list can take quite a while, especially over Tramp | 407 | ;; Building the commands list can take quite a while, especially over Tramp |
| @@ -437,11 +412,19 @@ Adds path prefix to candidates independent of `action' value." | |||
| 437 | ;; we complete. Adjust `pcomplete-stub' accordingly! | 412 | ;; we complete. Adjust `pcomplete-stub' accordingly! |
| 438 | (if (and (> (length pcomplete-stub) 0) | 413 | (if (and (> (length pcomplete-stub) 0) |
| 439 | (eq (aref pcomplete-stub 0) eshell-explicit-command-char)) | 414 | (eq (aref pcomplete-stub 0) eshell-explicit-command-char)) |
| 440 | (setq pcomplete-stub (substring pcomplete-stub 1))))) | 415 | (setq pcomplete-stub (substring pcomplete-stub 1)))) |
| 441 | (completion-table-dynamic | 416 | (filename (pcomplete-arg))) |
| 442 | (lambda (filename) | 417 | ;; Do not use `completion-table-dynamic' when completing a command file |
| 443 | (if (file-name-directory filename) | 418 | ;; name since it doesn't know about boundaries and would end up doing silly |
| 444 | (eshell--pcomplete-executables) | 419 | ;; things like adding a SPC char when completing to "/usr/sbin/". |
| 420 | ;; | ||
| 421 | ;; If you work on this function, be careful not to reintroduce bug#48995. | ||
| 422 | (if (file-name-directory filename) | ||
| 423 | (if eshell-force-execution | ||
| 424 | (pcomplete-dirs-or-entries nil #'file-readable-p) | ||
| 425 | (pcomplete-executables)) | ||
| 426 | (completion-table-dynamic | ||
| 427 | (lambda (filename) | ||
| 445 | (let* ((paths (eshell-get-path)) | 428 | (let* ((paths (eshell-get-path)) |
| 446 | (cwd (file-name-as-directory | 429 | (cwd (file-name-as-directory |
| 447 | (expand-file-name default-directory))) | 430 | (expand-file-name default-directory))) |
diff --git a/lisp/repeat.el b/lisp/repeat.el index 0124ff4bc0c..ce59b310792 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el | |||
| @@ -597,7 +597,8 @@ This function can be used to force exit of repetition while it's active." | |||
| 597 | 597 | ||
| 598 | (defun describe-repeat-maps () | 598 | (defun describe-repeat-maps () |
| 599 | "Describe mappings of commands repeatable by symbol property `repeat-map'. | 599 | "Describe mappings of commands repeatable by symbol property `repeat-map'. |
| 600 | Used in `repeat-mode'." | 600 | If `repeat-mode' is enabled, these keymaps determine which single key |
| 601 | can be used to repeat a command invoked via a full key sequence." | ||
| 601 | (interactive) | 602 | (interactive) |
| 602 | (require 'help-fns) | 603 | (require 'help-fns) |
| 603 | (let ((help-buffer-under-preparation t)) | 604 | (let ((help-buffer-under-preparation t)) |
diff --git a/src/treesit.c b/src/treesit.c index b163685419f..405aec1f47e 100644 --- a/src/treesit.c +++ b/src/treesit.c | |||
| @@ -72,6 +72,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 72 | #undef ts_query_cursor_set_byte_range | 72 | #undef ts_query_cursor_set_byte_range |
| 73 | #undef ts_query_delete | 73 | #undef ts_query_delete |
| 74 | #undef ts_query_new | 74 | #undef ts_query_new |
| 75 | #undef ts_query_pattern_count | ||
| 75 | #undef ts_query_predicates_for_pattern | 76 | #undef ts_query_predicates_for_pattern |
| 76 | #undef ts_query_string_value_for_id | 77 | #undef ts_query_string_value_for_id |
| 77 | #undef ts_set_allocator | 78 | #undef ts_set_allocator |
| @@ -135,6 +136,7 @@ DEF_DLL_FN (void, ts_query_cursor_set_byte_range, | |||
| 135 | DEF_DLL_FN (void, ts_query_delete, (TSQuery *)); | 136 | DEF_DLL_FN (void, ts_query_delete, (TSQuery *)); |
| 136 | DEF_DLL_FN (TSQuery *, ts_query_new, | 137 | DEF_DLL_FN (TSQuery *, ts_query_new, |
| 137 | (const TSLanguage *, const char *, uint32_t, uint32_t *, TSQueryError *)); | 138 | (const TSLanguage *, const char *, uint32_t, uint32_t *, TSQueryError *)); |
| 139 | DEF_DLL_FN (uint32_t, ts_query_pattern_count, (const TSQuery *)); | ||
| 138 | DEF_DLL_FN (const TSQueryPredicateStep *, ts_query_predicates_for_pattern, | 140 | DEF_DLL_FN (const TSQueryPredicateStep *, ts_query_predicates_for_pattern, |
| 139 | ( const TSQuery *, uint32_t, uint32_t *)); | 141 | ( const TSQuery *, uint32_t, uint32_t *)); |
| 140 | DEF_DLL_FN (const char *, ts_query_string_value_for_id, | 142 | DEF_DLL_FN (const char *, ts_query_string_value_for_id, |
| @@ -200,6 +202,7 @@ init_treesit_functions (void) | |||
| 200 | LOAD_DLL_FN (library, ts_query_cursor_set_byte_range); | 202 | LOAD_DLL_FN (library, ts_query_cursor_set_byte_range); |
| 201 | LOAD_DLL_FN (library, ts_query_delete); | 203 | LOAD_DLL_FN (library, ts_query_delete); |
| 202 | LOAD_DLL_FN (library, ts_query_new); | 204 | LOAD_DLL_FN (library, ts_query_new); |
| 205 | LOAD_DLL_FN (library, ts_query_pattern_count); | ||
| 203 | LOAD_DLL_FN (library, ts_query_predicates_for_pattern); | 206 | LOAD_DLL_FN (library, ts_query_predicates_for_pattern); |
| 204 | LOAD_DLL_FN (library, ts_query_string_value_for_id); | 207 | LOAD_DLL_FN (library, ts_query_string_value_for_id); |
| 205 | LOAD_DLL_FN (library, ts_set_allocator); | 208 | LOAD_DLL_FN (library, ts_set_allocator); |
| @@ -256,6 +259,7 @@ init_treesit_functions (void) | |||
| 256 | #define ts_query_cursor_set_byte_range fn_ts_query_cursor_set_byte_range | 259 | #define ts_query_cursor_set_byte_range fn_ts_query_cursor_set_byte_range |
| 257 | #define ts_query_delete fn_ts_query_delete | 260 | #define ts_query_delete fn_ts_query_delete |
| 258 | #define ts_query_new fn_ts_query_new | 261 | #define ts_query_new fn_ts_query_new |
| 262 | #define ts_query_pattern_count fn_ts_query_pattern_count | ||
| 259 | #define ts_query_predicates_for_pattern fn_ts_query_predicates_for_pattern | 263 | #define ts_query_predicates_for_pattern fn_ts_query_predicates_for_pattern |
| 260 | #define ts_query_string_value_for_id fn_ts_query_string_value_for_id | 264 | #define ts_query_string_value_for_id fn_ts_query_string_value_for_id |
| 261 | #define ts_set_allocator fn_ts_set_allocator | 265 | #define ts_set_allocator fn_ts_set_allocator |