diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-03-26 19:32:02 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-03-26 19:32:02 +0000 |
commit | 9191c8ae4e0d51452699f2a508a3f217c2708b1d (patch) | |
tree | fa811a3355c58650190c0ca38cc0a2ff499336b2 /src/doc.c | |
parent | bd96bd79eb90901860c626ada2040b4d68ed7f5d (diff) | |
download | emacs-9191c8ae4e0d51452699f2a508a3f217c2708b1d.tar.gz |
(Qfunction_documentation): New variable.
(syms_of_doc): Initialize Qfunction_documentation.
(Fdocumentation): If FUNCTION is a symbol with non-nil
`function-documentation' property, return a documentation derived
from that.
Diffstat (limited to 'src/doc.c')
-rw-r--r-- | src/doc.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/doc.c b/src/doc.c index 7f3cea1a2db..e8751902c11 100644 --- a/src/doc.c +++ b/src/doc.c @@ -43,6 +43,8 @@ Boston, MA 02111-1307, USA. */ Lisp_Object Vdoc_file_name, Vhelp_manyarg_func_alist; +Lisp_Object Qfunction_documentation; + extern char *index (); extern Lisp_Object Voverriding_local_map; @@ -309,12 +311,17 @@ string is passed through `substitute-command-keys'.") Lisp_Object funcar; Lisp_Object tem, doc; + if (SYMBOLP (function) + && (tem = Fget (function, Qfunction_documentation), + !NILP (tem))) + return Fdocumentation_property (function, Qfunction_documentation, raw); + fun = Findirect_function (function); - if (SUBRP (fun)) { - if (XSUBR (fun)->doc == 0) return Qnil; - if ((EMACS_INT) XSUBR (fun)->doc >= 0) + if (XSUBR (fun)->doc == 0) + return Qnil; + else if ((EMACS_INT) XSUBR (fun)->doc >= 0) doc = build_string (XSUBR (fun)->doc); else doc = get_doc_string (make_number (- (EMACS_INT) XSUBR (fun)->doc), @@ -787,6 +794,9 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int void syms_of_doc () { + Qfunction_documentation = intern ("function-documentation"); + staticpro (&Qfunction_documentation); + DEFVAR_LISP ("internal-doc-file-name", &Vdoc_file_name, "Name of file containing documentation strings of built-in symbols."); Vdoc_file_name = Qnil; |