]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't reupdate help buffer if already rendered
authorJoão Távora <joaotavora@gmail.com>
Fri, 24 Apr 2020 14:39:16 +0000 (15:39 +0100)
committerJoão Távora <joaotavora@gmail.com>
Fri, 24 Apr 2020 16:00:39 +0000 (17:00 +0100)
* eglot.el (eglot--update-doc): Don't reupdate if doc buffer
already exists.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/445

lisp/progmodes/eglot.el

index 6d6f91f55aaa72b0876fedc9eb0ee0dd6baa4359..ce4f19c65c2a86bd80d6bede0146b447ae1b8b28 100644 (file)
@@ -2252,11 +2252,13 @@ potentially rename EGLOT's help buffer."
           (and eglot-put-doc-in-help-buffer
                (funcall eglot-put-doc-in-help-buffer string)))
       (with-current-buffer (eglot--help-buffer)
-        (rename-buffer (format "*eglot-help for %s*" hint))
-        (let ((inhibit-read-only t))
-          (erase-buffer)
-          (insert string)
-          (goto-char (point-min))
+        (let ((inhibit-read-only t)
+              (name (format "*eglot-help for %s*" hint)))
+          (unless (string= name (buffer-name))
+            (rename-buffer (format "*eglot-help for %s*" hint))
+            (erase-buffer)
+            (insert string)
+            (goto-char (point-min)))
           (if eglot-auto-display-help-buffer
               (display-buffer (current-buffer))
             (unless (get-buffer-window (current-buffer))