Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
how to make emacs lisp take argv from shell command line?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Xah Lee  
View profile  
 More options Jul 21 2011, 11:03 am
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Piotr Chamera  
View profile  
 More options Jul 21 2011, 11:31 am
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Swami Tota Ram Shankar  
View profile  
 More options Jul 21 2011, 4:46 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xah Lee  
View profile  
 More options Jul 22 2011, 7:14 am
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xah Lee  
View profile  
 More options Jul 22 2011, 7:17 am
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »