Subject: Re: bug#54343: 28.0.91; find-function goes to a wrong place for erc

From: "J.P." <[email-masked]>
Date: Sat, 12 Mar 2022 00:27:25 -0800

"J.P." <[email-masked]> writes:

> seems to work with emacs -Q. (That rx form is bogus, BTW; it doesn't
> retain the capture groups and probably has other bugs.)

You're probably way ahead of me here, but I thought it prudent to
reemphasize that evaluating that ugly demo expression is useless. If
trying to convince yourself that splicing in a "cl-" prefix may be
promising, please just modify the original `find-function-regexp' value
instead:

  ""^\\s-*(\\(\\(?:cl-\\)?def\\(ine-skeleton...."
                   ^

FWIW, this one may be slightly less atrocious:

  (let ((find-function-regexp
         (rx bol
             (* (syntax -))
             "("
             (group
              (| (: (? "cl-")
                    "def"
                    (group
                     (| "ine-skeleton"
                        "ine-generic-mode"
                        "ine-derived-mode"
                        (: "ine" (? "-global") "-minor-mode")
                        "ine-compilation-mode"
                        "un-cvs-mode"
                        "foo"
                        (: (| (not (in "icfgv")) (: "g" (not ?r)))
                           (+ (group (| word (syntax symbol))))
                           (? ?*)))))
                 (: "easy-mmode-define-" (+ (in (?a . ?z) ?-)))
                 "easy-menu-define"
                 "menu-bar-make-toggle"
                 "menu-bar-make-toggle-command"))
             (+ (| (syntax -) "\n" (: ";" (* nonl) "\n")))
             (? (group (| ?' "(quote "))) "%s"
             (group (| (syntax -) eol (in "()"))))))
    (find-function 'erc))