From 111973220fd5822298beac47f18a8292b1e92d10 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Wed, 20 Nov 2019 22:51:42 +0000 Subject: [PATCH] Locally tweak imenu-create-index-function * eglot.el (eglot--managed-mode): locally tweak imenu-create-index-function. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/351 --- lisp/progmodes/eglot.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index c25b7b7f082..a327655a0ea 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1247,7 +1247,8 @@ For example, to keep your Company customization use (eglot--setq-saving company-backends '(company-capf)) (eglot--setq-saving company-tooltip-align-annotations t) (unless (eglot--stay-out-of-p 'imenu) - (add-function :before-until imenu-create-index-function #'eglot-imenu)) + (add-function :before-until (local 'imenu-create-index-function) + #'eglot-imenu)) (flymake-mode 1) (eldoc-mode 1) (cl-pushnew (current-buffer) (eglot--managed-buffers eglot--cached-current-server))) @@ -1267,6 +1268,7 @@ For example, to keep your Company customization use (remove-hook 'pre-command-hook 'eglot--pre-command-hook t) (cl-loop for (var . saved-binding) in eglot--saved-bindings do (set (make-local-variable var) saved-binding)) + (remove-function (local 'imenu-create-index-function) #'eglot-imenu) (setq eglot--current-flymake-report-fn nil) (let ((server eglot--cached-current-server)) (setq eglot--cached-current-server nil) -- 2.39.2