7

如何将 Elisp 函数转换成命令

 3 years ago
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.
neoserver,ios ssh client
如何将 Elisp 函数转换成命令

如何将 Elisp 函数转换成命令

http://mbork.pl/2019-07-01_Syntax-aware_navigation,_keyboard_macros,_sleeping_Emacs_and_interactive_functions 上看到的,惊呆了

如何在不重定义原函数的情况下将只转换成命令?

有一种很 Hack 的方法,那就是设置该 symbol 的 interactive-form 属性,比如像这样:

(put 'sleep-for 'interactive-form
     '(interactive "nSleep for: "))

就能把 sleep-for 变成可以手工执行的命令了。

更详细的说明可以参见 Standard Symbol Properties

2019-07-25 2019-07-25 Emacs之怒 lujun9972

Related Issues not found

Please contact @lujun9972 to initialize the comment

Generated by Emacs 27.x(Org mode 9.x)

Copyright © 2014 - 2021 lujun9972   -   Powered by EGO
Themed with emacs_love


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK