diff options
| author | João Távora | 2020-10-30 18:43:20 +0000 |
|---|---|---|
| committer | João Távora | 2020-10-30 22:31:20 +0000 |
| commit | 2e1ab3e583d911afc7e263922f0672d0299bd515 (patch) | |
| tree | 3fdfce6ede370ccc3d3e71cc65dbb36282a3de09 | |
| parent | 7500abaa8ef1cec772b197d28d3c3c47b4bc5a86 (diff) | |
| download | emacs-2e1ab3e583d911afc7e263922f0672d0299bd515.tar.gz emacs-2e1ab3e583d911afc7e263922f0672d0299bd515.zip | |
Bring back elisp-eldoc-documentation-function, marked obsolete
Fixes: bug#43609
It's not useful for ElDoc's eldoc-mode mechanism in Elisp, and nothing
in Emacs uses it, but it wasn't strictly marked internal, so it's best
to bring it back.
* lisp/progmodes/elisp-mode.el (elisp--documentation-one-liner):
New helper.
(elisp-eldoc-documentation-function): New function, with
obsoletion warning.
| -rw-r--r-- | lisp/progmodes/elisp-mode.el | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index c7ff351845e..ce2b924d514 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el | |||
| @@ -1413,6 +1413,30 @@ which see." | |||
| 1413 | or argument string for functions. | 1413 | or argument string for functions. |
| 1414 | 2 - `function' if function args, `variable' if variable documentation.") | 1414 | 2 - `function' if function args, `variable' if variable documentation.") |
| 1415 | 1415 | ||
| 1416 | (defun elisp--documentation-one-liner () | ||
| 1417 | (let* (str | ||
| 1418 | (callback (lambda (doc &rest plist) | ||
| 1419 | (setq str | ||
| 1420 | (format "%s: %s" | ||
| 1421 | (propertize (prin1-to-string | ||
| 1422 | (plist-get plist :thing)) | ||
| 1423 | 'face (plist-get plist :face)) | ||
| 1424 | doc))))) | ||
| 1425 | (or (progn (elisp-eldoc-var-docstring callback) str) | ||
| 1426 | (progn (elisp-eldoc-funcall callback) str)))) | ||
| 1427 | |||
| 1428 | (defalias 'elisp-eldoc-documentation-function 'elisp--documentation-one-liner | ||
| 1429 | "Return Elisp documentation for the thing at point as one-line string. | ||
| 1430 | This is meant as a backward compatibility aide to the \"old\" | ||
| 1431 | Elisp eldoc behaviour. Consider variable docstrings and function | ||
| 1432 | signatures only, in this order. If none applies, returns nil. | ||
| 1433 | Changes to `eldoc-documentation-functions' and | ||
| 1434 | `eldoc-documentation-strategy' are _not_ reflected here. As such | ||
| 1435 | it is preferrable to use ElDoc's interfaces directly.") | ||
| 1436 | |||
| 1437 | (make-obsolete 'elisp-eldoc-documentation-function | ||
| 1438 | "use ElDoc's interfaces instead." "28.1") | ||
| 1439 | |||
| 1416 | (defun elisp-eldoc-funcall (callback &rest _ignored) | 1440 | (defun elisp-eldoc-funcall (callback &rest _ignored) |
| 1417 | "Document function call at point. | 1441 | "Document function call at point. |
| 1418 | Intended for `eldoc-documentation-functions' (which see)." | 1442 | Intended for `eldoc-documentation-functions' (which see)." |