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?

8

You can look at the variable noninteractive, for example:

(if noninteractive
    a
  b)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.