1
#!/usr/bin/clisp

(write-line "Hello World")

If I put this in a script it prints Hello World as expected.

What I'm wondering is there a way to use emacs-nox instead of clisp in the shebang and have it work the same way.

5
  • What's emacs-nox? What does this have to do with using Elisp files - where's the Elisp file in what you wrote?
    – Drew
    Commented Jun 29, 2020 at 20:33
  • @Drew emacs-nox is Emacs without the graphical interface. It only runs in a terminal. I thought that was standard, but maybe the name emacs-nox is specific to Debian/Ubuntu.
    – Tyler
    Commented Jun 29, 2020 at 20:42
  • Maybe it's well known. But saying what it is in the question might help some readers. Please put all relevant info in the question itself, as comments can be deleted at any time. Thx.
    – Drew
    Commented Jun 29, 2020 at 22:31
  • 1
    The best thing to read: lunaryorn.com/blog/emacs-script-pitfalls
    – phils
    Commented Jun 30, 2020 at 6:00
  • Duplicate Q&A at S.O.: stackoverflow.com/questions/10210742/…
    – phils
    Commented Jun 30, 2020 at 6:01

1 Answer 1

1

You can use the --script flag to run an elisp file as a script:

 #!/usr/bin/emacs --script

<-- Insert your elisp program here -->

See the manual page on Initial Options for more details.

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.