From 14f69da41711f2826af60a511155b2d1a5025e4a Mon Sep 17 00:00:00 2001 From: Ingo Lohmar Date: Wed, 2 Oct 2019 18:03:48 +0200 Subject: [PATCH] On buffer kill, first send didclose then teardown local structures MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It used to be the reverse way around, which doesn't make sense. * eglot.el (eglot-managed-mode): Fix order in `kill-buffer-hook' Co-authored-by: João Távora --- lisp/progmodes/eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 723ac3bc89c..279fbeedad7 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1172,8 +1172,9 @@ and just return it. PROMPT shouldn't end with a question mark." (eglot--managed-mode (add-hook 'after-change-functions 'eglot--after-change nil t) (add-hook 'before-change-functions 'eglot--before-change nil t) - (add-hook 'kill-buffer-hook 'eglot--signal-textDocument/didClose nil t) (add-hook 'kill-buffer-hook 'eglot--managed-mode-onoff nil t) + ;; Prepend "didClose" to the hook after the "onoff", so it will run first + (add-hook 'kill-buffer-hook 'eglot--signal-textDocument/didClose nil t) (add-hook 'before-revert-hook 'eglot--signal-textDocument/didClose nil t) (add-hook 'before-save-hook 'eglot--signal-textDocument/willSave nil t) (add-hook 'after-save-hook 'eglot--signal-textDocument/didSave nil t) -- 2.39.2