emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/setup f15c902 10/10: Allow xref to find setup-defines o


From: Stefan Monnier
Subject: [elpa] externals/setup f15c902 10/10: Allow xref to find setup-defines outside of setup.el
Date: Wed, 12 May 2021 18:45:56 -0400 (EDT)

branch: externals/setup
commit f15c902d9c8801cd1362af7d4ca5024c838b5b21
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>

    Allow xref to find setup-defines outside of setup.el
---
 setup.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/setup.el b/setup.el
index 0fde6bf..b496ba1 100644
--- a/setup.el
+++ b/setup.el
@@ -169,6 +169,7 @@ If not given, it is assumed nothing is evaluated."
            (append (help-function-arglist fn 'preserve-names)
                    (if (plist-get opts :repeatable) '(...)))))
   (put name 'setup-shorthand (plist-get opts :shorthand))
+  (put name 'setup-definition-file (or load-file-name buffer-file-name))
   (put name 'lisp-indent-function (plist-get opts :indent))
   ;; define macro for `macroexpand-all'
   (setf (alist-get name setup-macros)   ;New in Emacs-25.
@@ -204,7 +205,8 @@ If not given, it is assumed nothing is evaluated."
 (defun setup-xref-def-function (symbol)
   "Return an elisp xref location for SYMBOL."
   (and (assq symbol setup-macros)
-       (list (elisp--xref-make-xref nil symbol "setup"))))
+       (let ((file (get symbol 'setup-definition-file)))
+         (list (elisp--xref-make-xref nil symbol file)))))
 
 (add-to-list 'elisp-xref-find-def-functions
              #'setup-xref-def-function)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]