在 Emacs 23 和 24 中,以下内容可以正常工作:
在Emacs 22中,我遇到了以下错误:
(defun foo (&optional arg)
(interactive "^p")
(message "arg is %i" arg))
在Emacs 22中,我遇到了以下错误:
我尝试了下面这个方法:
交互调用字符串中的无效控制字母“^”(136)
(defun foo (&optional arg)
(interactive (concat (if (> emacs-major-version 22) "^" "") "p"))
(message "arg is %i" arg))
但我得到了以下错误信息:
Wrong type argument: listp, "^p"
在Emacs 23或24中使用^
的最佳方法是什么,但在Emacs 22中不能使用?
(fboundp 'handle-shift-selection)
而不是(> emacs-major-version 22)
。 - Stefan(interactive)
的功能?我不想去弄清楚如何重新实现(interactive "^NEnter a number: ")
。看一下调用交互式函数的Emacs源码,我猜它没有提供这样的功能。 - Richard Hansen#+handle-shift-selection "^p" #-handle-shift-selection "p"
。 - sds