diff emacs/octave-mod.el @ 3081:8c779ed7979b

[project @ 1997-08-25 15:51:20 by jwe]
author jwe
date Mon, 25 Aug 1997 15:52:58 +0000
parents db6d57d718f7
children 4bdba9d56316
line wrap: on
line diff
--- a/emacs/octave-mod.el	Fri Aug 22 20:53:39 1997 +0000
+++ b/emacs/octave-mod.el	Mon Aug 25 15:52:58 1997 +0000
@@ -655,7 +655,8 @@
        ((and (looking-at octave-block-end-regexp)
 	     (octave-not-in-string-or-comment-p))
 	(setq icol (- icol (octave-block-end-offset))))
-       ((looking-at "\\s<\\s<\\s<\\S<")
+       ((or (looking-at "\\s<\\s<\\s<\\S<")
+	    (octave-before-magic-comment-p))
 	(setq icol (list 0 icol)))
        ((looking-at "\\s<\\S<")
 	(setq icol (list comment-column icol)))))
@@ -667,8 +668,14 @@
     (* octave-block-offset
        (if (string-match (match-string 0) "switch") 2 1))))
 
+(defun octave-before-magic-comment-p ()
+  (save-excursion
+    (beginning-of-line)
+    (and (bobp) (looking-at "\\s-*#!"))))
+
 (defun octave-comment-indent ()
-  (if (looking-at "\\s<\\s<\\s<")
+  (if (or (looking-at "\\s<\\s<\\s<")
+	  (octave-before-magic-comment-p))
       0
     (if (looking-at "\\s<\\s<")
 	(calculate-octave-indent)