diff options
| author | Richard M. Stallman | 1996-01-17 22:41:21 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-01-17 22:41:21 +0000 |
| commit | b46c06dea5c2dce43fb780a303b800b5f52ccd55 (patch) | |
| tree | a8c74913805c57ce0d4cf8eccc3b4e481a932fb2 | |
| parent | 9b30450ef06bfc0658f9a97cc00a9a7b1c5ec83e (diff) | |
| download | emacs-b46c06dea5c2dce43fb780a303b800b5f52ccd55.tar.gz emacs-b46c06dea5c2dce43fb780a303b800b5f52ccd55.zip | |
(sh-indent-line): Cope if no previous noncomment line.
| -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." | |||
| 849 | Lines containing only comments are considered empty." | 849 | Lines containing only comments are considered empty." |
| 850 | (interactive) | 850 | (interactive) |
| 851 | (let ((previous (save-excursion | 851 | (let ((previous (save-excursion |
| 852 | (while (progn | 852 | (while (and (not (bobp)) |
| 853 | (line-move -1) | 853 | (progn |
| 854 | (back-to-indentation) | 854 | (forward-line -1) |
| 855 | (or (eolp) | 855 | (back-to-indentation) |
| 856 | (eq (following-char) ?#)))) | 856 | (or (eolp) |
| 857 | (eq (following-char) ?#))))) | ||
| 857 | (current-column))) | 858 | (current-column))) |
| 858 | current) | 859 | current) |
| 859 | (save-excursion | 860 | (save-excursion |