From: João Távora Date: Wed, 20 Nov 2019 22:51:42 +0000 (+0000) Subject: Locally tweak imenu-create-index-function X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~269 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=111973220fd5822298beac47f18a8292b1e92d10;p=emacs.git 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 --- 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)