• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:comment +defs:multi +defs:line

1 ;;; newcomment.el --- (un)comment regions of buffers
8 ;; Keywords: comment uncomment
29 ;; A replacement for simple.el's comment-related functions.
34 ;; uncommented one-line at a time.
36 ;; - single-char nestable comment-start can only do the "\\s<+" stuff
39 ;; comment markers invalid.
40 ;; - comment-indent or comment-region when called inside a comment
41 ;; will happily break the surrounding comment.
42 ;; - comment-quote-nested will not (un)quote properly all nested comment
43 ;; markers if there are more than just comment-start and comment-end.
49 ;; - quantized steps in comment-alignment.
51 ;; - check what c-comment-line-break-function has to say.
52 ;; - spill auto-fill of comments onto the end of the next line.
55 ;; - drop block-comment-<foo> unless it's really used.
56 ;; - uncomment-region on a subpart of a comment.
57 ;; - support gnu-style "multi-line with space in continue".
58 ;; - somehow allow comment-dwim to use the region even if transient-mark-mode
61 ;; - when auto-filling a comment, try to move the comment to the left
63 ;; - sometimes default the comment-column to the same
64 ;; one used on the preceding line(s).
69 (defalias 'indent-for-comment 'comment-indent)
71 (defalias 'set-comment-column 'comment-set-column)
73 (defalias 'kill-comment 'comment-kill)
75 (defalias 'indent-new-comment-line 'comment-indent-new-line)
77 (defgroup comment nil
79 :prefix "comment-"
85 (defvar comment-use-syntax 'undecided
92 (defcustom comment-fill-column nil
93 "Column to use for `comment-indent'. If nil, use `fill-column' instead."
95 :group 'comment)
98 (defcustom comment-column 32
103 not to go beyond `comment-fill-column'."
105 :group 'comment)
106 (make-variable-buffer-local 'comment-column)
107 ;;;###autoload(put 'comment-column 'safe-local-variable 'integerp)
110 (defvar comment-start nil
111 "*String to insert to start a new comment, or nil if no comment syntax.")
112 ;;;###autoload(put 'comment-start 'safe-local-variable 'string-or-null-p)
115 (defvar comment-start-skip nil
116 "*Regexp to match the start of a comment plus everything up to its body.
117 If there are any \\(...\\) pairs, the comment delimiter text is held to begin
119 ;;;###autoload(put 'comment-start-skip 'safe-local-variable 'string-or-null-p)
122 (defvar comment-end-skip nil
123 "Regexp to match the end of a comment plus everything up to its body.")
124 ;;;###autoload(put 'comment-end-skip 'safe-local-variable 'string-or-null-p)
127 (defvar comment-end ""
128 "*String to insert to end a new comment.
129 Should be an empty string if comments are terminated by end-of-line.")
130 ;;;###autoload(put 'comment-end 'safe-local-variable 'string-or-null-p)
133 (defvar comment-indent-function 'comment-indent-default
134 "Function to compute desired indentation for a comment.
136 the comment's starting delimiter and should return either the desired
141 (defvar comment-insert-comment-function nil
142 "Function to insert a comment when a line doesn't contain one.
148 (defvar comment-region-function 'comment-region-default
149 "Function to comment a region.
150 Its args are the same as those of `comment-region', but BEG and END are
165 (defvar block-comment-start nil)
166 (defvar block-comment-end nil)
168 (defvar comment-quote-nested t
172 (defvar comment-continue nil
174 This string will be added at the beginning of each line except the very
177 It should generally have the same length as `comment-start' in order to
179 If it is nil a value will be automatically derived from `comment-start'
182 (defvar comment-add 0
183 "How many more comment chars should be inserted by `comment-region'.
184 This determines the default value of the numeric argument of `comment-region'.
189 (defconst comment-styles
193 (multi-line . (t nil nil t))
194 (extra-line . (t nil t t))
196 (box-multi . (t t t t)))
197 "Possible comment styles of the form (STYLE . (MULTI ALIGN EXTRA INDENT)).
200 ALIGN specifies that the `comment-end' markers should be aligned.
201 EXTRA specifies that an extra line should be used before and after the
202 region to comment (to put the `comment-end' and `comment-start').
203 INDENT specifies that the `comment-start' markers should not be put at the
204 left margin but at the current indentation of the region to comment.")
207 (defcustom comment-style 'plain
208 "Style to be used for `comment-region'.
209 See `comment-styles' for a list of available styles."
210 :type (if (boundp 'comment-styles)
211 `(choice ,@(mapcar (lambda (s) `(const ,(car s))) comment-styles))
213 :group 'comment)
216 (defcustom comment-padding " "
217 "Padding string that `comment-region' puts between comment chars and text.
221 Extra spacing between the comment characters and the comment text
222 makes the comment easier to read. Default is 1. nil means 0."
224 :group 'comment)
227 (defcustom comment-multi-line nil
228 "Non-nil means `comment-indent-new-line' continues comments.
233 It also affects \\[indent-new-comment-line]. However, if you want this
236 :group 'comment)
238 (defcustom comment-empty-lines nil
239 "If nil, `comment-region' does not comment out empty lines.
242 terminated by the end of line (i.e. `comment-end' is empty)."
246 :group 'comment)
252 (defun comment-string-strip (str beforep afterp)
259 (defun comment-string-reverse (s)
261 (comment-string-strip (concat (nreverse (string-to-list s))) nil t))
264 (defun comment-normalize-vars (&optional noerror)
269 (unless (and (not comment-start) noerror)
270 (unless comment-start
271 (let ((cs (read-string "No comment syntax is defined. Use: ")))
273 (error "No comment syntax defined")
274 (set (make-local-variable 'comment-start) cs))))
275 ;; comment-use-syntax
276 (when (eq comment-use-syntax 'undecided)
277 (set (make-local-variable 'comment-use-syntax)
279 (cs comment-start)
280 (ce (if (string= "" comment-end) "\n" comment-end)))
281 ;; Try to skip over a comment using forward-comment
287 (and (forward-comment 1) (eobp))))))
288 ;; comment-padding
289 (unless comment-padding (setq comment-padding 0))
290 (when (integerp comment-padding)
291 (setq comment-padding (make-string comment-padding ? )))
292 ;; comment markers
293 ;;(setq comment-start (comment-string-strip comment-start t nil))
294 ;;(setq comment-end (comment-string-strip comment-end nil t))
295 ;; comment-continue
296 (unless (or comment-continue (string= comment-end ""))
297 (set (make-local-variable 'comment-continue)
298 (concat (if (string-match "\\S-\\S-" comment-start) " " "|")
299 (substring comment-start 1)))
301 ;; (unless (string-match comment-start-skip comment-continue)
302 ;; (kill-local-variable 'comment-continue))
304 ;; comment-skip regexps
305 (unless (and comment-start-skip
306 ;; In case comment-start has changed since last time.
307 (string-match comment-start-skip comment-start))
308 (set (make-local-variable 'comment-start-skip)
310 (regexp-quote (comment-string-strip comment-start t t))
312 ;; might be both a comment-end marker and \s-.
314 (unless (and comment-end-skip
315 ;; In case comment-end has changed since last time.
316 (string-match comment-end-skip comment-end))
317 (let ((ce (if (string= "" comment-end) "\n"
318 (comment-string-strip comment-end t t))))
319 (set (make-local-variable 'comment-end-skip)
322 (concat "[ \t]*\\(\\s>" (if comment-quote-nested "" "+")
324 (if (and comment-quote-nested (<= (length ce) 1)) "" "+")
328 (defun comment-quote-re (str unp)
333 (defun comment-quote-nested (cs ce unp)
335 If UNP is non-nil, unquote nested comment markers."
336 (setq cs (comment-string-strip cs t t))
337 (setq ce (comment-string-strip ce t t))
338 (when (and comment-quote-nested (> (length ce) 0))
339 (let ((re (concat (comment-quote-re ce unp)
340 "\\|" (comment-quote-re cs unp))))
347 ;; If the comment-end is a single char, adding a \ after that
365 (defvar comment-use-global-state nil
369 described by the syntax-tables can set this to non-nil so comment markers
372 (defun comment-search-forward (limit &optional noerror)
373 "Find a comment start between point and LIMIT.
374 Moves point to inside the comment and returns the position of the
375 comment-starter. If no comment is found, moves point to LIMIT
377 (if (not comment-use-syntax)
378 (if (re-search-forward comment-start-skip limit noerror)
381 (unless noerror (error "No comment")))
385 (if comment-use-global-state (syntax-ppss pt))
387 (when (and (nth 8 s) (nth 3 s) (not comment-use-global-state))
395 ;; Make sure the comment starts after PT.
397 (unless noerror (error "No comment"))
398 ;; We found the comment.
401 (bol (line-beginning-position))
404 (if (looking-at comment-start-skip)
410 (defun comment-search-backward (&optional limit noerror)
411 "Find a comment start between LIMIT and point.
412 Moves point to inside the comment and returns the position of the
413 comment-starter. If no comment is found, moves point to LIMIT
415 ;; FIXME: If a comment-start appears inside a comment, we may erroneously
417 ;; comment-search-backward is only used to find the comment-column (in
418 ;; comment-set-column) and to find the comment-start string (via
419 ;; comment-beginning) in indent-new-comment-line, it should be harmless.
420 (if (not (re-search-backward comment-start-skip limit t))
421 (unless noerror (error "No comment"))
422 (beginning-of-line)
424 (cs (comment-search-forward end t))
427 (progn (beginning-of-line)
428 (comment-search-backward limit noerror))
430 (comment-forward)
432 (setq cs (comment-search-forward end t))))
437 (defun comment-beginning ()
438 "Find the beginning of the enclosing comment.
439 Returns nil if not inside a comment, else moves point and returns
440 the same as `comment-search-backward'."
445 (cs (comment-search-backward nil t)))
450 ;; For modes where comment-start and comment-end are the same,
452 (or (if comment-end-skip (not (looking-at comment-end-skip)))
455 'font-lock-comment-face)
457 'font-lock-comment-face)
458 ;; Let's assume it's a `cs' if we're on the same line.
459 (>= (line-end-position) pt)))
460 ;; Make sure that PT is not past the end of the comment.
461 (if (comment-forward 1) (> (point) pt) (eobp))))
466 (defun comment-forward (&optional n)
468 Just like `forward-comment' but only for positive N
471 (if (< n 0) (error "No comment-backward")
472 (if comment-use-syntax (forward-comment n)
475 (if (or (forward-comment 1)
476 (and (looking-at comment-start-skip)
478 (re-search-forward comment-end-skip nil 'move)))
482 (defun comment-enter-backward ()
483 "Move from the end of a comment to the end of its content.
484 Point is assumed to be just at the end of a comment."
486 ;; comment-end = ""
490 (narrow-to-region (line-beginning-position) (point))
492 (re-search-forward (concat comment-end-skip "\\'") nil t))
494 ;; comment-end-skip not found. Maybe we're at EOB which implicitly
495 ;; closes the comment.
498 ;; else comment-end-skip was not found probably because it was not
500 ;; blindly assume we're at the end of a two-char comment-end.
510 (defun comment-indent-default ()
511 "Default for `comment-indent-function'."
516 (and (> comment-add 0) (looking-at "\\s<\\(\\S<\\|\\'\\)")))
517 comment-column)))
520 (defun comment-indent (&optional continue)
521 "Indent this line's comment to `comment-column', or insert an empty comment.
522 If CONTINUE is non-nil, use the `comment-continue' markers if any."
524 (comment-normalize-vars)
525 (let* ((empty (save-excursion (beginning-of-line)
527 (starter (or (and continue comment-continue)
528 (and empty block-comment-start) comment-start))
529 (ender (or (and continue comment-continue "")
530 (and empty block-comment-end) comment-end)))
531 (unless starter (error "No comment syntax defined"))
532 (beginning-of-line)
533 (let* ((eolpos (line-end-position))
534 (begpos (comment-search-forward eolpos t))
536 ;; An existing comment?
540 (looking-at comment-end-skip))
541 ;; The comment is empty and we have skipped all its space
542 ;; and landed right before the comment-ender:
547 (if comment-insert-comment-function
548 (funcall comment-insert-comment-function)
550 ;; Some `comment-indent-function's insist on not moving
553 (indent-to comment-column)
554 ;; Ensure there's a space before the comment for things
564 (setq indent (save-excursion (funcall comment-indent-function)))
565 ;; If `indent' is nil and there's code before the comment, we can't
566 ;; use `indent-according-to-mode', so we default to comment-column.
568 (setq indent comment-column))
570 ;; comment-indent-function refuses: delegate to line-indent.
572 ;; If the comment is at the left of code, adjust the indentation.
576 (- (or comment-fill-column fill-column)
577 (save-excursion (end-of-line) (current-column))))))
581 ;; Let's try to align to a comment on the previous line.
587 (when (and (zerop (forward-line -1))
588 (setq other (comment-search-forward
589 (line-end-position) t)))
592 ;; There is a comment and it's in the range: bingo.
594 ;; Let's try to align to a comment on the next line, then.
597 (when (and (zerop (forward-line 1))
598 (setq other (comment-search-forward
599 (line-end-position) t)))
602 ;; There is a comment and it's in the range: bingo.
605 ;; after other nonwhite text on the line.
610 ;; If that's different from comment's current position, change it.
618 (defun comment-set-column (arg)
619 "Set the comment column based on point.
620 With no ARG, set the comment column to the current column.
621 With just minus as arg, kill any comment on this line.
622 With any other arg, set comment column to indentation of the previous comment
623 and then align or create a comment on this line at that column."
626 ((eq arg '-) (comment-kill nil))
628 (comment-normalize-vars)
630 (beginning-of-line)
631 (comment-search-backward)
632 (beginning-of-line)
633 (goto-char (comment-search-forward (line-end-position)))
634 (setq comment-column (current-column))
635 (message "Comment column set to %d" comment-column))
636 (comment-indent))
637 (t (setq comment-column (current-column))
638 (message "Comment column set to %d" comment-column))))
641 (defun comment-kill (arg)
642 "Kill the comment on this line, if any.
645 (comment-normalize-vars)
648 (beginning-of-line)
649 (let ((cs (comment-search-forward (line-end-position) t)))
654 (comment-forward)
657 (if arg (forward-line 1))))
659 (defun comment-padright (str &optional n)
660 "Construct a string composed of STR plus `comment-padding'.
663 ignored from `comment-padding'.
674 (substring comment-padding ;additional right padding
676 (length comment-padding)))))
677 ;; We can only duplicate C if the comment-end has multiple chars
678 ;; or if comments can be nested, else the comment-end `}' would
679 ;; be turned into `}}}' where only the first ends the comment
681 (multi (not (and comment-quote-nested
682 ;; comment-end is a single char
683 (string-match "\\`\\s-*\\S-\\s-*\\'" comment-end)))))
685 (concat lpad s (when multi (make-string n (aref str (1- (match-end 1))))) rpad)
691 (when multi "+") ;the last char of S might be repeated
695 (defun comment-padleft (str &optional n)
696 "Construct a string composed of `comment-padding' plus STR.
699 ignored from `comment-padding'.
708 (pad (concat (substring comment-padding
710 (length comment-padding)))
713 ;; We can only duplicate C if the comment-end has multiple chars
714 ;; or if comments can be nested, else the comment-end `}' would
715 ;; be turned into `}}}' where only the first ends the comment
717 (multi (not (and comment-quote-nested
718 ;; comment-end is a single char
719 (string-match "\\`\\s-*\\S-\\s-*\\'" comment-end)))))
721 (concat pad (when multi (make-string n c)) s)
729 (if multi (concat (regexp-quote (string c)) "*"))
734 "Uncomment each line in the BEG .. END region.
736 comment markers."
738 (comment-normalize-vars)
740 ;; Bind `comment-use-global-state' to nil. While uncommenting a region
741 ;; (which works a line at a time), a comment can appear to be
742 ;; included in a mult-line string, but it is actually not.
743 (let ((comment-use-global-state nil))
748 "Uncomment each line in the BEG .. END region.
750 comment markers."
754 (ccs comment-continue)
755 (srei (comment-padright ccs 're))
756 (csre (comment-padright comment-start 're))
760 (setq spt (comment-search-forward end t)))
762 ;; Find the end of the comment.
765 (unless (or (comment-forward)
768 (error "Can't find the comment end"))
775 ;; Remove the comment-start.
778 ;; A box-comment starts with a looong comment-start marker.
784 (> (- (point) (point-min) (length comment-start)) 7))
787 ;; Skip the padding. Padding can come from comment-padding and/or
788 ;; from comment-start, so we first check comment-start.
790 (looking-at (regexp-quote comment-padding)))
799 (looking-at comment-start-skip)))
801 ;; a comment-start any more, just remove it.
804 ;; Remove the end-comment (and leading padding and such).
805 (goto-char (point-max)) (comment-enter-backward)
806 ;; Check for special `=' used sometimes in comment-box.
816 (unless (or (eobp) (looking-at comment-end-skip))
818 ;; a comment-end any more, just remove it.
821 ;; Unquote any nested end-comment.
822 (comment-quote-nested comment-start comment-end t)
826 (let* ((cce (comment-string-reverse (or comment-continue
827 comment-start)))
828 (erei (and box (comment-padleft cce 're)))
833 ere (line-end-position) t))
836 (forward-line 1)
837 (re-search-forward sre (line-end-position) t))
839 ;; Go to the end for the next comment.
843 (defun comment-make-extra-lines (cs ce ccs cce min-indent max-indent &optional block)
845 This is used for `extra-line' style (or `box' style if BLOCK is specified)."
850 (setq ce (comment-string-strip ce t t))
855 ;; box comment
861 (if (and (equal comment-end "") (string-match ".*\\S-" cs))
870 (when (and (not (string-match comment-start-skip cs))
881 (defmacro comment-with-narrowing (beg end &rest body)
901 (end-of-line)
903 (beginning-of-line)
910 (defun comment-add (arg)
911 (if (and (null arg) (= (string-match "[ \t]*\\'" comment-start) 1))
912 comment-add
915 (defun comment-region-internal (beg end cs ce
918 CS and CE are the comment start string and comment end string,
919 respectively. CCS and CCE are the comment continuation strings
928 (let ((no-empty (not (or (eq comment-empty-lines t)
929 (and comment-empty-lines (zerop (length ce)))))))
938 (when block (unless ce (setq ce (comment-string-reverse cs))))
946 ;; If the end is not at the end of a line and the comment-end
949 (comment-with-narrowing beg end
953 ;; Quote any nested comment marker
954 (comment-quote-nested comment-start comment-end nil)
962 (end-of-line)
964 (not (or (eobp) (progn (forward-line) nil)))))
978 (comment-make-extra-lines
989 (insert cs) (setq cs ccs) ;switch to CCS after the first line
990 (end-of-line)
995 (end-of-line)
996 (not (or (eobp) (progn (forward-line) nil))))))))))
999 (defun comment-region (beg end &optional arg)
1000 "Comment or uncomment each line in the region.
1001 With just \\[universal-argument] prefix arg, uncomment each line in region BEG .. END.
1002 Numeric prefix ARG means use ARG comment characters.
1003 If ARG is negative, delete that many comment characters instead.
1004 By default, comments start at the left margin, are terminated on each line,
1005 even for syntax in which newline does not end the comment and blank lines
1006 do not get comments. This can be changed with `comment-style'.
1008 The strings used as comment starts are built from
1009 `comment-start' without trailing spaces and `comment-padding'."
1011 (comment-normalize-vars)
1015 (funcall comment-region-function beg end arg)))
1017 (defun comment-region-default (beg end &optional arg)
1019 (style (cdr (assoc comment-style comment-styles)))
1022 (multi (nth 0 style)))
1024 ;; of end-comment syntax rather than of whitespace syntax.
1026 (goto-char beg) (skip-chars-forward " \t\n\r") (beginning-of-line)
1028 (goto-char end) (skip-chars-backward " \t\n\r") (end-of-line)
1030 (if (>= beg end) (error "Nothing to comment"))
1035 lines ;; multi
1036 (progn (goto-char beg) (beginning-of-line)
1039 (progn (goto-char end) (end-of-line) (skip-syntax-backward " ")
1041 (or block (not (string= "" comment-end)))
1045 (unless (or lines (string= "" comment-end)) (setq block nil))
1051 (setq numarg (comment-add arg))
1052 (comment-region-internal
1054 (let ((s (comment-padright comment-start numarg)))
1055 (if (string-match comment-start-skip s) s
1056 (comment-padright comment-start)))
1057 (let ((s (comment-padleft comment-end numarg)))
1058 (and s (if (string-match comment-end-skip s) s
1059 (comment-padright comment-end))))
1060 (if multi (comment-padright comment-continue numarg))
1061 (if multi
1062 (comment-padleft (comment-string-reverse comment-continue) numarg))
1068 (defun comment-box (beg end &optional arg)
1071 end- comment markers additionally to what `comment-add' already specifies."
1073 (comment-normalize-vars)
1074 (let ((comment-style (if (cadr (assoc comment-style comment-styles))
1075 'box-multi 'box)))
1076 (comment-region beg end (+ comment-add arg))))
1080 (defun comment-or-uncomment-region (beg end &optional arg)
1081 "Call `comment-region', unless the region only consists of comments,
1085 (comment-normalize-vars)
1088 (comment-forward (point-max))
1090 'uncomment-region 'comment-region)
1094 (defun comment-dwim (arg)
1095 "Call the comment command you want (Do What I Mean).
1097 `comment-region' (unless it only consists of comments, in which
1099 Else, if the current line is empty, insert a comment and indent it.
1100 Else if a prefix ARG is specified, call `comment-kill'.
1101 Else, call `comment-indent'.
1102 You can configure `comment-style' to change the way regions are commented."
1104 (comment-normalize-vars)
1106 (comment-or-uncomment-region (region-beginning) (region-end) arg)
1107 (if (save-excursion (beginning-of-line) (not (looking-at "\\s-*$")))
1108 ;; FIXME: If there's no comment to kill on this line and ARG is
1109 ;; specified, calling comment-kill is not very clever.
1110 (if arg (comment-kill (and (integerp arg) arg)) (comment-indent))
1111 (let ((add (comment-add arg)))
1112 ;; Some modes insist on keeping column 0 comment in column 0
1113 ;; so we need to move away from it before inserting the comment.
1115 (insert (comment-padright comment-start add))
1117 (unless (string= "" comment-end)
1118 (insert (comment-padleft comment-end add)))
1122 (defcustom comment-auto-fill-only-comments nil
1124 This has no effect in modes that do not define a comment syntax."
1126 :group 'comment)
1128 (defun comment-valid-prefix-p (prefix compos)
1131 COMPOS is the position of the beginning of the comment we're in, or nil
1132 if we're not inside a comment."
1135 ;; to comment boundaries.
1137 ;; We're not inside a comment: the prefix shouldn't match
1138 ;; a comment-starter.
1139 (not (and comment-start comment-start-skip
1140 (string-match comment-start-skip prefix)))
1142 ;; Accept any prefix if the current comment is not EOL-terminated.
1143 (save-excursion (goto-char compos) (comment-forward) (not (bolp)))
1144 ;; Accept any prefix that starts with the same comment-start marker
1146 (when (string-match (concat "\\`[ \t]*\\(?:" comment-start-skip "\\)")
1148 (let ((prefix-com (comment-string-strip (match-string 0 prefix) nil t)))
1169 (defun comment-indent-new-line (&optional soft)
1170 "Break line at point and indent, continuing comment if within one.
1171 This indents the body of the continued comment
1172 under the previous comment line.
1174 This command is intended for styles where you write a comment per line,
1175 starting a new comment (and terminating it if necessary) on each line.
1176 If you want to continue one comment across several lines, use \\[newline-and-indent].
1178 If a fill column is specified, it overrides the use of the comment column
1179 or comment indentation.
1184 (comment-normalize-vars t)
1186 ;; If we are not inside a comment and we only auto-fill comments,
1187 ;; don't do anything (unless no comment syntax is defined).
1188 (unless (and comment-start
1189 comment-auto-fill-only-comments
1192 (prog1 (setq compos (comment-beginning))
1208 ;; If necessary check whether we're inside a comment.
1209 (unless (or compos (null comment-start))
1212 (setq compos (comment-beginning))
1217 ;; a comment and the prefix is not a comment starter.
1219 (comment-valid-prefix-p fill-prefix compos))
1222 ;; If we're not inside a comment, just try to indent.
1225 (let* ((comment-column
1227 ;; the current line's indentation (plus 2 for good measure)
1228 ;; and the current comment's indentation, with a preference
1229 ;; for comment-column.
1231 ;; FIXME: use prev line's info rather than first line's.
1233 (min (current-column) (max comment-column
1237 (string-match (regexp-quote (comment-string-strip
1238 comment-start t t))
1240 (comment-end
1241 (if normalp comment-end
1242 ;; The comment starter is not the normal comment-start
1243 ;; so we can't just use comment-end.
1246 (if (not (comment-forward)) comment-end
1247 (comment-string-strip
1249 (save-excursion (comment-enter-backward) (point))
1252 (comment-start comstart)
1253 (continuep (or comment-multi-line
1254 (cadr (assoc comment-style comment-styles))))
1255 ;; Force comment-continue to be recreated from comment-start.
1256 ;; FIXME: wrong if comment-continue was set explicitly!
1257 ;; FIXME: use prev line's continuation if available.
1258 (comment-continue nil))
1259 (if (and comment-multi-line (> (length comment-end) 0))
1263 (comment-indent continuep)
1266 (end-of-line)
1270 (end-of-line 0)