diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-04-07 15:59:09 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-04-07 15:59:09 -0400 |
commit | 39e8fd357dd0a1f3776c05eee2cc5be451686712 (patch) | |
tree | 7783c644dc02cef24ebb231d3aeb20292b0ec07d /doc/lispref/help.texi | |
parent | 3b411417086ceb2ce3838160d01c6f250e47bbf3 (diff) | |
download | emacs-39e8fd357dd0a1f3776c05eee2cc5be451686712.tar.gz |
OClosure: New function `function-documentation`
As mentioned in the original OClosure commit, OClosures (ab)use the
bytecode's docstring slot to hold the OClosure's type. This currently
prevents OClosures from having their own docstring.
Introduce a new generic function `function-documentation` to fetch the
docstring of a function, which can then be implemented in various
different ways depending on the OClosure's type.
* lisp/simple.el (function-documentation): New generic function.
(bad-package-check): Strength-reduce `eval` to `symbol-value`.
* src/doc.c (Fdocumentation): Use it.
* lisp/emacs-lisp/oclosure.el (oclosure--accessor-docstring): New function.
* test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test):
Add test for accessor's docstrings.
Diffstat (limited to 'doc/lispref/help.texi')
-rw-r--r-- | doc/lispref/help.texi | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 10a12940a15..d53bfad8e9e 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -158,6 +158,13 @@ the function definition has no documentation string. In that case, @code{documentation} returns @code{nil}. @end defun +@defun function-documentation function +Generic function used by @code{documentation} to extract the raw +docstring from a function object. You can specify how to get the +docstring of a specific function type by adding a corresponding method +to it. +@end defun + @defun face-documentation face This function returns the documentation string of @var{face} as a face. |