]> git.eshelyaron.com Git - emacs.git/commitdiff
(sh-indent-line): Cope if no previous noncomment line.
authorRichard M. Stallman <rms@gnu.org>
Wed, 17 Jan 1996 22:41:21 +0000 (22:41 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 17 Jan 1996 22:41:21 +0000 (22:41 +0000)
lisp/progmodes/sh-script.el

index 96db28ebf4a313a505711663168256447e5bd9cf..3c744e66ae04932cfa9d3a8ff0598f31eba60f8f 100644 (file)
@@ -849,11 +849,12 @@ in ALIST."
 Lines containing only comments are considered empty."
   (interactive)
   (let ((previous (save-excursion
-                   (while (progn
-                            (line-move -1)
-                            (back-to-indentation)
-                            (or (eolp)
-                                (eq (following-char) ?#))))
+                   (while (and (not (bobp))
+                               (progn
+                                 (forward-line -1)
+                                 (back-to-indentation)
+                                 (or (eolp)
+                                     (eq (following-char) ?#)))))
                    (current-column)))
        current)
     (save-excursion