From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "J.P." Newsgroups: gmane.emacs.bugs Subject: bug#54343: 28.0.91; find-function goes to a wrong place for erc Date: Fri, 11 Mar 2022 16:16:44 -0800 Message-ID: <87wnh0dnyr.fsf@neverwas.me> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38484"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 54343@debbugs.gnu.org To: Lin Jian Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 12 01:17:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSpRW-0009oI-Hy for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Mar 2022 01:17:10 +0100 Original-Received: from localhost ([::1]:43186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSpRV-00034c-5A for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Mar 2022 19:17:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSpRO-00033r-U9 for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2022 19:17:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSpRO-0007I1-Li for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2022 19:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nSpRO-0001ye-F7 for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2022 19:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Mar 2022 00:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54343 X-GNU-PR-Package: emacs Original-Received: via spool by 54343-submit@debbugs.gnu.org id=B54343.16470442177584 (code B ref 54343); Sat, 12 Mar 2022 00:17:02 +0000 Original-Received: (at 54343) by debbugs.gnu.org; 12 Mar 2022 00:16:57 +0000 Original-Received: from localhost ([127.0.0.1]:38831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSpRJ-0001yG-5e for submit@debbugs.gnu.org; Fri, 11 Mar 2022 19:16:57 -0500 Original-Received: from mail-108-mta172.mxroute.com ([136.175.108.172]:43329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSpRH-0001y4-Fk for 54343@debbugs.gnu.org; Fri, 11 Mar 2022 19:16:56 -0500 Original-Received: from filter006.mxroute.com ([140.82.40.27] 140.82.40.27.vultrusercontent.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta172.mxroute.com (ZoneMTA) with ESMTPSA id 17f7b7c2214000763e.001 for <54343@debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Sat, 12 Mar 2022 00:16:47 +0000 X-Zone-Loop: 3903b7797176998419fae6f148fb0a9469ca75d6bdd5 X-Originating-IP: [140.82.40.27] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=koi+srFMpFKTfkIvWZkwByAbNp1BrkGxyqXx6dYhCgc=; b=ckhLz+f036A/WEnoYpagmZHoV6 otLb+vhg56AsjokQvmuHO/X6DhA/T4QimCQwEjvQ8HUvhn51DizNhnyb15UnKqxHfY6fg63ixtEk5 vQyyqx2GVZnNYjGFZX0NQuLZPk1jOYITpTczTwTnHxf9+sUd9X0x0fmMbfcCRFNaTIM+B+W8foGDp R5+eWrLCYmbMok7kgAH28LE8k/MMKOtkzWFgT6G5RQ/RKFO4mLLPo45JbKEi33BFXRdtna6EgLppz jXdZIalKOL0oq0z84i6+pLLhRWTDcZD2EnPM42sMi0AAFX6SXJ3jZNz1CDKYYPBGnDslJEnviTt14 rFclxyTQ==; In-Reply-To: (Lin Jian's message of "Fri, 11 Mar 2022 19:57:04 +0000") X-AuthUser: masked@neverwas.me X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228238 Archived-At: Hi Jian, Lin Jian 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