unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: polymath@uwyo.edu, emacs-devel@gnu.org
Subject: Re: Sesquicolon -- Note: Not a Bug
Date: Sun, 25 Aug 2002 14:52:37 -0400	[thread overview]
Message-ID: <200208251852.g7PIqbP21323@rum.cs.yale.edu> (raw)
In-Reply-To: 200208250526.g7P5Q3F11930@wijiji.santafe.edu

>     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

      parent reply	other threads:[~2002-08-25 18:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.GSO.4.10.10208230008380.5847-100000@asuwlink.uwyo.edu>
2002-08-25  5:26 ` Sesquicolon -- Note: Not a Bug Richard Stallman
2002-08-25  5:37   ` Miles Bader
2002-08-25 10:01     ` Marius Vollmer
2002-08-26 12:53       ` Richard Stallman
2002-08-26 21:19         ` Marius Vollmer
2002-08-26 22:08           ` Stefan Monnier
2002-08-26  0:36     ` Richard Stallman
2002-08-26  1:53       ` Miles Bader
2002-08-26 21:51         ` Richard Stallman
2002-08-26 22:15           ` Stefan Monnier
2002-08-27  9:28             ` Kim F. Storm
2002-08-31 12:17           ` Pavel Janík
2002-09-01 13:15             ` Richard Stallman
2002-09-04 17:33               ` Pavel Janík
2002-08-25 18:52   ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200208251852.g7PIqbP21323@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=emacs-devel@gnu.org \
    --cc=polymath@uwyo.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).