summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/init.el b/init.el
index 26a0b2b..da48d8a 100644
--- a/init.el
+++ b/init.el
@@ -1875,6 +1875,16 @@
(setq outline-level #'km/elisp-outline-level))
(add-hook 'emacs-lisp-mode-hook #'km/elisp-set-outline-vars)
+ (defun km/elisp-use-xref-etags-inside-git ()
+ (when (and (executable-find "git")
+ (equal (with-temp-buffer
+ (call-process "git" nil t nil
+ "rev-parse" "--is-inside-work-tree")
+ (buffer-string))
+ "true\n"))
+ (xref-etags-mode 1)))
+ (add-hook 'emacs-lisp-mode-hook #'km/elisp-use-xref-etags-inside-git)
+
;; Modified from usepackage's issue #80.
(defun km/imenu-add-use-package ()
(when (string= (buffer-file-name (buffer-base-buffer))