isearch `interactive` 规范使用特殊字符进行用户输入

isearch `interactive` spec uses special characters for user input

(defun isearch-forward (&optional regexp-p no-recursive-edit)
  (interactive "P\np")
  (isearch-mode t (not (null regexp-p)) nil (not no-recursive-edit)))

特殊字符 p(小写字母 p)作为交互函数的参数有什么作用?第一个字符 P(大写)是否表示 regexp-p 值来自全局变量定义。

再说一次,用户输入的单词作为 regexp-p 传递,no-recursive-edit 如何获取其值?

第一个字母P代表原始前缀参数,即变量current-prefix-arg的值。这绑定到第一个形式参数,在本例中为 regexp-p

它与第二个字母 p 之间用 \n(换行符)隔开。这是 interactive 规范中分隔输入的约定。

第二个字母p代表数字前缀参数,即(prefix-numeric-value current-prefix-arg)的值。这绑定到第二个形式参数,在本例中为 no-recursive-edit

在 Elisp 手册中阅读有关此内容,节点 Interactive Codes