diff options
| author | Richard M. Stallman | 2006-08-16 05:05:56 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-08-16 05:05:56 +0000 |
| commit | b605a60ad353518cc072bc0f4cad78dfed6364a2 (patch) | |
| tree | d48c46070b5b0ae8529bd6de5a24530a1971ce77 | |
| parent | 19f0515adac3bc3b0ffa371fb92350bdb0b5fd15 (diff) | |
| download | emacs-b605a60ad353518cc072bc0f4cad78dfed6364a2.tar.gz emacs-b605a60ad353518cc072bc0f4cad78dfed6364a2.zip | |
(comment-indent): Fully update INDENT
before checking to see if it will change the text.
| -rw-r--r-- | lisp/newcomment.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 5dfa1eb8959..358c834de73 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -599,11 +599,16 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any." | |||
| 599 | (if (and other (<= other max) (> other min)) | 599 | (if (and other (<= other max) (> other min)) |
| 600 | ;; There is a comment and it's in the range: bingo. | 600 | ;; There is a comment and it's in the range: bingo. |
| 601 | (setq indent other)))))))) | 601 | (setq indent other)))))))) |
| 602 | ;; Update INDENT to leave at least one space | ||
| 603 | ;; after other nonwhite text on the line. | ||
| 604 | (save-excursion | ||
| 605 | (skip-chars-backward " \t") | ||
| 606 | (unless (bolp) | ||
| 607 | (setq indent (max indent (1+ (current-column)))))) | ||
| 608 | ;; If that's different from comment's current position, change it. | ||
| 602 | (unless (= (current-column) indent) | 609 | (unless (= (current-column) indent) |
| 603 | ;; If that's different from current, change it. | ||
| 604 | (delete-region (point) (progn (skip-chars-backward " \t") (point))) | 610 | (delete-region (point) (progn (skip-chars-backward " \t") (point))) |
| 605 | (indent-to (if (bolp) indent | 611 | (indent-to indent))) |
| 606 | (max indent (1+ (current-column))))))) | ||
| 607 | (goto-char cpos) | 612 | (goto-char cpos) |
| 608 | (set-marker cpos nil)))) | 613 | (set-marker cpos nil)))) |
| 609 | 614 | ||