Function: help-fns--first-release-regexp
help-fns--first-release-regexp is a byte-compiled function defined in
help-fns.el.gz.
Signature
(help-fns--first-release-regexp SYMBOL)
Source Code
;; Defined in /usr/src/emacs/lisp/help-fns.el.gz
(defun help-fns--first-release-regexp (symbol)
(let* ((name (symbol-name symbol))
(quoted (regexp-quote name)))
;; We used to use just (concat "\\_<" (regexp-quote name) "\\_>"),
;; which had the advantage of adapting to the various notational
;; conventions we've used over the years in etc/NEWS*, but it was also
;; leading to many false positives. So we use a more restrictive regexp
;; now (which can still lead to false positives, e.g. because we don't
;; distinguish between occurrences of the same symbol for
;; different purposes, such as function name, var name, face name,
;; property name, ...).
(concat
;; The main "canonical" occurrence of symbols is within '...'.
"'" quoted "'"
;; Commands can also occur as `M-x blabla'.
"\\|M-x[ \t\n]+" quoted "\\_>"
;; Other times we do '<key>' (<cmdname>).
"\\|(" quoted ")"
;; Finally other times we just include sample code, which we will
;; only recognize if it's indented by at least 2 spaces and start with
;; an open paren.
"\\|^\\(?: \\|\t\\)[ \t]*(\\(.*[( ']\\)?" quoted "\\_>")
))