From ecdeb489f81f91909a43dd86e47779fcbbc86f46 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 24 Apr 2020 15:12:33 -0400 Subject: [PATCH] Update {ivy,helm}-xref for Emacs 27 More variables to set! --- modules/tools/lookup/config.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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))) ;;