diff options
| author | Lars Ingebrigtsen | 2020-09-21 14:15:34 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-09-21 14:15:39 +0200 |
| commit | e72d3793bcec67f9312e9d011e4357f8986bf837 (patch) | |
| tree | fbe846690cc4ab0f03cf0e611fc07ac7de60cca5 | |
| parent | 4cb1e30988cc5c30bfc27a393c9b616870a3fc9e (diff) | |
| download | emacs-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.texi | 6 | ||||
| -rw-r--r-- | etc/NEWS | 10 | ||||
| -rw-r--r-- | 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 1c33d7dccc7..f0dd62dad45 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -1291,6 +1291,12 @@ ways. | |||
| 1291 | This abnormal hook holds documentation functions. It acts as a | 1291 | This abnormal hook holds documentation functions. It acts as a |
| 1292 | collection of backends for ElDoc. This is what modes should use to | 1292 | collection of backends for ElDoc. This is what modes should use to |
| 1293 | register their documentation functions with ElDoc. | 1293 | register their documentation functions with ElDoc. |
| 1294 | |||
| 1295 | @vindex eldoc-display-truncation-message | ||
| 1296 | @item eldoc-display-truncation-message | ||
| 1297 | If non-@code{nil} (the default), display a verbose message about how | ||
| 1298 | to view a complete documentation (if it has been truncated in the echo | ||
| 1299 | area). If @code{nil}, just mark truncated messages with @samp{...}. | ||
| 1294 | @end table | 1300 | @end table |
| 1295 | 1301 | ||
| 1296 | @node Hideshow | 1302 | @node Hideshow |
| @@ -545,9 +545,16 @@ supplied error message. | |||
| 545 | which appends a unique suffix to the Edebug name of the current | 545 | which appends a unique suffix to the Edebug name of the current |
| 546 | definition. | 546 | definition. |
| 547 | 547 | ||
| 548 | +++ | ||
| 549 | ** ElDoc | 548 | ** ElDoc |
| 550 | 549 | ||
| 550 | +++ | ||
| 551 | *** New user option 'eldoc-display-truncation-message'. | ||
| 552 | If non-nil (the default), eldoc will display a message saying | ||
| 553 | something like "(Documentation truncated. Use `M-x eldoc-doc-buffer' | ||
| 554 | to see rest" when a message has been truncated. If nil, truncated | ||
| 555 | messages will be marked with just "..." at the end. | ||
| 556 | |||
| 557 | +++ | ||
| 551 | *** New hook 'eldoc-documentation-functions'. | 558 | *** New hook 'eldoc-documentation-functions'. |
| 552 | This hook is intended to be used for registering doc string functions. | 559 | This hook is intended to be used for registering doc string functions. |
| 553 | These functions don't need to produce the doc string right away, they | 560 | 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 | |||
| 555 | doc string functions are accessible to the user through the user | 562 | doc string functions are accessible to the user through the user |
| 556 | option 'eldoc-documentation-strategy'. | 563 | option 'eldoc-documentation-strategy'. |
| 557 | 564 | ||
| 565 | +++ | ||
| 558 | *** New user option 'eldoc-documentation-strategy'. | 566 | *** New user option 'eldoc-documentation-strategy'. |
| 559 | The built-in choices available for this user option let users compose | 567 | The built-in choices available for this user option let users compose |
| 560 | the results of 'eldoc-documentation-functions' in various ways, even | 568 | 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 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." | |||
| 67 | Changing the value requires toggling `eldoc-mode'." | 67 | Changing 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. | ||
| 72 | If 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) |