From: Richard M. Stallman Date: Wed, 17 Jan 1996 22:41:21 +0000 (+0000) Subject: (sh-indent-line): Cope if no previous noncomment line. X-Git-Tag: emacs-19.34~1649 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b46c06dea5c2dce43fb780a303b800b5f52ccd55;p=emacs.git (sh-indent-line): Cope if no previous noncomment line. --- 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