如何指定具有可选数字前缀的函数,如果没有,它会提示输入数字?基本上 goto-line 的行为如何?
(defun my-function(&optional n)
; I have tried
(interactive "N") ; reads string, no prompt
(interactive "p") ; defaults to one
(interactive (if (not n) (read-number "N: "))) ; runtime error
那么我该如何工作呢?谢谢