aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-09-21 14:15:34 +0200
committerLars Ingebrigtsen2020-09-21 14:15:39 +0200
commite72d3793bcec67f9312e9d011e4357f8986bf837 (patch)
treefbe846690cc4ab0f03cf0e611fc07ac7de60cca5
parent4cb1e30988cc5c30bfc27a393c9b616870a3fc9e (diff)
downloademacs-e72d3793bcec67f9312e9d011e4357f8986bf837.tar.gz
emacs-e72d3793bcec67f9312e9d011e4357f8986bf837.zip
Allow disabling the verbose eldoc truncation message
* doc/emacs/programs.texi (Lisp Doc): Document it. * lisp/emacs-lisp/eldoc.el (eldoc-display-truncation-message): New variable (bug#43543). (eldoc--handle-docs): Use it.
-rw-r--r--doc/emacs/programs.texi6
-rw-r--r--etc/NEWS10
-rw-r--r--lisp/emacs-lisp/eldoc.el13
3 files changed, 26 insertions, 3 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 1c33d7dccc7..f0dd62dad45 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1291,6 +1291,12 @@ ways.
1291This abnormal hook holds documentation functions. It acts as a 1291This abnormal hook holds documentation functions. It acts as a
1292collection of backends for ElDoc. This is what modes should use to 1292collection of backends for ElDoc. This is what modes should use to
1293register their documentation functions with ElDoc. 1293register their documentation functions with ElDoc.
1294
1295@vindex eldoc-display-truncation-message
1296@item eldoc-display-truncation-message
1297If non-@code{nil} (the default), display a verbose message about how
1298to view a complete documentation (if it has been truncated in the echo
1299area). If @code{nil}, just mark truncated messages with @samp{...}.
1294@end table 1300@end table
1295 1301
1296@node Hideshow 1302@node Hideshow
diff --git a/etc/NEWS b/etc/NEWS
index 1f52341ae44..0d0d9daeeea 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -545,9 +545,16 @@ supplied error message.
545which appends a unique suffix to the Edebug name of the current 545which appends a unique suffix to the Edebug name of the current
546definition. 546definition.
547 547
548+++
549** ElDoc 548** ElDoc
550 549
550+++
551*** New user option 'eldoc-display-truncation-message'.
552If non-nil (the default), eldoc will display a message saying
553something like "(Documentation truncated. Use `M-x eldoc-doc-buffer'
554to see rest" when a message has been truncated. If nil, truncated
555messages will be marked with just "..." at the end.
556
557+++
551*** New hook 'eldoc-documentation-functions'. 558*** New hook 'eldoc-documentation-functions'.
552This hook is intended to be used for registering doc string functions. 559This hook is intended to be used for registering doc string functions.
553These functions don't need to produce the doc string right away, they 560These functions don't need to produce the doc string right away, they
@@ -555,6 +562,7 @@ may arrange for it to be produced asynchronously. The results of all
555doc string functions are accessible to the user through the user 562doc string functions are accessible to the user through the user
556option 'eldoc-documentation-strategy'. 563option 'eldoc-documentation-strategy'.
557 564
565+++
558*** New user option 'eldoc-documentation-strategy'. 566*** New user option 'eldoc-documentation-strategy'.
559The built-in choices available for this user option let users compose 567The built-in choices available for this user option let users compose
560the results of 'eldoc-documentation-functions' in various ways, even 568the results of 'eldoc-documentation-functions' in various ways, even
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 772c907c284..f8768051d14 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -67,6 +67,12 @@ If this variable is set to 0, no idle time is required."
67Changing the value requires toggling `eldoc-mode'." 67Changing the value requires toggling `eldoc-mode'."
68 :type 'boolean) 68 :type 'boolean)
69 69
70(defcustom eldoc-display-truncation-message t
71 "If non-nil, provide verbose help when a message has been truncated.
72If nil, truncated messages will just have \"...\" appended."
73 :type 'boolean
74 :version "28.1")
75
70;;;###autoload 76;;;###autoload
71(defcustom eldoc-minor-mode-string (purecopy " ElDoc") 77(defcustom eldoc-minor-mode-string (purecopy " ElDoc")
72 "String to display in mode line when ElDoc Mode is enabled; nil for none." 78 "String to display in mode line when ElDoc Mode is enabled; nil for none."
@@ -524,10 +530,13 @@ Honor most of `eldoc-echo-area-use-multiline-p'."
524 (cl-return 530 (cl-return
525 (concat 531 (concat
526 (buffer-substring (point-min) (point)) 532 (buffer-substring (point-min) (point))
527 (and truncated 533 (and
534 truncated
535 (if eldoc-display-truncation-message
528 (format 536 (format
529 "\n(Documentation truncated. Use `%s' to see rest)" 537 "\n(Documentation truncated. Use `%s' to see rest)"
530 (substitute-command-keys "\\[eldoc-doc-buffer]"))))))))) 538 (substitute-command-keys "\\[eldoc-doc-buffer]"))
539 "..."))))))))
531 ((= available 1) 540 ((= available 1)
532 ;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too? 541 ;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too?
533 (with-current-buffer (eldoc-doc-buffer) 542 (with-current-buffer (eldoc-doc-buffer)