]> git.eshelyaron.com Git - emacs.git/commitdiff
Explain why didopen on after-revert-hook is a bad idea
authorJoão Távora <joaotavora@gmail.com>
Mon, 7 May 2018 16:27:01 +0000 (17:27 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 7 May 2018 16:27:01 +0000 (17:27 +0100)
The reason is that the global find-file-hook is called again, and that
already does the didOpen. Too many didOpen's would be bad.

* eglot.el (eglot--managed-mode): Remove commented lines.

lisp/progmodes/eglot.el

index 2ab47819f0287b367ec134a5b9216e5bd40f63d6..068e2ca5c549a336d3407a40a6766f525a06846f 100644 (file)
@@ -784,7 +784,6 @@ Meaning only return locally if successful, otherwise exit non-locally."
     (add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t)
     (add-hook 'kill-buffer-hook 'eglot--signal-textDocument/didClose nil t)
     (add-hook 'before-revert-hook 'eglot--signal-textDocument/didClose nil t)
-    ;;(add-hook 'after-revert-hook 'eglot--signal-textDocument/didOpen nil t)
     (add-hook 'before-save-hook 'eglot--signal-textDocument/willSave nil t)
     (add-hook 'after-save-hook 'eglot--signal-textDocument/didSave nil t)
     (add-hook 'xref-backend-functions 'eglot-xref-backend nil t)
@@ -796,7 +795,6 @@ Meaning only return locally if successful, otherwise exit non-locally."
     (remove-hook 'before-change-functions 'eglot--before-change t)
     (remove-hook 'kill-buffer-hook 'eglot--signal-textDocument/didClose t)
     (remove-hook 'before-revert-hook 'eglot--signal-textDocument/didClose t)
-    ;; (remove-hook 'after-revert-hook 'eglot--signal-textDocument/didOpen t)
     (remove-hook 'before-save-hook 'eglot--signal-textDocument/willSave t)
     (remove-hook 'after-save-hook 'eglot--signal-textDocument/didSave t)
     (remove-hook 'xref-backend-functions 'eglot-xref-backend t)