diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-03-08 03:49:00 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-03-08 03:49:00 +0000 |
commit | 93b036536228e060c897b694affd9d1d70510309 (patch) | |
tree | 69864d03ee9856c7b251edf651eb59193917ffe2 /lisp/simple.el | |
parent | 65ee6096af4a71e5f26bbef7eccfe1edee68bbaa (diff) | |
download | emacs-93b036536228e060c897b694affd9d1d70510309.tar.gz |
(indent-new-comment-line): Clean up handling of \(...\) in comment-start-skip.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r-- | lisp/simple.el | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 5d0058d19a6..8fc7727b0fb 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2282,20 +2282,19 @@ unless optional argument SOFT is non-nil." ;; Set WIN to the pos of the comment-start. ;; But if the comment is empty, look at preceding lines ;; to find one that has a nonempty comment. - (let ((win (match-beginning 0))) + + ;; If comment-start-skip contains a \(...\) pair, + ;; the real comment delimiter starts at the end of that pair. + (let ((win (or (match-end 1) (match-beginning 0)))) (while (and (eolp) (not (bobp)) (let (opoint) (beginning-of-line) (setq opoint (point)) (forward-line -1) (re-search-forward comment-start-skip opoint t))) - (setq win (match-beginning 0))) + (setq win (or (match-end 1) (match-beginning 0)))) ;; Indent this line like what we found. (goto-char win) - ;; If comment-start-skip contains a \(...\) pair, - ;; the real comment delimiter starts at the end of that pair. - (if (match-end 1) - (goto-char (match-end 1))) (setq comcol (current-column)) (setq comstart (buffer-substring (point) (match-end 0))))))) |