all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: 61640@debbugs.gnu.org
Subject: bug#61640: 30.0.50; Help Elisp xref recognize defclass parent classes
Date: Sun, 19 Feb 2023 14:08:42 -0800	[thread overview]
Message-ID: <871qmlqped.fsf@ericabrahamsen.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]


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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: elispxrefdefclass.diff --]
[-- Type: text/x-patch, Size: 585 bytes --]

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)

             reply	other threads:[~2023-02-19 22:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-19 22:08 Eric Abrahamsen [this message]
2023-02-19 22:42 ` bug#61640: 30.0.50; Help Elisp xref recognize defclass parent classes Dmitry Gutov
2023-02-19 23:45   ` Eric Abrahamsen
2023-02-20  1:05     ` Dmitry Gutov
2023-02-20  1:43       ` Eric Abrahamsen

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

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

  git send-email \
    --in-reply-to=871qmlqped.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=61640@debbugs.gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.