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
    Commented Apr 22, 2020 at 18:03
  • It worked.. sorry for the stupid question. Is it worth an answer?
    – Student
    Commented Apr 22, 2020 at 18:10
  • It is not a stupid question. It can help some. Helping is never stupid.
    – gigiair
    Commented Apr 22, 2020 at 18:21
  • Thank you. I hope it will help more people.
    – Student
    Commented 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
    Commented 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 you have read our privacy policy.

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