aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Kangas2023-02-02 06:30:28 +0100
committerStefan Kangas2023-02-02 06:30:28 +0100
commit0571a3cc87f7c449796bb3eef38af4b2719b0bdf (patch)
tree18b41402977f6200ca563b348e98ca3a82d04203 /lisp
parentc831f55b234725a99f908656f996f3e6addc8825 (diff)
parent9715715ac163fc0b3ce6e170eb9c74b5f4ad8267 (diff)
downloademacs-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
Diffstat (limited to 'lisp')
-rw-r--r--lisp/eshell/em-cmpl.el43
-rw-r--r--lisp/repeat.el3
2 files changed, 15 insertions, 31 deletions
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
408Wrapper for `pcomplete-executables' or `pcomplete-dirs-or-entries',
409depending on the value of `eshell-force-execution'.
410
411Adds 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'.
600Used in `repeat-mode'." 600If `repeat-mode' is enabled, these keymaps determine which single key
601can 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))