]> git.eshelyaron.com Git - emacs.git/commitdiff
Keep point in the *eldoc* buffer in eldoc-display-in-echo-area
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 26 Nov 2020 10:24:20 +0000 (11:24 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 26 Nov 2020 10:24:20 +0000 (11:24 +0100)
* lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area): Use
'save-excursion' to keep point position in *eldoc* buffer.
Suggested by Andrii Kolomoiets <andreyk.mad@gmail.com>.

lisp/emacs-lisp/eldoc.el

index 78cb8f08c34731463309bd3ebcb8e06e56f867b4..d81060ef16586d260463afb29f0d31d9feb8d0e6 100644 (file)
@@ -591,7 +591,8 @@ Honor `eldoc-echo-area-use-multiline-p' and
                ;; format the *eldoc* buffer, using as most of its
                ;; contents as we know will fit.
                (with-current-buffer (eldoc--format-doc-buffer docs)
-                 (eldoc--echo-area-substring available)))
+                 (save-excursion
+                   (eldoc--echo-area-substring available))))
               (t ;; this is the "truncate brutally" situation
                (let ((string
                       (with-current-buffer (eldoc--format-doc-buffer docs)