Mercurial > hg > xemacs-beta
comparison lisp/newcomment.el @ 5473:ac37a5f7e5be
Merge with trunk.
author | Mats Lidell <matsl@xemacs.org> |
---|---|
date | Thu, 17 Mar 2011 23:42:59 +0100 |
parents | 308d34e9f07d f00192e1cd49 |
children | 8861440b1aa4 |
comparison
equal
deleted
inserted
replaced
5472:e79980ee5efe | 5473:ac37a5f7e5be |
---|---|
280 (goto-char (point-min)) | 280 (goto-char (point-min)) |
281 (while (re-search-forward re nil t) | 281 (while (re-search-forward re nil t) |
282 (goto-char (match-beginning 0)) | 282 (goto-char (match-beginning 0)) |
283 (forward-char 1) | 283 (forward-char 1) |
284 (if unp (delete-char 1) (insert "\\")) | 284 (if unp (delete-char 1) (insert "\\")) |
285 (when (= (length ce) 1) | 285 (when (eql (length ce) 1) |
286 ;; If the comment-end is a single char, adding a \ after that | 286 ;; If the comment-end is a single char, adding a \ after that |
287 ;; "first" char won't deactivate it, so we turn such a CE | 287 ;; "first" char won't deactivate it, so we turn such a CE |
288 ;; into !CS. I.e. for pascal, we turn } into !{ | 288 ;; into !CS. I.e. for pascal, we turn } into !{ |
289 (if (not unp) | 289 (if (not unp) |
290 (when (string= (match-string 0) ce) | 290 (when (string= (match-string 0) ce) |
918 | 918 |
919 (cond | 919 (cond |
920 ((consp arg) (uncomment-region beg end)) | 920 ((consp arg) (uncomment-region beg end)) |
921 ((< numarg 0) (uncomment-region beg end (- numarg))) | 921 ((< numarg 0) (uncomment-region beg end (- numarg))) |
922 (t | 922 (t |
923 (setq numarg (if (and (null arg) (= (length comment-start) 1)) | 923 (setq numarg (if (and (null arg) (eql (length comment-start) 1)) |
924 add (1- numarg))) | 924 add (1- numarg))) |
925 (comment-region-internal | 925 (comment-region-internal |
926 beg end | 926 beg end |
927 (let ((s (comment-padright comment-start numarg))) | 927 (let ((s (comment-padright comment-start numarg))) |
928 (if (string-match comment-start-skip s) s | 928 (if (string-match comment-start-skip s) s |
975 (if (save-excursion (beginning-of-line) (not (looking-at "\\s-*$"))) | 975 (if (save-excursion (beginning-of-line) (not (looking-at "\\s-*$"))) |
976 ;; FIXME: If there's no comment to kill on this line and ARG is | 976 ;; FIXME: If there's no comment to kill on this line and ARG is |
977 ;; specified, calling comment-kill is not very clever. | 977 ;; specified, calling comment-kill is not very clever. |
978 (if arg (comment-kill (and (integerp arg) arg)) (comment-indent)) | 978 (if arg (comment-kill (and (integerp arg) arg)) (comment-indent)) |
979 (let ((add (if arg (prefix-numeric-value arg) | 979 (let ((add (if arg (prefix-numeric-value arg) |
980 (if (= (length comment-start) 1) comment-add 0)))) | 980 (if (eql (length comment-start) 1) comment-add 0)))) |
981 ;; Some modes insist on keeping column 0 comment in column 0 | 981 ;; Some modes insist on keeping column 0 comment in column 0 |
982 ;; so we need to move away from it before inserting the comment. | 982 ;; so we need to move away from it before inserting the comment. |
983 (indent-according-to-mode) | 983 (indent-according-to-mode) |
984 (insert (comment-padright comment-start add)) | 984 (insert (comment-padright comment-start add)) |
985 (save-excursion | 985 (save-excursion |