Function: outline--default-comment-regexp

outline--default-comment-regexp is a byte-compiled function defined in outline.el.gz.

Signature

(outline--default-comment-regexp)

Documentation

Construct a default comment-heading regexp from comment-start.

The result matches comment-start (with the variable comment-add(var)/comment-add(fun) applied for single-character comment starters) followed by outline-comment-regexp-suffix. For example, the result is
";; \\([*]+\\)" in a buffer whose comment-start is ";", and
"// \\([*]+\\)" when it is "//".

Return nil when comment-start is nil.

Source Code

;; Defined in /usr/src/emacs/lisp/outline.el.gz
(defun outline--default-comment-regexp ()
  "Construct a default comment-heading regexp from `comment-start'.
The result matches `comment-start' (with the variable `comment-add'
applied for single-character comment starters) followed by
`outline-comment-regexp-suffix'.  For example, the result is
\";; \\([*]+\\)\" in a buffer whose `comment-start' is \";\", and
\"// \\([*]+\\)\" when it is \"//\".

Return nil when `comment-start' is nil."
  (when comment-start
    (let* ((cs (string-trim-right comment-start))
           (prefix (if (= (length cs) 1)
                       (make-string (1+ (or comment-add 0)) (aref cs 0))
                     cs)))
      (concat (regexp-quote prefix) outline-comment-regexp-suffix))))