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

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

问题描述

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

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

做一些类似 emacs --script -Q 的事情<arguments> 绝对不会传递 emacs 中使用的参数.那怎么办呢?

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

推荐答案

基于您的评论 Rafael Ibraim 的回答,我正在添加第二个答案,因为我认为我的第一个答案也误解了您的问题(如果是这样,您可能希望编辑问题以提供说明).

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).

您可以使用空"参数的常用方法来阻止 Emacs 处理命令行参数:--

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

所以如果你运行这个:

emacs --script (filename) -- -Q

Emacs 不会吃掉 -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天全站免登陆