emacs-devel
[Top][All Lists]
Advanced

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

Re: Sesquicolon -- Note: Not a Bug


From: Stefan Monnier
Subject: Re: Sesquicolon -- Note: Not a Bug
Date: Sun, 25 Aug 2002 14:52:37 -0400

>     For the languages other than Emacs Lisp, we use the shebang, "#!", as
>     the first two characters of our scripts; but since Emacs requires more
>     than two arguments to load and run a script in batch mode, I use the
>     sesquicolon, ":;", for Emacs.
> 
> ;; would work if you feed the script manually as input to Bash.
> However, the special thing about #! is that exec recognizes it.
> exec won't recognize ;;.
> 
> I wonder if there is a way we could change Emacs so that it could run
> properly with #!.  Here's an idea that might work: suppose that when
> Emacs's stdin is a file, but there is no -batch option, it
> automatically starts in batch mode and loads $0.  WIth that change,
> maybe #!/usr/bin/emacs could work.
> 
> What do people think?

I don't see what stdin has to do with it.  A script as shown above
will simply cause the kernel to run `/usr/bin/emacs /the/script/file/name'
with the same old stdin, stdout, stderr, ... so Emacs will simply
load the script as a file to be edited.

If we don't want to add a new parameter, we could simply recognize

        emacs -batch <file>

as a shorthand for

        emacs -batch --load <file>

since (after all) just `emacs -batch <file>' doesn't make much sense
except for the very rare case where we want to execute what's in
the `local variables' section of the file.


        Stefan





reply via email to

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