Emacs以批处理模式htmlize? [英] Emacs htmlize in batch mode?

查看:262
本文介绍了Emacs以批处理模式htmlize?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢在emacs中使用htmlize-file将clojure源文件转换为html。

I like to use htmlize-file in emacs to turn clojure source files into html.

我想从linux命令行使用它,

I want to use it from the linux command line instead, or programmatically from clojure itself.

我尝试了

$ emacs --eval "(htmlize-file \"/home/john/file.clj\" ) (kill-emacs)"


$ b b

and

$ emacs -batch --eval "(htmlize-file \"/home/john/file.clj\" )"

两个都有,注意。

第一个打开一个X窗口,这似乎有点不雅,但它做了完全相同的突出显示,我在缓冲区,这是我想要的。

The first opens an X-window, which seems a bit inelegant, but it does do exactly the same highlighting that I'd see in a buffer, which is what I want.

第二个在批处理模式下工作,但是它所做的唯一的语法是斜体字符串。我假设它不加载clojure模式或我最喜欢的配色方案。

The second one works in batch mode, but the only syntax highlighting that it does is to italicize the strings. I hypothesise that it's not loading clojure-mode or my favourite colour scheme.

任何人都能找到一种方法获得第二个版本给出与第一个相同的结果?
他们似乎在加载我的.emacs文件,然后再评估(htmli ....)位。

Can anyone find a way of getting the second version to give the same results as the first? They both seem to load my .emacs file before evaling the (htmli....) bit.

此外,有没有办法将命令发送到已经运行的emacs?

Also, is there any way to send the commands to an already running emacs? And thus save the startup time?

推荐答案

是否使用-nw中的第一个工作?这应该防止X窗口被打开,但是仍然应该有足够的emacs的'GUI'部分存在以能够初始化面系统。它仍然不如-batch那样优雅(如果从非终端进程运行,例如crontab,它会失败),但是它不那么刺激了。

Does using the first one with -nw work? that should prevent an X window being opened, but there should still be enough of the 'GUI' part of emacs present to be able to initialise the faces system. It's still not as elegant as -batch (it'll fail if run from a non-terminal process, eg crontab) but it'll be less irritating.

这篇关于Emacs以批处理模式htmlize?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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