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

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

[elpa] externals/setup ce1e0e3 08/10: Prevent overriding all elisp xref


From: Stefan Monnier
Subject: [elpa] externals/setup ce1e0e3 08/10: Prevent overriding all elisp xref requests
Date: Wed, 12 May 2021 18:45:55 -0400 (EDT)

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

    Prevent overriding all elisp xref requests
---
 setup.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/setup.el b/setup.el
index f3d4255..0fde6bf 100644
--- a/setup.el
+++ b/setup.el
@@ -71,6 +71,8 @@
 
 ;;; Code:
 
+(require 'elisp-mode)
+
 (defvar setup-macros nil
   "Local macro definitions to be bound in `setup' bodies.
 Do not modify this variable by hand.  Instead use
@@ -199,11 +201,13 @@ If not given, it is assumed nothing is evaluated."
                  (cons '&rest spec))
                 (t spec)))))
 
+(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"))))
+
 (add-to-list 'elisp-xref-find-def-functions
-             (defun setup-xref-def-function (symbol)
-               "Return an elisp xref location for SYMBOL."
-               (require 'elisp-mode)
-               (list (elisp--xref-make-xref nil symbol "setup"))))
+             #'setup-xref-def-function)
 
 
 ;;; definitions of `setup' keywords



reply via email to

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