Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the use of emacs -batch

Tags:

emacs

I'm trying to understand the difference between this two lines of code:

emacs --batch -l package.el

emacs -l package.el

Thanks a lot. Why -batch is needed here?

like image 575
Charles Lu Avatar asked Sep 01 '25 18:09

Charles Lu


1 Answers

The -batch command line option stops Emacs from opening an editor window. This allows you to write scripts in Emacs Lisp, scripts that you otherwise would have used Ruby, Perl, or Python for.

Just out of the hat, an example that use the -batch option is e2ansi, a package that allows the more and less command to render a file with colors using ANSI sequences, based on the syntax highlighting Emacs performs. Clearly, this would not have worked if Emacs would have opened up a window when started.

like image 163
Lindydancer Avatar answered Sep 05 '25 22:09

Lindydancer