comparison lisp/simple.el @ 10943:6a2af2832a42

(indent-new-comment-line): Clean up handling of \(...\) in comment-start-skip.
author Richard M. Stallman <rms@gnu.org>
date Wed, 08 Mar 1995 03:49:00 +0000
parents be434b59c22e
children 99c9f475a355
comparison
equal deleted inserted replaced
10942:3f77513d0a77 10943:6a2af2832a42
2280 (re-search-forward comment-start-skip opoint t))) 2280 (re-search-forward comment-start-skip opoint t)))
2281 ;; The old line is a comment. 2281 ;; The old line is a comment.
2282 ;; Set WIN to the pos of the comment-start. 2282 ;; Set WIN to the pos of the comment-start.
2283 ;; But if the comment is empty, look at preceding lines 2283 ;; But if the comment is empty, look at preceding lines
2284 ;; to find one that has a nonempty comment. 2284 ;; to find one that has a nonempty comment.
2285 (let ((win (match-beginning 0))) 2285
2286 ;; If comment-start-skip contains a \(...\) pair,
2287 ;; the real comment delimiter starts at the end of that pair.
2288 (let ((win (or (match-end 1) (match-beginning 0))))
2286 (while (and (eolp) (not (bobp)) 2289 (while (and (eolp) (not (bobp))
2287 (let (opoint) 2290 (let (opoint)
2288 (beginning-of-line) 2291 (beginning-of-line)
2289 (setq opoint (point)) 2292 (setq opoint (point))
2290 (forward-line -1) 2293 (forward-line -1)
2291 (re-search-forward comment-start-skip opoint t))) 2294 (re-search-forward comment-start-skip opoint t)))
2292 (setq win (match-beginning 0))) 2295 (setq win (or (match-end 1) (match-beginning 0))))
2293 ;; Indent this line like what we found. 2296 ;; Indent this line like what we found.
2294 (goto-char win) 2297 (goto-char win)
2295 ;; If comment-start-skip contains a \(...\) pair,
2296 ;; the real comment delimiter starts at the end of that pair.
2297 (if (match-end 1)
2298 (goto-char (match-end 1)))
2299 (setq comcol (current-column)) 2298 (setq comcol (current-column))
2300 (setq comstart 2299 (setq comstart
2301 (buffer-substring (point) (match-end 0))))))) 2300 (buffer-substring (point) (match-end 0)))))))
2302 (if comcol 2301 (if comcol
2303 (let ((comment-column comcol) 2302 (let ((comment-column comcol)