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

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

Suppressing load messages (was: batch mode)


From: Joel J. Adamson
Subject: Suppressing load messages (was: batch mode)
Date: Wed, 12 Mar 2008 10:50:58 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Brendan Halpin <brendan.halpin@ul.ie> writes:

> Can I hijack the thread to ask if there is a way of suppressing the

No, you may not ;)

> "Loading" and related start-up messages when using the
> #!/usr/bin/emacs --script convention?
>
> At present this:
> -------------------------------------------------------------------
> #!/usr/bin/emacs --script
> (princ "Hello World!\n")
> -------------------------------------------------------------------
>
> generates the following output:
> -------------------------------------------------------------------
> brendan@annacotty:/tmp$ ./hw.el 
> Loading 00debian-vars...
> Loading /etc/emacs-snapshot/site-start.d/50auctex.el (source)...
> Loading /usr/share/emacs/23.0.50/site-lisp/auctex.el (source)...
> Loading /usr/share/emacs/23.0.50/site-lisp/preview-latex.el (source)...
> Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
> Skipping dictionaries-common setup for emacs-snapshot
> Loading /etc/emacs/site-start.d/50gcl.el (source)...
> Loading /etc/emacs/site-start.d/50slime.el (source)...
> Loading /usr/share/emacs-snapshot/site-lisp/slime/slime-autoloads...

This is all STDERR, i.e. the *Messages* buffer.  If you redirect STDERR
or STDOUT, you can suppress the messages, or capture the output in a file.

For example, "hello 2</dev/null"
,----
| 
| /home/joel/lisp/el: ZShell> cat hello.el
| #!/usr/bin/emacs --script
| (message "this is garbage!\n")
| (princ "Hello, Is it me you're looking for?\n")
| 
| /home/joel/lisp/el: ZShell> ./hello.el 
| this is garbage!
| 
| Hello, Is it me you're looking for?
| /home/joel/lisp/el: ZShell> ./hello.el 2</dev/null
| Hello, Is it me you're looking for?
`----

There ya go.

The real question you should be asking is why emacs is loading all that
crap when you're using the --script option.  Who's in charge of your
site-start.el?

> Adding options like -q and --no-site-file to the bang line don't seem to
> have any effect, and this makes Emacs unattractive for small scripts. 

Only if all you want is STDOUT.  If you want to use 'emacs --script' for
non-interactive editing a la sed and awk, then it's perfect: load those
files into buffers, edit them and save them.

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.







reply via email to

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