changeset 19480:7f11f103a0ca

(sh-indent-line): Avoid infinite loop on indented line at start of buffer, when calculating PREVIOUS.
author Richard M. Stallman <rms@gnu.org>
date Sat, 23 Aug 1997 05:19:09 +0000
parents 3c201ec148a4
children 4d492290e085
files lisp/progmodes/sh-script.el
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/sh-script.el	Sat Aug 23 02:01:34 1997 +0000
+++ b/lisp/progmodes/sh-script.el	Sat Aug 23 05:19:09 1997 +0000
@@ -928,11 +928,13 @@
 
 
 (defun sh-indent-line ()
-  "Indent as far as preceding non-empty line, then by steps of `sh-indentation'.
+  "Indent a line for Sh mode (shell script mode).
+Indent as far as preceding non-empty line, then by steps of `sh-indentation'.
 Lines containing only comments are considered empty."
   (interactive)
   (let ((previous (save-excursion
-		    (while (and (not (bobp))
+		    (while (and (progn (beginning-of-line)
+				       (not (bobp)))
 				(progn
 				  (forward-line -1)
 				  (back-to-indentation)
@@ -940,6 +942,7 @@
 				      (eq (following-char) ?#)))))
 		    (current-column)))
 	current)
+    (debug)
     (save-excursion
       (indent-to (if (eq this-command 'newline-and-indent)
 		     previous