unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Artur Hefczyc <DONTkobit@SPAMplusnet.MEpl>
Subject: Re: Cool and Useful LISP for the .emacs file
Date: Thu, 13 Nov 2003 22:54:12 +0300	[thread overview]
Message-ID: <873ccs59jv.fsf@141-moc-9.acn.waw.pl> (raw)
In-Reply-To: 873cctih28.fsf@thalassa.informatimago.com

Pascal Bourguignon <spam@thalassa.informatimago.com> writes:
>> > Kin Cho <kin@techie.com> writes:
>> >> I used to carry around a collection of shell, sed, awk, and perl
>> >> scripts to do various text/file/directory processing, as well as
>> >> doing cvs/rcs stuff, running compilation and gdb etc...  Now I do
>> >> (almost) all these things in elisp.
>> > 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?
> No.
> emacs IS NOT big.
> $ ls -l emacs perl
> -rwxr-xr-t    1 pascal   regular   4433296 2003-11-12 19:08 emacs*
> -rwxr-xr-x    1 pascal   regular   1113248 2003-11-12 19:08 perl*
> emacs is already in core memory so forking additionnal emacs processes
> does not cost anything significant.
> Starting a script  in perl or in emacs takes the  same time. (Any time
> below 0.7 s IS the same time).
> <snip>

Thank you all for your comments. They are very valuable for me.
I am emacs user for many years but not an expert of elisp or any other
Lisp implementation.
So I don't care whether it is efficient or not, fast or slow, I just
want to learn lisp and become good in it. Therefore I want to start
using it whenever possible.

At the moment, with emacs-cvs ver. 21.3.50 using emacs as script
interpreter is pretty easy without any additional tricks. Just put to
your first line of script file:

#!/use/bin/emacs --script

;; And after that you can use regular elisp code:
(princ "Hello world!")
;; end.

Of course it doesn't work with earlier versions and does _not_ work
construction presented below:

#!/use/bin/emacs --batch -l $0

because for some reason emacs thinks that the whole parameter string:
"--batch -l $0" is one option - unknown for him.

Artur
-- 
Artur Hefczyc, Open Source Developer:
http://www.geotools.org/
http://generguide.sourceforge.net/
http://wttools.sourceforge.net/
http://maven-plugins.sourceforge.net/

  reply	other threads:[~2003-11-13 19:54 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3343.1068146343.21628.help-gnu-emacs@gnu.org>
2003-11-06 23:45 ` Cool and Useful LISP for the .emacs file Kevin Rodgers
2003-11-07  4:10 ` Bruce Ingalls
2003-11-07  9:08 ` roodwriter
2003-11-07 16:58   ` Kevin Rodgers
2003-11-07 18:35     ` roodwriter
2003-11-08 18:01   ` roodwriter
2003-11-11 10:48     ` Oliver Scholz
2003-11-07 11:27 ` Gareth Rees
2003-11-07 14:06   ` Adam Hardy
     [not found]   ` <mailman.3403.1068214062.21628.help-gnu-emacs@gnu.org>
2003-11-07 14:28     ` David Kastrup
2003-11-07 16:54   ` Dan Anderson
2003-11-07 17:19   ` Rob Thorpe
     [not found]   ` <mailman.0.1068227823.2005.help-gnu-emacs@gnu.org>
2003-11-07 17:45     ` Jody M. Klymak
2003-11-07 18:20       ` Kevin Rodgers
2003-11-07 19:37       ` Dan Anderson
2003-11-08  1:28       ` Thien-Thi Nguyen
     [not found]       ` <mailman.11.1068237562.2005.help-gnu-emacs@gnu.org>
2003-11-07 22:17         ` Jody M. Klymak
2003-11-08  1:22           ` Jesper Harder
2003-11-08  3:23           ` Kin Cho
2003-11-08 10:34             ` Artur Hefczyc
2003-11-08 13:20               ` Thien-Thi Nguyen
2003-11-08 20:06               ` David Kastrup
2003-11-08 21:45                 ` Artur Hefczyc
2003-11-08 22:02                   ` Artur Hefczyc
2003-11-09  3:20               ` Kin Cho
2003-11-12  5:15               ` David Masterson
2003-11-12  8:12                 ` Matthew Kennedy
2003-11-12 18:21                 ` Pascal Bourguignon
2003-11-13 19:54                   ` Artur Hefczyc [this message]
2003-11-23  8:08               ` Tim X
2003-11-08 23:15           ` Joe Fineman
2003-11-10 15:59           ` Stefan Monnier
2003-11-10 20:58             ` Thien-Thi Nguyen
2003-11-10 21:00             ` Burton Samograd
2003-11-11 10:34               ` Alan Mackenzie
2003-11-11 14:32                 ` Jesper Harder
2003-11-11 17:00                   ` Burton Samograd
2003-11-11 17:00                 ` Burton Samograd
2003-11-11 20:04                   ` Alan Mackenzie
2003-11-08 10:15         ` Oliver Scholz
2003-11-08 12:03           ` Orm Finnendahl
2003-11-08 14:09       ` Ole Laursen
2003-11-23  8:02       ` Tim X
2003-12-07 15:56       ` Kai Grossjohann
2003-11-07 18:09 ` Reiner Steib
2003-11-07 18:37   ` lawrence mitchell
2003-11-08 17:06     ` Reiner Steib
2003-11-07 23:41 ` Edward Dodge
2003-11-10 16:04   ` Stefan Monnier
2003-11-10 21:17     ` kgold
2003-11-11 10:43       ` Alan Mackenzie
2003-11-11 15:39         ` Eli Zaretskii
2003-11-11 15:52         ` Stefan Monnier
2003-11-11 17:35           ` Thien-Thi Nguyen
2003-11-12  7:25             ` Lars Brinkhoff
     [not found]             ` <mailman.197.1068625639.2005.help-gnu-emacs@gnu.org>
2003-11-12 10:22               ` Colin Marquardt
2003-11-12 11:15                 ` David Kastrup
2003-11-12 13:47                   ` Stefan Monnier
     [not found] <E1AIRNX-0002YI-H9@monty-python.gnu.org>
2003-11-08 22:01 ` Joe Corneli
     [not found] <E1AI57v-00032q-9p@monty-python.gnu.org>
2003-11-07 14:31 ` Joe Corneli
2003-11-06 19:18 Dan Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873ccs59jv.fsf@141-moc-9.acn.waw.pl \
    --to=dontkobit@spamplusnet.mepl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).