From: Ingo Lohmar Date: Wed, 2 Oct 2019 16:03:48 +0000 (+0200) Subject: On buffer kill, first send didclose then teardown local structures X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~315 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=14f69da41711f2826af60a511155b2d1a5025e4a;p=emacs.git On buffer kill, first send didclose then teardown local structures 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 --- 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)