diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-01-17 22:41:21 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-01-17 22:41:21 +0000 |
commit | 3dcbe8a8498148c1b38ff3300341a2c6ac51169c (patch) | |
tree | 0285e3c6a9567ee7c2092458db5bebdb50853efe /lisp/progmodes/sh-script.el | |
parent | 2acdbec139a3fbff880bb3d2d36efed2fdbaa3e4 (diff) | |
download | emacs-3dcbe8a8498148c1b38ff3300341a2c6ac51169c.tar.gz |
(sh-indent-line): Cope if no previous noncomment line.
Diffstat (limited to 'lisp/progmodes/sh-script.el')
-rw-r--r-- | lisp/progmodes/sh-script.el | 11 |
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 |