如何以编程方式在Edwin中为MIT-Scheme调用M-x函数? [英] how to programmatically call M-x functions in Edwin for MIT-Scheme?
问题描述
我在MIT方案中使用了Edwin编辑器,并且由于默认字体很小,所以我做了M-x set-font
然后选择
I'm using the Edwin editor with MIT-scheme, and because the default font size is so small, I do M-x set-font
and then choose
-adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-1
使字体变大.效果很好,但是当我尝试放
to make the font bigger. This works fine, but when I try to put
(set-font "-adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-1")
在我的~/.edwin
中,它抱怨Unbound variable: set-font
.
在emacs中,通常可以在Elisp中以编程方式直接调用M-x
中的交互功能,但显然在这里不是这样.我试着通过阅读带有"info mit-scheme-user"的手册来阅读有关如何自定义Edwin的更多信息,但是Edwin章节专门说了
In emacs, interactive functions from M-x
can usually be straightforwardly called programmatically in Elisp, but apparently not so here. I tried reading more about how to customize Edwin by looking at the manual with `info mit-scheme-user', but the Edwin chapter specifically says
本手册不讨论自定义Edwin.
This manual does not discuss customization of Edwin.
如何通过编程方式调用set-font
?
How do I call set-font
programmatically?
推荐答案
显然,Edwin命令不是过程,不能直接在Scheme代码中调用.但是,通过一个简单的修复程序就可以实现这一点,只需将其包装在ref-command
宏中即可:
Apparently, Edwin commands are not procedures, and cannot be called directly in Scheme code. However, a simple fix enables this, simply wrap it with the ref-command
macro:
`((ref-command set-font) "-adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-1")`
Edwin命令不是过程(与GNU Emacs不同).埃德温(Edwin)命令 是一个具有不寻常名称的特殊对象.如果您想调用一个 程序中的命令,则必须使用REF-COMMAND宏.为了 例如,要启动shell缓冲区,就像键入"M-x shell"一样:
((ref-command shell) #t)
Edwin commands aren't procedures (unlike GNU Emacs). An Edwin command is a special object with an unusual name. If you want to invoke a command from a program you must use the REF-COMMAND macro. For example, to start a shell buffer as if you had typed "M-x shell":
((ref-command shell) #t)
这篇关于如何以编程方式在Edwin中为MIT-Scheme调用M-x函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!