Skip to content

Commit

Permalink
Fix #351: locally tweak imenu-create-index-function
Browse files Browse the repository at this point in the history
* eglot.el (eglot--managed-mode): locally tweak
imenu-create-index-function.
  • Loading branch information
joaotavora committed Nov 20, 2019
1 parent 4bd8773 commit 73d3774
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand All @@ -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)
Expand Down

0 comments on commit 73d3774

Please sign in to comment.