diff --git a/source/mode/prompt-buffer.lisp b/source/mode/prompt-buffer.lisp index 61972910ec6a..40847197c891 100644 --- a/source/mode/prompt-buffer.lisp +++ b/source/mode/prompt-buffer.lisp @@ -327,7 +327,6 @@ current unmarked selection." (t (documentation action 'function))))) ""))))) -(define-class action-source (prompter:source) ;; TODO: Should return-actions be commands? For now, they can be either ;; commands or symbols. (defun make-selection-action-suggestion (action &optional source input) @@ -339,23 +338,24 @@ current unmarked selection." ;; :attributes )) +(define-class return-action-source (prompter:source) ((prompter:name "List of return-actions") (prompter:constructor (prompt-buffer-return-actions)) (prompter:suggestion-maker 'make-action-suggestion))) - "Prompt for an action to run over PROMPT-BUFFER selection." (define-class selection-action-source (prompter:source) ((prompter:name "List of selection-actions") (prompter:constructor (prompt-buffer-selection-actions)) (prompter:suggestion-maker 'make-selection-action-suggestion))) + (define-command-prompt return-marks-action (prompt-buffer) + "Prompt for an action to run over PROMPT-BUFFER `prompter:marks'." (if (equal (mapcar #'type-of (prompter:sources (current-prompt-buffer))) - '(action-source)) + '(return-action-source)) (echo "Already displaying return-actions of previous prompt buffer.") - (let ((action (prompt1 :prompt "Action to run on selection" - :sources 'action-source))) - (when action - (prompter:return-selection prompt-buffer action))))) + (alex:when-let ((action (prompt1 :prompt "Action to run on selection" + :sources 'return-action-source))) + (prompter:return-selection prompt-buffer action)))) (define-command-prompt set-selection-action (prompt-buffer) "Run one of `prompter:selection-actions' without closing PROMPT-BUFFER."