7
如何将 Elisp 函数转换成命令
source link: https://www.lujun9972.win/blog/2019/07/25/%E5%A6%82%E4%BD%95%E5%B0%86-elisp-%E5%87%BD%E6%95%B0%E8%BD%AC%E6%8D%A2%E6%88%90%E5%91%BD%E4%BB%A4/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
如何将 Elisp 函数转换成命令
如何将 Elisp 函数转换成命令
如何在不重定义原函数的情况下将只转换成命令?
有一种很 Hack 的方法,那就是设置该 symbol 的 interactive-form
属性,比如像这样:
(put 'sleep-for 'interactive-form '(interactive "nSleep for: "))
就能把 sleep-for
变成可以手工执行的命令了。
更详细的说明可以参见 Standard Symbol Properties
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK