unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "J.P." <jp@neverwas.me>
To: Lin Jian <jlin.dev@outlook.com>
Cc: 54343@debbugs.gnu.org
Subject: bug#54343: 28.0.91; find-function goes to a wrong place for erc
Date: Fri, 11 Mar 2022 16:16:44 -0800	[thread overview]
Message-ID: <87wnh0dnyr.fsf@neverwas.me> (raw)
In-Reply-To: <SY4P282MB368061DD6CD2575DDA77FF1C840C9@SY4P282MB3680.AUSP282.PROD.OUTLOOK.COM> (Lin Jian's message of "Fri, 11 Mar 2022 19:57:04 +0000")

Hi Jian,

Lin Jian <jlin.dev@outlook.com> writes:

> steps to reproduce this bug:
>
> step 1: run: emacs -Q
> step 2: eval (find-function 'erc)
> step 3: the point goes to the defgroup of erc instead of the cl-defun of
> it, which I think is wrong
>
> wasamasa at #emacs:libera.chat helps to verify that this bug happens on
> the master of emacs on March 11, 2022.
>
> erc version is 5.4

Thanks for reporting this. I guess I felt obliged to say something since
ERC is in the subject line. But it looks like this bug affects more than
just ERC, so I'm going to cowardly defer to the experts here, if that's
all right.

But just as a dumb experiment, adding something like

  (let ((find-function-regexp
         (rx bol
             (* (syntax -))
             "("
             (? "cl-") ; <~~~~~~~~~~~~~~~~ THIS
             "def"
             (| (| "ine-skeleton"
                   "ine-generic-mode"
                   "ine-derived-mode"
                   "ine"
                   (? "-global")
                   "-minor-mode"
                   "ine-compilation-mode"
                   "un-cvs-mode"
                   "foo"
                   (: (| (not (any "icfgv")) (: "g" (not ?r)))
                      (| (+ 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")))
             (: (? (| ?' "(quote ")) "%s" (| (syntax -) eol (in "()"))))))
    (find-function 'erc))

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

Anyway, naively splicing in the "cl-" prefix part doesn't seem to break
test/lisp/emacs-lisp/find-func-tests.el, but I didn't look closely
enough to see if that even factors in to the existing coverage. I also
have no clue whether such an addition might put a noticeable strain on
folks using `find-function-search-for-symbol' heavily in lisp code. If
so, another option might be to include it in the fallback regexp[1]
instead.

Hopefully someone in the know will chime in.

Thanks again!

[1] https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/find-func.el?id=0470a4a9#n442





  reply	other threads:[~2022-03-12  0:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11 19:57 bug#54343: 28.0.91; find-function goes to a wrong place for erc Lin Jian
2022-03-12  0:16 ` J.P. [this message]
2022-03-12  1:48   ` Michael Heerdegen
2022-03-12  3:59     ` F. Jason Park
2022-03-12  8:27   ` J.P.
2022-03-12 17:54 ` Lars Ingebrigtsen
2022-03-13  0:53   ` J.P.
2022-03-13  0:59     ` Lars Ingebrigtsen
2022-03-13  3:09       ` J.P.
2022-03-13 14:10         ` Lars Ingebrigtsen
2022-03-13 20:12           ` J.P.
2022-03-13 20:16             ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnh0dnyr.fsf@neverwas.me \
    --to=jp@neverwas.me \
    --cc=54343@debbugs.gnu.org \
    --cc=jlin.dev@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).