6

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?

Scott Weldon
  • 2,695
  • 1
  • 17
  • 31
netawater
  • 245
  • 1
  • 6
  • 1
    See [this S.O. thread](http://stackoverflow.com/questions/25194197/how-can-i-detect-whether-emacs-is-running-in-batch-mode). – Dan Feb 26 '16 at 09:41

1 Answers1

8

You can look at the variable noninteractive, for example:

(if noninteractive
    a
  b)
Lindydancer
  • 6,095
  • 1
  • 13
  • 25