我想根据用户对第一个问题的回答,向其询问第二个问题。
所以我需要一种测试输入值的方法:
但是。
(defun something (a b)
(interactive
(list
(read-number "First num: ")
(read-number "Second num: ")))
(message "a is %s and b is %s" a b))
所以我需要一种测试输入值的方法:
(defun something-else (a &optional b)
(interactive
(list
(read-number "First num: ")
(if (< a 2)
(read-number "Second num: "))))
(message "a is %s" a))
但是。
if: Symbol's value as variable is void: a
问题:如何以真正互动的方式使用 interactive
?
setq
更易读。另一个答案已经在使用let*
了。 - knarf