bug-gnu-emacs
[Top][All Lists]
Advanced

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

[patch] 21.2 executable.el - Better shebang spport (#!)


From: Jari Aalto+mail.emacs
Subject: [patch] 21.2 executable.el - Better shebang spport (#!)
Date: Thu, 22 Aug 2002 14:32:11 +0300
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/20.7 (i386-*-nt5.0.2195) (i386-*-nt5.0.2195)

A more flexible detection....

Jari


2002-08-22  Jari Aalto  <jari.aalto@poboxes.com>

        * progmodes/executable.el
        (executable-make-buffer-file-executable-if-script-p):
        Better shebang detection. Before #! can be spaces.


--- executable.el.orig  2002-08-22 14:25:02.000000000 +0300
+++ executable.el       2002-08-22 14:26:56.000000000 +0300
@@ -280,7 +280,8 @@
   (and (>= (buffer-size) 2)
        (save-restriction
         (widen)
-        (string= "#!" (buffer-substring 1 3)))
+        (goto-char (point-min))
+        (looking-at "^[ \t]*#!"))
        (let* ((current-mode (file-modes (buffer-file-name)))
               (add-mode (logand ?\111 (default-file-modes))))
          (or (/= (logand ?\111 current-mode) 0)




reply via email to

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