From 60ba42ca4aa04145637f9c1c28b16da2f2f513b0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 31 Aug 2020 23:11:33 -0400 Subject: [PATCH] Fix #3873: use thing-at-point for nox & elpy --- core/autoload/text.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/autoload/text.el b/core/autoload/text.el index 79c924f4c..f3f7f6ad0 100644 --- a/core/autoload/text.el +++ b/core/autoload/text.el @@ -106,10 +106,11 @@ in some cases." (thing (thing-at-point thing t)) ((require 'xref nil t) - ;; Eglot defines a dummy for `xref-find-backend', so we need a special - ;; case to avoid xref when using eglot. See - ;; https://github.com/joaotavora/eglot/issues/503 - (if (eq (xref-find-backend) 'eglot) + ;; Eglot, nox (a fork of eglot), and elpy implementations for + ;; `xref-backend-identifier-at-point' betray the documented purpose of + ;; the interface. Eglot/nox return a hardcoded string and elpy prepends + ;; the line number to the symbol. + (if (memq (xref-find-backend) '(eglot elpy nox)) (thing-at-point 'symbol t) ;; A little smarter than using `symbol-at-point', though in most ;; cases, xref ends up using `symbol-at-point' anyway.