diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index cd78596b3..a186ed10c 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -136,12 +136,17 @@ Dictionary.app behind the scenes to get definitions.") (use-package! ivy-xref :when (featurep! :completion ivy) :config - (setq xref-show-xrefs-function #'ivy-xref-show-xrefs) - (set-popup-rule! "^\\*xref\\*$" :ignore t)) + (set-popup-rule! "^\\*xref\\*$" :ignore t) + ;; xref initialization is different in Emacs 27 - there are two different + ;; variables which can be set rather than just one + (when EMACS27+ + (setq xref-show-definitions-function #'ivy-xref-show-defs)) + ;; Necessary in Emacs <27. In Emacs 27 it will affect all xref-based + ;; commands other than xref-find-definitions too (eg project-find-regexp) + (setq xref-show-xrefs-function #'ivy-xref-show-xrefs)) (use-package! helm-xref - :when (featurep! :completion helm) - :config (setq xref-show-xrefs-function (if EMACS27+ #'helm-xref-show-xrefs-27 #'helm-xref-show-xrefs)))) + :when (featurep! :completion helm))) ;;