]> git.eshelyaron.com Git - emacs.git/commitdiff
On buffer kill, first send didclose then teardown local structures
authorIngo Lohmar <ingo.lohmar@posteo.net>
Wed, 2 Oct 2019 16:03:48 +0000 (18:03 +0200)
committerJoão Távora <joaotavora@gmail.com>
Sat, 5 Oct 2019 08:50:50 +0000 (09:50 +0100)
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 <joaotavora@gmail.com>
lisp/progmodes/eglot.el

index 723ac3bc89cc17fa70208e4e31449e14eb5a2cf4..279fbeedad7f1d8ee96b65d4053cc5cae20284d4 100644 (file)
@@ -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)