8
如何指定一個具有可選數字前綴的函數,如果沒有,它會提示輸入數字?基本上goto-line的行爲如何?帶可選數字前綴的emacs交互功能
(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
那麼我該如何工作? 謝謝
FWIW,如果您想提示輸入「N」,只需在N之後加上提示文字; '(交互式「NType:」)'。 – jrockway 2010-02-07 01:09:14