how to make emacs lisp take argv from shell command line?
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: gnu.emacs.help, comp.lang.lisp
From:
Xah Lee <xah... @gmail.com>
Date: Thu, 21 Jul 2011 08:03:49 -0700 (PDT)
Local: Thurs, Jul 21 2011 11:03 am
Subject: how to make emacs lisp take argv from shell command line?
i'm writing a text processing emacs lisp script. To be run like this:
emacs --script process_log.el filepath
how to make the script take the argument? i.e. that filepath?
e.g. in perl, python, it's typically argv[1] etc.
Thanks.
Xah
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: gnu.emacs.help, comp.lang.lisp
From:
Piotr Chamera <piotr_cham... @poczta.onet.pl>
Date: Thu, 21 Jul 2011 17:31:38 +0200
Local: Thurs, Jul 21 2011 11:31 am
Subject: Re: how to make emacs lisp take argv from shell command line?
W dniu 2011-07-21 17:03, Xah Lee pisze:
> i'm writing a text processing emacs lisp script. To be run like this:
> emacs --script process_log.el filepath
> how to make the script take the argument? i.e. that filepath?
> e.g. in perl, python, it's typically argv[1] etc.
maybe: command-line-args, i can't check it now.
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: gnu.emacs.help, comp.lang.lisp
From:
Swami Tota Ram Shankar <tota_... @india.com>
Date: Thu, 21 Jul 2011 13:46:28 -0700 (PDT)
Local: Thurs, Jul 21 2011 4:46 pm
Subject: Re: how to make emacs lisp take argv from shell command line?
On Jul 21, 8:31 am, Piotr Chamera <piotr_cham
... @poczta.onet.pl>
wrote:
> W dniu 2011-07-21 17:03, Xah Lee pisze:
> > i'm writing a text processing emacs lisp script. To be run like this:
> > emacs --script process_log.el filepath
Can you give a small example of what the script file would look like ?
Is it a lambda or a progn for the main program ?
> > how to make the script take the argument? i.e. that filepath?
> > e.g. in perl, python, it's typically argv[1] etc.
> maybe: command-line-args, i can't check it now.
command-line-args's value is
("emacs" "lisp.el")
Documentation:
Args passed by shell to Emacs, as a list of strings.
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: gnu.emacs.help, comp.lang.lisp
From:
Xah Lee <xah... @gmail.com>
Date: Fri, 22 Jul 2011 04:14:09 -0700 (PDT)
Local: Fri, Jul 22 2011 7:14 am
Subject: Re: how to make emacs lisp take argv from shell command line?
On Jul 21, 8:31 am, Piotr Chamera <piotr_cham
... @poczta.onet.pl>
wrote:
> W dniu 2011-07-21 17:03, Xah Lee pisze:
> > i'm writing a text processing emacs lisp script. To be run like this:
> > emacs --script process_log.el filepath
> > how to make the script take the argument? i.e. that filepath?
> > e.g. in perl, python, it's typically argv[1] etc.
> maybe: command-line-args, i can't check it now.
thank you very much.
Xah
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: gnu.emacs.help
From:
Xah Lee <xah... @gmail.com>
Date: Fri, 22 Jul 2011 04:17:52 -0700 (PDT)
Local: Fri, Jul 22 2011 7:17 am
Subject: Re: how to make emacs lisp take argv from shell command line?
> > W dniu 2011-07-21 17:03, Xah Lee pisze: > > > i'm writing a text processing emacs lisp script. To be run like this: > > > emacs --script process_log.el filepath
On Jul 21, 1:46 pm, Swami Tota Ram Shankar <tota_
... @india.com> wrote:
> command-line-args's value is > ("emacs" "lisp.el") > Documentation: > Args passed by shell to Emacs, as a list of strings.
thank you.
> Can you give a small example of what the script file would look like ? > Is it a lambda or a progn for the main program ?
one recent example is:
〈Emacs Lisp: Batch Script to Validate Matching Brackets〉
http://xahlee.org/emacs/elisp_validate_matching_brackets.html thanks.
Xah
You must
Sign in before you can post messages.
You do not have the permission required to post.