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

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

Re: Suppressing load messages


From: Giorgos Keramidas
Subject: Re: Suppressing load messages
Date: Thu, 13 Mar 2008 05:42:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix)

On Wed, 12 Mar 2008 16:32:36 -0700, Glenn Morris <rgm+news@stanford.edu> 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 <<EOF
> ...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 <<EOF
  (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



reply via email to

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