9

How do I evaluate multiple functions simultaneously using emacs --eval on command line? For example I want to combine the followings in a single command:

emacs --eval "(toggle-frame-maximized)"
emacs --eval "(sr-speedbar-toggle)"

I tried to wrap them together but all attempts failed. How do I do this?

1 Answer 1

15

Simply use (progn ). This should address your question:

emacs --eval "(progn (toggle-frame-maximized) (sr-speedbar-toggle))"

Please note that this does not execute the commands simultaneously (as you requested). It executes one command after another.

2
  • Or emacs -f toggle-frame-maximized -f sr-speedbar-toggle, and maybe multiple --eval works as well?
    – xuchunyang
    Commented Dec 22, 2016 at 4:45
  • What should we do for the multiple commands?
    – alper
    Commented Jul 14, 2021 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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