Search code examples
elispemacs24

Command sequence in 1 block in elisp


How can i run multiple commands one after another in a single block in elisp. something like this but not precisely,

((message "first message")
  (message "second message"))

Output must be,

first message
second message

Solution

  • (progn BODY...) will evaluate BODY forms sequentially and return value of last one. (from emacs help)

    (progn
     (message "first message")
     (message "second message"))