From 37984942ccefb98d403596a64aa100674acdab1c Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 15 Jul 2024 19:36:04 +0200 Subject: [PATCH] Simplify 'xref-etags-mode' --- lisp/progmodes/xref.el | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 119daa71761..11540fd0797 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1855,20 +1855,16 @@ output of this command when the backend is etags." ;;; Helper functions -(defvar xref-etags-mode--saved nil) - (define-minor-mode xref-etags-mode "Minor mode to make xref use etags again. Certain major modes install their own mechanisms for listing identifiers and navigation. Turn this on to undo those settings and just use etags." - :lighter "" + :lighter nil (if xref-etags-mode - (progn - (setq xref-etags-mode--saved xref-backend-functions) - (kill-local-variable 'xref-backend-functions)) - (setq-local xref-backend-functions xref-etags-mode--saved))) + (add-hook 'xref-backend-functions #'etags--xref-backend nil t) + (remove-hook 'xref-backend-functions #'etags--xref-backend t))) (declare-function grep-expand-template "grep") -- 2.39.2