To run an elisp file hello.el with emacs in cli, do simply

$ emacs --script hello.el

However, a naive try for emacsclient fails, as --script is not an option of emacsclient.

$ emacsclient --script
emacsclient: unrecognized option '--script'
Try 'emacsclient --help' for more information

Question: What is a good practice to evaluate an elisp file by a running emacsclient?

  • 1
    emacsclient -e "(load \"hello.el\")" ?
    – gigiair
    Apr 22, 2020 at 18:03
  • It worked.. sorry for the stupid question. Is it worth an answer?
    – Student
    Apr 22, 2020 at 18:10
  • It is not a stupid question. It can help some. Helping is never stupid.
    – gigiair
    Apr 22, 2020 at 18:21
  • Thank you. I hope it will help more people.
    – Student
    Apr 22, 2020 at 18:35
  • Please don't use tag elisp for questions about using Elisp. It's for questions about the nature of the language itself, compared to other languages, especially other Lisp dialects. Thx.
    – Drew
    Apr 22, 2020 at 18:43

1 Answer 1


emacsclient -e '(load "hello.el")'


Your Answer

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

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