(defun foo () ...)
syntax.
defcommand
syntax, as in the examples below.
(defcommand test (foo bar) ((:string "How you're going to prompt for variable foo: ") (:number "How you want to prompt for variable bar: ")) "This command is a test" (body...)) (defcommand test2 () () "This is also a test" (body...)) (defcommand title (args) (interactive-args) "Doc string" (body...))
So basically, inside the first set of parentheses after the function name, you specify what (if any) arguments will be passed to the command. The second set of parentheses tells StumpWM how to get those arguments if they’re not explicitly passed to the command. For example,
((:string "What do you want to do: "))
will read a string from the input the user provides. The quoted text is the prompt the user will see. Of course, if you were to, say, call the command test, as defined above, from another piece of code, it wouldn’t give the prompt as long as you fed it arguments.
defcommand
syntax are
available both to be called with C-t ; and from within other lisp
programs, as though they had been defun-ned (which, in fact, they
have).