From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#61640: 30.0.50; Help Elisp xref recognize defclass parent classes Date: Sun, 19 Feb 2023 14:08:42 -0800 Message-ID: <871qmlqped.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27184"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 61640@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 19 23:09:14 2023 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 1pTrrt-0006o2-84 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Feb 2023 23:09:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTrri-0001UD-Vd; Sun, 19 Feb 2023 17:09:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTrri-0001U0-8o for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2023 17:09:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pTrri-00006d-0J for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2023 17:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pTrrh-0001bx-Nc for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2023 17:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Feb 2023 22:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61640 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16768445366177 (code B ref -1); Sun, 19 Feb 2023 22:09:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Feb 2023 22:08:56 +0000 Original-Received: from localhost ([127.0.0.1]:49835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTrrc-0001bY-3g for submit@debbugs.gnu.org; Sun, 19 Feb 2023 17:08:56 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:47934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTrra-0001bR-O7 for submit@debbugs.gnu.org; Sun, 19 Feb 2023 17:08:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTrra-0001Qq-Ic for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2023 17:08:54 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTrrY-0008Vr-Tr for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2023 17:08:54 -0500 Original-Received: from localhost (c-71-197-232-41.hsd1.wa.comcast.net [71.197.232.41]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 95F95FA089 for ; Sun, 19 Feb 2023 22:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1676844524; bh=QuPm7J7xAh5Swcbns7UQmHVB5FNH6VbVdi0bPejf9SY=; h=From:To:Subject:Date:From; b=QpdsFeQsx3bZbgyJmDmsxcOu1eVJgqsPgJrbZFFddDFJtTzj6gi7uTplng4JEI1qm XlLb7sTBKIqFngBSBH8TZdyIkfEA43r78iTzt3XZET/ZCfRIO3pjgEFTjz5GvqbftG mSZ4VIrFSDzEAkIZE8k0Ny4g3h+FooqppdbiI9g8= Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256109 Archived-At: --=-=-= Content-Type: text/plain In a form such as this: (defclass ebdb-field-id (ebdb-field-labeled ebdb-field-obfuscated ebdb-field-user) ((label-list :initform 'ebdb-id-label-list) ... )) All the symbols in (ebdb-field-labeled ebdb-field-obfuscated ebdb-field-user) should be recognized by `elisp--xref-infer-namespace' as 'function. Right now, this is treated like a function call (ie like '(function variable variable)). I can't promise that the attached patch is exactly the right thing, but it ought to be pretty close. Thanks, Eric --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=elispxrefdefclass.diff diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 1c339d08148..f7cd9e90926 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -943,6 +943,10 @@ elisp--xref-infer-namespace cl-defmethod cl-defgeneric))) ;; (defun FUNC (... IDENT 'variable) + ((and (eql j 2) + (eq j-head 'defclass)) + ;; (defclass CLASS (... IDENT + 'function) ((eq j-head 'cond) ;; (cond ... (... IDENT 'variable) --=-=-=--