From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: sh-script.el and magic numbers Date: Sat, 18 Jan 2003 21:24:03 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301190324.VAA14671@eel.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1042946741 18085 80.91.224.249 (19 Jan 2003 03:25:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 19 Jan 2003 03:25:41 +0000 (UTC) Cc: gmorris+mail@ast.cam.ac.uk Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18a65Z-0004hI-00 for ; Sun, 19 Jan 2003 04:25:37 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18a6Fl-0001Mc-00 for ; Sun, 19 Jan 2003 04:36:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18a64r-0001W8-06 for emacs-devel@quimby.gnus.org; Sat, 18 Jan 2003 22:24:53 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18a64f-0001Sw-00 for emacs-devel@gnu.org; Sat, 18 Jan 2003 22:24:41 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18a64a-0001Sf-00 for emacs-devel@gnu.org; Sat, 18 Jan 2003 22:24:36 -0500 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18a63W-0001BX-00 for emacs-devel@gnu.org; Sat, 18 Jan 2003 22:23:30 -0500 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) by manatee.dms.auburn.edu (8.9.1a/8.9.1) with ESMTP id VAA29367; Sat, 18 Jan 2003 21:23:25 -0600 (CST) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.9.3+Sun/8.9.3) id VAA14671; Sat, 18 Jan 2003 21:24:03 -0600 (CST) X-Authentication-Warning: eel.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10863 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10863 As I mentioned in an earlier report, there seems to be quite some evidence that sh-script.el assumes, at several places and in several ways, that shell scripts start with a magic number (#! line), unless it is a special standard configuration file, obviously intended to be sourced, style .bashrc. (The concrete definition being "matching `executable-magicless-file-regexp'".) Even in that case sh-script.el seems to assume the file to start with some kind of comment. The only person who responded to my earlier report (Glenn Morris) seemed to believe that these assumptions should not be made. There are at least three separate problems (one bug, reported before, and two inconveniences) associated with not following these conventions. Clearly I am not going to even describe the other two problems (inconveniences rather than real bugs) if it is decided that sh-scripts.el's assumptions are perfectly reasonable, since in that case all these "problems" are irrelevant. So, is there a policy concerning whether or not we care about files not following the above conventions? If there is not, should we have a discussion or is the answer "obvious"? Glenn's argument is that some files are intended to be sourced, not executed, which, of course, is obvious. My sysadmin seems to defend the conventions, his argument being that a magic number does no harm, even if the file is to be sourced and indicates to several facilities (including sh-mode) what shell the script is written for. He does put magic comments in .bashrc and similar files. My Red Hat provided .bashrc contains no magic number, but seems to very deliberately start with a comment (which means it is OK in as far as sh-script.el goes): # .bashrc One argument against the conventions, in addition to Glenn's earlier argument, might be that it is possible to use special history files that look very much like shell-scripts and interactively C-o (in Readline) one's way through them. One may want to put such files in sh-mode, without starting them with a magic number. Sincerely, Luc.