Is there a way to open a file on emacs, execute a command and quit, quietly? I tried

emacs file --eval '(progn (cmd) (kill-emacs))' 

But if I execute this, emacs shows up briefly before quitting. Is there a better way?


Consider using the batch mode to run some commands on a file. It's described in (emacs) Initial Options.

| improve this answer | |
  • Is there a way to make emacs load the int file in batch mode? – Tohiko Sep 12 '17 at 16:16
  • You can just use the load function to do that, but keep in mind that it will make your scripts depend on your configuration, which might not be what you want to accomplish. – user12563 Sep 12 '17 at 16:43

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.