Questions tagged [batch-mode]

Running Emacs non-interactively via the `--batch` command-line option.

Filter by
Sorted by
Tagged with
0
votes
2answers
59 views

How to use emacs packages in emacs lisp scripting

I have the following emacs script from here #!/usr/local/bin/emacs --script ;;; rcat --- cat ;;; Commentary: ;;; cat function in elisp ;;; Code: ;;-*- mode: emacs-lisp;-*- (defun process (string) ...
0
votes
1answer
162 views

Batch convert local HTML webpages to plain text

Here is my zsh code function eweb() { emacsclient -t --eval "(eww-open-file \"$1\")" "(save-buffer \"$2\")" } There are two parameters, the first is the local webpage filename, for example, ./1....
4
votes
1answer
282 views

How can I export an org file to PDF in batch mode and have source code blocks executed?

On Debian Stretch, I'm trying to export this file called test.org # -*- org-confirm-babel-evaluate: nil -*- #+OPTIONS: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline #+OPTIONS: author:t c:nil ...
2
votes
2answers
121 views

indentation (with multiline comments) in batch processing

i'm trying to indent a couple of C++-files (and untabify them; and remove trailing whitespace), so i thought about using emacs in batch mode. Since I'm pretty much a noob when it comes to elpa (or ...
2
votes
1answer
151 views

Obtaining a backtrace on batch invocation of Emacs?

The only way I know of printing a backtrace for errors in batch invocation of Emacs is by setting debug-on-error inline like so: $ emacs -batch --eval "(setq debug-on-error t)" -f "my/foo-function" ...
0
votes
1answer
97 views

script to Ediff two files in running gui Emacs?

I'm putting together a presentation that involves some live demos in the terminal. In one of the demos, I run a shell script that takes an input file, runs it through an Awk script, and generates a ...
0
votes
1answer
96 views

Running flyspell on Latex files in batch-mode

I'd like to run flyspell on several Latex-files in the same directory and output all the words which are misspelled.
2
votes
1answer
288 views

Using org in emacs batch mode

I'd like to export an org file to LaTeX from the command line. I have created a file export.el with the following contents (simplified to reproduce the problem): (require 'org) (when (not (assoc "...
3
votes
0answers
58 views

Loading a theme and fontifying in batch mode

Loading a theme in batch mode seems to not set face attributes: $ emacs -Q --eval "(load-theme 'tango t)" \ --eval "(prin1 (face-attribute 'font-lock-keyword-face :foreground)))" "#346604" ...
0
votes
1answer
597 views

Run batch file from Emacs

So, I've made a little batch file that simply compiles all the code I need and moves it to their right places. I've seen some people using the compile function to launch something like the batch file ...
1
vote
0answers
44 views

Why does end-of-line behave differently in --batch?

I have an elisp script that behaves differently between an interactive Emacs session and running Emacs with --batch. (defun call-fn-in-let (unused) (let (xx) (let (yy) (split-string "foo" ...
2
votes
1answer
132 views

Can I print output to stderr in batch mode WITHOUT a trailing newline?

In emacs --batch (also, emacs --script), (message "My Message") will print "My Message" to standard error (file descriptor 2) along with a trailing newline. What if I don't want the newline? I ...
0
votes
0answers
35 views

how do I evaluate elisp in a certain buffer from batch mode?

I want to evaluate some elisp with batch mode, but it only works in a certain (type-of) buffer. Specifically emacsclient --eval "(emms-playlist-mode-play-smart)" This command only works on an emms-...
1
vote
1answer
68 views

Readline emulation in batch mode

I wrote an interpreter by leveraging --batch, read-from-minibuffer and princ. Now, reading input is relatively limited, you can type consecutive characters, erase the last character with <...
6
votes
1answer
107 views

How to know if Emacs is running in batch mode

I have one file that needs to behave differently depending on whether Emacs is running in batch mode (non interactive) or normal mode. (if batch-mode-t a-func b-func) How can I detect this?
3
votes
1answer
300 views

In emacs batch mode, how to evaluate/tangle a named source block in an org-mode file?

I have a org-mode file (test.org) as below: #+NAME: my-tangle-to-file #+BEGIN_SRC sh :tangle my_tangle_file.sh :dir /tmp :shebang "#!/usr/bin/env bash" me=$(basename $(test -L "$0" && ...
2
votes
1answer
330 views

How can I export many org documents to ASCII?

I have a directory ~/foo/ with hundreds of org documents among other types of files. I want to export each org file to ASCII. The only way I know how to do this is to follow the following procedure ...
10
votes
1answer
2k views

Export an org-mode file as a PDF via command line?

What command-line arguments do I use to get Emacs to export an org-mode file to a Beamer PDF? (I want to create a Makefile that produces a PDF when the user runs make.) I tried following this answer ...