From: João Távora Date: Fri, 24 Apr 2020 14:39:16 +0000 (+0100) Subject: Don't reupdate help buffer if already rendered X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~241 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=81385edb7132461500f229919c074e329f42b009;p=emacs.git Don't reupdate help buffer if already rendered * eglot.el (eglot--update-doc): Don't reupdate if doc buffer already exists. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/445 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 6d6f91f55aa..ce4f19c65c2 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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))