传递参数到elisp脚本。再次 [英] Passing arguments to elisp script. Again

查看:93
本文介绍了传递参数到elisp脚本。再次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何传递参数-q -d -Q -t -L -fg -bg --color等?



执行类似 emacs --script -Q< scriptname> < arguments> definetely不会传递在emacs中使用的参数。那么怎么做呢?

解决方案

根据你的 comment Rafael Ibraim的答案,我补充说,第二个答案,因为我认为我的第一个答案也是错误地解释你的问题(如果是这样,您可能希望编辑该问题以提供澄清)。



您可以使用通常的空参数来防止Emacs处理命令行参数: -



所以如果你这样运行:



emacs --script(filename) - -Q



Emacs不会吃$ c> -Q 参数(或实际上是 - ),并且您的脚本将可用。您可以使用以下脚本轻松地验证:

 (print argv)
/ pre>

How can I pass arguments -q -d -Q -t -L -fg -bg --color etc?

Doing something like emacs --script -Q <scriptname> <arguments> definetely will not pass arguments, which are used in emacs. So how to do it?

解决方案

Based on your comment on Rafael Ibraim's answer, I'm adding this second answer, as I think my first answer is also mis-interpreting your question (and if so, you may wish to edit the question to provide clarification).

You can prevent Emacs from processing command line arguments using the usual approach of an 'empty' argument: --

So if you run this:

emacs --script (filename) -- -Q

Emacs will not eat the -Q argument (or the -- in fact), and it will be available to your script. You can easily verify this with the following script:

(print argv)

这篇关于传递参数到elisp脚本。再次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆