From 5962db9f49c93a1a89b61545225be8684e6553d3 Mon Sep 17 00:00:00 2001 From: Justin Davis Date: Sat, 20 Nov 2021 20:06:46 -0500 Subject: [PATCH] fix(lookup): xref 1.3.0 removed var xref--marker-ring Xref started many backwards incompatible changes in the name of performance. The marker ring no longer exists as a variable. +lookup--xref-show will silently fail every time. Switches to using xref-after-jump-hook to test whether xref actually jumped to a definition. The hook is part of the exposed interface and should hopefully not change in the near future. Fix: #5737 --- modules/tools/lookup/autoload/lookup.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/tools/lookup/autoload/lookup.el b/modules/tools/lookup/autoload/lookup.el index e8222bed6..3a727c20a 100644 --- a/modules/tools/lookup/autoload/lookup.el +++ b/modules/tools/lookup/autoload/lookup.el @@ -188,15 +188,16 @@ This can be passed nil as its second argument to unset handlers for MODES. e.g. (xref-find-backend) identifier))) (when xrefs - (let ((marker-ring (ring-copy xref--marker-ring))) + (let* ((jumped nil) + (xref-after-jump-hook + (cons (lambda () (setq jumped t)) + xref-after-jump-hook))) (funcall (or show-fn #'xref--show-defs) (lambda () xrefs) nil) (if (cdr xrefs) 'deferred - ;; xref will modify its marker stack when it finds a result to jump to. - ;; Use that to determine success. - (not (equal xref--marker-ring marker-ring))))))) + jumped))))) (defun +lookup-dictionary-definition-backend-fn (identifier) "Look up dictionary definition for IDENTIFIER."