From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dkcombs@panix.com (David Combs) Newsgroups: gmane.emacs.help Subject: Re: Suppressing load messages Date: Mon, 31 Mar 2008 02:34:37 +0000 (UTC) Organization: Public Access Networks Corp. Message-ID: References: <87ejafsubg.fsf@wivenhoe.staff8.ul.ie> <87zlt39tnn.fsf@kobe.laptop> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1206935688 13145 80.91.229.12 (31 Mar 2008 03:54:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Mar 2008 03:54:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 31 05:55:19 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JgB77-0004EB-OM for geh-help-gnu-emacs@m.gmane.org; Mon, 31 Mar 2008 05:55:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JgB6V-0004su-Vg for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Mar 2008 23:54:40 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 74 Original-NNTP-Posting-Host: panix3.panix.com Original-X-Trace: reader2.panix.com 1206930877 21623 166.84.1.3 (31 Mar 2008 02:34:37 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Mon, 31 Mar 2008 02:34:37 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Original-Xref: shelby.stanford.edu gnu.emacs.help:157504 X-Mailman-Approved-At: Sun, 30 Mar 2008 23:53:42 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52876 Archived-At: In article <87zlt39tnn.fsf@kobe.laptop>, Giorgos Keramidas wrote: >On Wed, 12 Mar 2008 16:32:36 -0700, Glenn Morris wrote: >> Brendan Halpin wrote: >> >>> The -Q, -batch and -no-site-file arguments aren't accepted on the >>> "#! /usr/bin/emacs --script" line. >> >> That's an execve issue - you can only have a single argument after the >> interpreter on any #! line. > >Exactly! > >> You could always do something like: >> >> #!/bin/sh >> >> /usr/bin/emacs -Q --script <> ...stuff... >> EOF > >This lets the shell interpret the Emacs script source. > >The following prints nothing here for me: > > #!/bin/sh > > emacs -Q -batch -l /dev/stdin < (let ((var-list (list 'foo$HOME 'bar$LOGNAME))) > (dolist (var var-list) > (message "Hello %s" var))) > EOF > >I ended up writing a short shell wrapper, called `emacs-script', like >the following: > > #!/bin/sh > exec emacs -Q -batch -l "$@" > >This lets me write scripts in Elisp by using: > > #!/usr/bin/env emacs-script > > (let ((var-list (list 'foo$HOME 'bar$LOGNAME))) > (dolist (var var-list) > (message "Hello %s" var))) > >which correctly prints: > > $ ./hw.el > Hello foo$HOME > Hello bar$LOGNAME > $ > >HTH, >Giorgos > Looks clever, but I don't really understand it (yet). Maybe you give a few more details about what you gain (apparantely a lot) via the shell-wrapper? Thanks! Also, if a general technique is what it is, where else might you use such a thing? Thanks! David