# HG changeset patch # User Richard M. Stallman # Date 821918481 0 # Node ID 949aa01aca875eda6e5b960d5d10acb9d3f45754 # Parent e6659990d8f846b62c1c0d6951eac472fb2d6868 (sh-indent-line): Cope if no previous noncomment line. diff -r e6659990d8f8 -r 949aa01aca87 lisp/progmodes/sh-script.el --- 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