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

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

Re: Cool and Useful LISP for the .emacs file


From: Matthew Kennedy
Subject: Re: Cool and Useful LISP for the .emacs file
Date: Wed, 12 Nov 2003 08:12:20 GMT
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux)

David Masterson <dsm@rawbw.com> writes:

>>>>>> Artur Hefczyc writes:
>

[...]

>> I like this idea! I would like to use elisp as scripting language
>> also. However I would like to know if it is possible to use it that
>> way. I mean, lets assume I create elisp script to update my Linux box
>> system with new releases of some packages.
>
>> Is it possible to run it from command line like all other scripts,
>> bash, perl etc.?
>
>> I mean file script starting from:
>> #!/usr/bin/emacs
>
>> Or any other elisp interpreter?
>
> Given how big Emacs is, I would think that it would be best to start
> emacs in background (say, from your .login) and then use something
> like gnudoit or emacsclient to send your elisp to the background
> Emacs.  Done correctly, I would think that it would execute your
> scripts much faster, no?

How about using:

,----[ C-h f dump-emacs RET ]
| dump-emacs is a built-in function.
| (dump-emacs FILENAME SYMFILE)
| 
| Dump current state of Emacs into executable file FILENAME.
| Take symbols from SYMFILE (presumably the file you executed to run Emacs).
| This is used in the file `loadup.el' when building Emacs.
| 
| You must run Emacs in batch mode in order to dump it.
`----

This way you can have your scripts compiled and dumped into a
standalone executable.  Its very fast[1].

If you don't like that, try placing the following at the top of your
emacs lisp scripts, and then chmod +x the script.

:;exec emacs --batch --no-init-file --no-site-file  --load $0 --func main $* 

Footnotes: 
[1]  http://www.emacswiki.org/cgi-bin/wiki/DumpingEmacs

-- 
Matthew Kennedy


reply via email to

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