[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e72d379 2/2: Allow disabling the verbose eldoc truncation message
From: |
Lars Ingebrigtsen |
Subject: |
master e72d379 2/2: Allow disabling the verbose eldoc truncation message |
Date: |
Mon, 21 Sep 2020 08:15:46 -0400 (EDT) |
branch: master
commit e72d3793bcec67f9312e9d011e4357f8986bf837
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
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.
---
doc/emacs/programs.texi | 6 ++++++
etc/NEWS | 10 +++++++++-
lisp/emacs-lisp/eldoc.el | 13 +++++++++++--
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 1c33d7d..f0dd62d 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1291,6 +1291,12 @@ ways.
This abnormal hook holds documentation functions. It acts as a
collection of backends for ElDoc. This is what modes should use to
register their documentation functions with ElDoc.
+
+@vindex eldoc-display-truncation-message
+@item eldoc-display-truncation-message
+If non-@code{nil} (the default), display a verbose message about how
+to view a complete documentation (if it has been truncated in the echo
+area). If @code{nil}, just mark truncated messages with @samp{...}.
@end table
@node Hideshow
diff --git a/etc/NEWS b/etc/NEWS
index 1f52341..0d0d9da 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -545,9 +545,16 @@ supplied error message.
which appends a unique suffix to the Edebug name of the current
definition.
-+++
** ElDoc
++++
+*** New user option 'eldoc-display-truncation-message'.
+If non-nil (the default), eldoc will display a message saying
+something like "(Documentation truncated. Use `M-x eldoc-doc-buffer'
+to see rest" when a message has been truncated. If nil, truncated
+messages will be marked with just "..." at the end.
+
++++
*** New hook 'eldoc-documentation-functions'.
This hook is intended to be used for registering doc string functions.
These 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
doc string functions are accessible to the user through the user
option 'eldoc-documentation-strategy'.
++++
*** New user option 'eldoc-documentation-strategy'.
The built-in choices available for this user option let users compose
the results of 'eldoc-documentation-functions' in various ways, even
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 772c907..f876805 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."
Changing the value requires toggling `eldoc-mode'."
:type 'boolean)
+(defcustom eldoc-display-truncation-message t
+ "If non-nil, provide verbose help when a message has been truncated.
+If nil, truncated messages will just have \"...\" appended."
+ :type 'boolean
+ :version "28.1")
+
;;;###autoload
(defcustom eldoc-minor-mode-string (purecopy " ElDoc")
"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'."
(cl-return
(concat
(buffer-substring (point-min) (point))
- (and truncated
+ (and
+ truncated
+ (if eldoc-display-truncation-message
(format
"\n(Documentation truncated. Use `%s' to see rest)"
- (substitute-command-keys
"\\[eldoc-doc-buffer]")))))))))
+ (substitute-command-keys "\\[eldoc-doc-buffer]"))
+ "..."))))))))
((= available 1)
;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer'
too?
(with-current-buffer (eldoc-doc-buffer)