[Top][All Lists]

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

should find-file detect executable files and assume shell-script mode?

From: Dan Jacobson
Subject: should find-file detect executable files and assume shell-script mode?
Date: 23 Feb 2002 03:23:54 +0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

$ ls -l
  -rw-r--r--    1 nurd turd       435 09 21 14:02 file1
  -rwxr-xr-x    1 nurd turd       345 12 28 22:15 file2
$ file file1 file2
file1:  ASCII text
file2:  ASCII text

Question: should
$ emacs file2
start up in say shell script mode?

You see, I notice that most of the time I edit shell scripts, emacs
just thinks it is a regular text file unless I put #!/bin/sh or -*-
Mode: sh -*- in, or call it file.sh.

Should emacs perhaps detect the +x mode bits and make an assumption?
However, the user could be a different kind of script writer ["hey,
those aren't shell scripts"]

Anyway, "are we letting that valuable information detected go to waste
by not acting upon it, thus not making things as comfy for the user as
could be?"

Or, "go on making such assumptions will quickly make the software an
unmaintanable tangle of special cases, e.g., Oh, the file lives on a
FAT-32 drive, where all files are 777 or 555 ..."

By the way, the "file" command might also mention that file2 is
executable and mention it... however I notice that the "file" command
is not a GNU tool at least on Mandrake 7.2.
http://www.geocities.com/jidanni/ Taiwan(04)25854780

reply via email to

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