help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Emacs Lisp for script writing


From: David Engster
Subject: Re: Using Emacs Lisp for script writing
Date: Sat, 19 Dec 2009 11:02:22 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

Andreas Politz <address@hidden> writes:
> Cecil Westerhof <address@hidden> writes:
>
>> I already use 'emacs -batch' for scripting where no user input is used,
>> but I would like to use it also for interactive scripting. Until now I
>> did not find any usable information about this. Anybody using Emacs for
>> interactive scripts?
>
> No, but it should be noted, that this is not very difficult :
>
> $ emacs -Q -batch -eval '(yes-or-no-p "Want some cookies ?")'

You can also use the '--script' option in a shebang line:

----------------- test.sh -----------------
#!/usr/bin/emacs --script

(if (yes-or-no-p "Choose ")
  (message "You said yes")
 (message "You said no"))
-------------------------------------------

I use emacs regularly for writing scripts, since with its thousands of
packages you have a huge library readily available.

-David





reply via email to

[Prev in Thread] Current Thread [Next in Thread]