]> git.eshelyaron.com Git - emacs.git/commitdiff
Display truncated docstring if too large for echo area
authorJoão Távora <joaotavora@gmail.com>
Mon, 7 Jan 2019 08:44:37 +0000 (08:44 +0000)
committerJoão Távora <joaotavora@gmail.com>
Mon, 7 Jan 2019 08:44:37 +0000 (08:44 +0000)
* eglot.el (eglot--eldoc-message): Display first line doc.

lisp/progmodes/eglot.el

index 9631c192e6c00ae5acde758099f5f3f4c3a53e8b..2ab4bd864a9bdcab97a2d9df8fde23d27a29cd76 100644 (file)
@@ -2071,8 +2071,12 @@ Buffer is displayed with `display-buffer', which obeys
           (if eglot-auto-display-help-buffer
               (display-buffer (current-buffer))
             (unless (get-buffer-window (current-buffer))
-              (eglot--message "Help for %s is in %s buffer" eglot--eldoc-hint
-                              (buffer-name eglot--help-buffer))))
+              (eglot--message
+               "%s\n(...truncated. Full help is in `%s')"
+               (truncate-string-to-width
+                (replace-regexp-in-string "\\(.*\\)\n.*" "\\1" string)
+                (frame-width) nil nil "...")
+               (buffer-name eglot--help-buffer))))
           (help-mode)
           t)))))