diff options
| author | Constantine Vetoshev <gepardcv@gmail.com> | 2020-04-14 15:50:29 -0700 |
|---|---|---|
| committer | Constantine Vetoshev <gepardcv@gmail.com> | 2020-04-14 15:50:29 -0700 |
| commit | 35490e781208e1f5ce1315baa6af96e78a72896b (patch) | |
| tree | 8577635d63d4dfd4044a2ee153103fbaedc3bc2b | |
| parent | 5184563007c73d0dc236c408219c18ff5dd6044e (diff) | |
Clarify use of completing-read.
| -rw-r--r-- | perspective.el | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/perspective.el b/perspective.el index d368246..1f5ccf2 100644 --- a/perspective.el +++ b/perspective.el @@ -751,7 +751,7 @@ Prefers perspectives in the selected frame." See also `persp-switch' and `persp-add-buffer'." (interactive - (list (completing-read "Remove buffer from perspective: " (persp-current-buffer-names)))) + (list (funcall persp-interactive-completion-function "Remove buffer from perspective: " (persp-current-buffer-names)))) (setq buffer (when buffer (get-buffer buffer))) (cond ((not (buffer-live-p buffer))) ;; Only kill the buffer if no other perspectives are using it @@ -1115,7 +1115,10 @@ perspective beginning with the given letter." ;; built-in completing-read (e.g., Selectrum). ;;;###autoload (defun persp-switch-to-buffer* (buffer-or-name) - "Like `switch-to-buffer', restricted to the current perspective." + "Like `switch-to-buffer', restricted to the current perspective. +This respects ido-ignore-buffers, since we automatically add +buffer filtering to ido-mode already (see use of +PERSP-SET-IDO-BUFFERS)." (interactive (list (if (or current-prefix-arg (not persp-mode)) @@ -1123,6 +1126,9 @@ perspective beginning with the given letter." (read-buffer-to-switch "Switch to buffer")) (let* ((candidates (persp-current-buffer-names)) (other (buffer-name (persp-other-buffer)))) + ;; NB: This intentionally calls completing-read instead of + ;; persp-interactive-completion-function, since it is expected to have + ;; been replaced by a completion framework. (completing-read (format "Switch to buffer%s: " (if other (format " (default %s)" other) @@ -1137,12 +1143,18 @@ perspective beginning with the given letter." ;; built-in completing-read (e.g., Selectrum). ;;;###autoload (defun persp-kill-buffer* (buffer-or-name) - "Like `kill-buffer', restricted to the current perspective." + "Like `kill-buffer', restricted to the current perspective. +This respects ido-ignore-buffers, since we automatically add +buffer filtering to ido-mode already (see use of +PERSP-SET-IDO-BUFFERS)." (interactive (list (if (or current-prefix-arg (not persp-mode)) (let ((read-buffer-function nil)) (read-buffer "Kill buffer: " (current-buffer))) + ;; NB: This intentionally calls completing-read instead of + ;; persp-interactive-completion-function, since it is expected to have + ;; been replaced by a completion framework. (completing-read (format "Kill buffer (default %s): " (buffer-name (current-buffer))) (persp-current-buffer-names) nil nil nil nil |
