Mercurial > emacs
comparison lisp/newcomment.el @ 56019:0517f0b254be
(comment-search-forward, comment-search-backward): Fix typos.
(comment-region): Doc fix.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 10 Jun 2004 20:38:28 +0000 |
parents | 597fb06dcdda |
children | 94e9e6f1f0b3 |
comparison
equal
deleted
inserted
replaced
56018:71f99388b729 | 56019:0517f0b254be |
---|---|
354 | 354 |
355 (defun comment-search-forward (limit &optional noerror) | 355 (defun comment-search-forward (limit &optional noerror) |
356 "Find a comment start between point and LIMIT. | 356 "Find a comment start between point and LIMIT. |
357 Moves point to inside the comment and returns the position of the | 357 Moves point to inside the comment and returns the position of the |
358 comment-starter. If no comment is found, moves point to LIMIT | 358 comment-starter. If no comment is found, moves point to LIMIT |
359 and raises an error or returns nil of NOERROR is non-nil." | 359 and raises an error or returns nil if NOERROR is non-nil." |
360 (if (not comment-use-syntax) | 360 (if (not comment-use-syntax) |
361 (if (re-search-forward comment-start-skip limit noerror) | 361 (if (re-search-forward comment-start-skip limit noerror) |
362 (or (match-end 1) (match-beginning 0)) | 362 (or (match-end 1) (match-beginning 0)) |
363 (goto-char limit) | 363 (goto-char limit) |
364 (unless noerror (error "No comment"))) | 364 (unless noerror (error "No comment"))) |
390 | 390 |
391 (defun comment-search-backward (&optional limit noerror) | 391 (defun comment-search-backward (&optional limit noerror) |
392 "Find a comment start between LIMIT and point. | 392 "Find a comment start between LIMIT and point. |
393 Moves point to inside the comment and returns the position of the | 393 Moves point to inside the comment and returns the position of the |
394 comment-starter. If no comment is found, moves point to LIMIT | 394 comment-starter. If no comment is found, moves point to LIMIT |
395 and raises an error or returns nil of NOERROR is non-nil." | 395 and raises an error or returns nil if NOERROR is non-nil." |
396 ;; FIXME: If a comment-start appears inside a comment, we may erroneously | 396 ;; FIXME: If a comment-start appears inside a comment, we may erroneously |
397 ;; stop there. This can be rather bad in general, but since | 397 ;; stop there. This can be rather bad in general, but since |
398 ;; comment-search-backward is only used to find the comment-column (in | 398 ;; comment-search-backward is only used to find the comment-column (in |
399 ;; comment-set-column) and to find the comment-start string (via | 399 ;; comment-set-column) and to find the comment-start string (via |
400 ;; comment-beginning) in indent-new-comment-line, it should be harmless. | 400 ;; comment-beginning) in indent-new-comment-line, it should be harmless. |
953 | 953 |
954 ;;;###autoload | 954 ;;;###autoload |
955 (defun comment-region (beg end &optional arg) | 955 (defun comment-region (beg end &optional arg) |
956 "Comment or uncomment each line in the region. | 956 "Comment or uncomment each line in the region. |
957 With just \\[universal-argument] prefix arg, uncomment each line in region BEG .. END. | 957 With just \\[universal-argument] prefix arg, uncomment each line in region BEG .. END. |
958 Numeric prefix arg ARG means use ARG comment characters. | 958 Numeric prefix ARG means use ARG comment characters. |
959 If ARG is negative, delete that many comment characters instead. | 959 If ARG is negative, delete that many comment characters instead. |
960 By default, comments start at the left margin, are terminated on each line, | 960 By default, comments start at the left margin, are terminated on each line, |
961 even for syntax in which newline does not end the comment and blank lines | 961 even for syntax in which newline does not end the comment and blank lines |
962 do not get comments. This can be changed with `comment-style'. | 962 do not get comments. This can be changed with `comment-style'. |
963 | 963 |