changeset 14211:949aa01aca87

(sh-indent-line): Cope if no previous noncomment line.
author Richard M. Stallman <rms@gnu.org>
date Wed, 17 Jan 1996 22:41:21 +0000
parents e6659990d8f8
children 8cf630851594
files lisp/progmodes/sh-script.el
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/sh-script.el	Wed Jan 17 22:40:42 1996 +0000
+++ b/lisp/progmodes/sh-script.el	Wed Jan 17 22:41:21 1996 +0000
@@ -849,11 +849,12 @@
 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