about summary refs log tree commit diff stats
path: root/.emacs.d/lisp/init-editor.el
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2024-06-05 15:16:51 +0100
committerDavid Morgan <djm_uk@protonmail.com>2024-06-05 15:18:29 +0100
commit4ddbe0f49b58fa9121a0cba78568703fe0662281 (patch)
treedd971957e31dc8dc7c758b48ef0d1a5c7e1b1063 /.emacs.d/lisp/init-editor.el
parent5fffc433fa4a439d6522f1f130b516dd3886cc5e (diff)
downloaddotfiles-4ddbe0f49b58fa9121a0cba78568703fe0662281.tar.gz
Use newer xref
Diffstat (limited to '.emacs.d/lisp/init-editor.el')
-rw-r--r--.emacs.d/lisp/init-editor.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/.emacs.d/lisp/init-editor.el b/.emacs.d/lisp/init-editor.el
index d95dfe6..5cb0cc7 100644
--- a/.emacs.d/lisp/init-editor.el
+++ b/.emacs.d/lisp/init-editor.el
@@ -148,13 +148,24 @@
   :bind
   ("C-c ." . operate-on-number-at-point))
 
-(use-feature xref
+(defun +elpaca-unload-xref (e)
+  (and (featurep 'xref) (unload-feature 'xref t))
+  (elpaca--continue-build e))
+
+(defun +elpaca-xref-build-steps ()
+  (append (butlast (if (file-exists-p (expand-file-name "xref" elpaca-builds-directory))
+                       elpaca--pre-built-steps elpaca-build-steps))
+          (list '+elpaca-unload-xref'elpaca--activate-package)))
+
+;;(elpaca `(xref :build ,(+elpaca-xref-build-steps)))
+(use-package xref
+  :ensure `(xref :build ,(+elpaca-xref-build-steps))
   :custom (xref-search-program 'ripgrep)
   :config
   (defun xref-find-references-other-window (identifier)
     "Like `xref-find-references' but switch to the other window"
     (interactive (list (xref--read-identifier "Find references of: ")))
-      (xref--find-xrefs identifier 'references identifier 'window))
+    (xref--find-xrefs identifier 'references identifier 'window))
   (defun xref-find-references-other-frame (identifier)
     "Like `xref-find-references' but switch to the other frame"
     (interactive (list (xref--read-identifier "Find references of: ")))