4

I would like to:

  1. run an emacs function from the shell
  2. in a standard emacs session (configured as if it was run in an interactive session)
  3. with a certain file in the active buffer

So I would like to do something like:

emacs --function org-beamer-export-to-pdf --file my-presentation.org

Bonus points if I can run it with the emacsclient, connecting to an already running emacs server.

Dan
  • 32,584
  • 6
  • 98
  • 168
blueFast
  • 295
  • 2
  • 8

1 Answers1

7

This should do what you want. If you don't have the file open, you may need to replace the switch-to-buffer function to something that opens the file.

emacsclient -e '(progn (switch-to-buffer "my-presentation.org") (org-beamer-export-to-pdf))'
Justin Abrahms
  • 341
  • 1
  • 10