summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-01-17 22:41:21 +0000
committerRichard M. Stallman <rms@gnu.org>1996-01-17 22:41:21 +0000
commit3dcbe8a8498148c1b38ff3300341a2c6ac51169c (patch)
tree0285e3c6a9567ee7c2092458db5bebdb50853efe
parent2acdbec139a3fbff880bb3d2d36efed2fdbaa3e4 (diff)
downloademacs-3dcbe8a8498148c1b38ff3300341a2c6ac51169c.tar.gz
(sh-indent-line): Cope if no previous noncomment line.
-rw-r--r--lisp/progmodes/sh-script.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 96db28ebf4a..3c744e66ae0 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -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