From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Sesquicolon -- Note: Not a Bug Date: Sun, 25 Aug 2002 14:52:37 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200208251852.g7PIqbP21323@rum.cs.yale.edu> References: <200208250526.g7P5Q3F11930@wijiji.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1030301566 22224 127.0.0.1 (25 Aug 2002 18:52:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 25 Aug 2002 18:52:46 +0000 (UTC) Cc: polymath@uwyo.edu, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17j2VB-0005mL-00 for ; Sun, 25 Aug 2002 20:52:45 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17j2ze-00036S-00 for ; Sun, 25 Aug 2002 21:24:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17j2WS-0003Ot-00; Sun, 25 Aug 2002 14:54:04 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17j2V6-0003Hi-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 14:52:40 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17j2V4-0003HV-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 14:52:39 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17j2V4-0003HP-00; Sun, 25 Aug 2002 14:52:38 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g7PIqbP21323; Sun, 25 Aug 2002 14:52:37 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Richard Stallman Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6873 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6873 > 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 as a shorthand for emacs -batch --load since (after all) just `emacs -batch ' 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