[英]How to understand this form (interactive (list 'interactive)) in Emacs Lisp?
我找到了一些這樣的代碼,
1 (require 'cl-lib)
2 (require 'company)
3
4 (defun company-sample-backend (command &optional arg &rest ignored)
5 (interactive (list 'interactive))
...
)
但如何理解第5行?
interactive
聲明的參數是字符串或elisp表單,在計算時,它返回函數的參數值列表 。
在這種情況下,聲明使用返回列表的表單。 表格是:
(list 'interactive)
這是一個返回單個項目列表的表單,是interactive
符號
該函數的參數列表是:
(command &optional arg &rest ignored)
因此,當以交互方式調用此函數時,參數command
將具有interactive
值
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.