From: Lars Ingebrigtsen Date: Thu, 26 Nov 2020 10:24:20 +0000 (+0100) Subject: Keep point in the *eldoc* buffer in eldoc-display-in-echo-area X-Git-Tag: emacs-28.0.90~5018 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0287c5176867628e7acb834b3d5f26a150cfaf85;p=emacs.git Keep point in the *eldoc* buffer in eldoc-display-in-echo-area * lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area): Use 'save-excursion' to keep point position in *eldoc* buffer. Suggested by Andrii Kolomoiets . --- diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 78cb8f08c34..d81060ef165 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -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)