diff options
| author | Gerd Moellmann | 2000-03-26 19:32:02 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-03-26 19:32:02 +0000 |
| commit | 9191c8ae4e0d51452699f2a508a3f217c2708b1d (patch) | |
| tree | fa811a3355c58650190c0ca38cc0a2ff499336b2 /src | |
| parent | bd96bd79eb90901860c626ada2040b4d68ed7f5d (diff) | |
| download | emacs-9191c8ae4e0d51452699f2a508a3f217c2708b1d.tar.gz emacs-9191c8ae4e0d51452699f2a508a3f217c2708b1d.zip | |
(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')
| -rw-r--r-- | src/doc.c | 16 |
1 files changed, 13 insertions, 3 deletions
| @@ -43,6 +43,8 @@ Boston, MA 02111-1307, USA. */ | |||
| 43 | 43 | ||
| 44 | Lisp_Object Vdoc_file_name, Vhelp_manyarg_func_alist; | 44 | Lisp_Object Vdoc_file_name, Vhelp_manyarg_func_alist; |
| 45 | 45 | ||
| 46 | Lisp_Object Qfunction_documentation; | ||
| 47 | |||
| 46 | extern char *index (); | 48 | extern char *index (); |
| 47 | 49 | ||
| 48 | extern Lisp_Object Voverriding_local_map; | 50 | extern Lisp_Object Voverriding_local_map; |
| @@ -309,12 +311,17 @@ string is passed through `substitute-command-keys'.") | |||
| 309 | Lisp_Object funcar; | 311 | Lisp_Object funcar; |
| 310 | Lisp_Object tem, doc; | 312 | Lisp_Object tem, doc; |
| 311 | 313 | ||
| 314 | if (SYMBOLP (function) | ||
| 315 | && (tem = Fget (function, Qfunction_documentation), | ||
| 316 | !NILP (tem))) | ||
| 317 | return Fdocumentation_property (function, Qfunction_documentation, raw); | ||
| 318 | |||
| 312 | fun = Findirect_function (function); | 319 | fun = Findirect_function (function); |
| 313 | |||
| 314 | if (SUBRP (fun)) | 320 | if (SUBRP (fun)) |
| 315 | { | 321 | { |
| 316 | if (XSUBR (fun)->doc == 0) return Qnil; | 322 | if (XSUBR (fun)->doc == 0) |
| 317 | if ((EMACS_INT) XSUBR (fun)->doc >= 0) | 323 | return Qnil; |
| 324 | else if ((EMACS_INT) XSUBR (fun)->doc >= 0) | ||
| 318 | doc = build_string (XSUBR (fun)->doc); | 325 | doc = build_string (XSUBR (fun)->doc); |
| 319 | else | 326 | else |
| 320 | doc = get_doc_string (make_number (- (EMACS_INT) XSUBR (fun)->doc), | 327 | doc = get_doc_string (make_number (- (EMACS_INT) XSUBR (fun)->doc), |
| @@ -787,6 +794,9 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 787 | void | 794 | void |
| 788 | syms_of_doc () | 795 | syms_of_doc () |
| 789 | { | 796 | { |
| 797 | Qfunction_documentation = intern ("function-documentation"); | ||
| 798 | staticpro (&Qfunction_documentation); | ||
| 799 | |||
| 790 | DEFVAR_LISP ("internal-doc-file-name", &Vdoc_file_name, | 800 | DEFVAR_LISP ("internal-doc-file-name", &Vdoc_file_name, |
| 791 | "Name of file containing documentation strings of built-in symbols."); | 801 | "Name of file containing documentation strings of built-in symbols."); |
| 792 | Vdoc_file_name = Qnil; | 802 | Vdoc_file_name = Qnil; |