FUEL: Add prefix key behavior to fuel-test-vocab so that it is similar to other FUEL interactive functions.

db4
Erik Charlebois 2010-02-21 03:35:15 -08:00
parent ffddca36b7
commit a452966af9
1 changed files with 9 additions and 6 deletions

View File

@ -192,12 +192,15 @@ With prefix, you're teletransported to the listener's buffer."
(comint-send-string nil "\"Refreshing loaded vocabs...\" write nl flush")
(comint-send-string nil " refresh-all \"Done!\" write nl flush\n")))
(defun fuel-test-vocab (vocab)
"Run the unit tests for the specified vocabulary."
(interactive (list (fuel-completion--read-vocab nil (fuel-syntax--current-vocab))))
(comint-send-string (fuel-listener--process)
(concat "\"" vocab "\" reload nl flush\n"
"\"" vocab "\" test nl flush\n")))
(defun fuel-test-vocab (&optional arg)
"Run the unit tests for the current vocabulary. With prefix argument, ask for
the vocabulary name."
(interactive "P")
(let* ((vocab (or (and (not arg) (fuel-syntax--current-vocab))
(fuel-completion--read-vocab nil))))
(comint-send-string (fuel-listener--process)
(concat "\"" vocab "\" reload nl flush\n"
"\"" vocab "\" test nl flush\n"))))
;;; Completion support