aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-03-26 19:32:02 +0000
committerGerd Moellmann2000-03-26 19:32:02 +0000
commit9191c8ae4e0d51452699f2a508a3f217c2708b1d (patch)
treefa811a3355c58650190c0ca38cc0a2ff499336b2 /src
parentbd96bd79eb90901860c626ada2040b4d68ed7f5d (diff)
downloademacs-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.c16
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. */
43 43
44Lisp_Object Vdoc_file_name, Vhelp_manyarg_func_alist; 44Lisp_Object Vdoc_file_name, Vhelp_manyarg_func_alist;
45 45
46Lisp_Object Qfunction_documentation;
47
46extern char *index (); 48extern char *index ();
47 49
48extern Lisp_Object Voverriding_local_map; 50extern 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
787void 794void
788syms_of_doc () 795syms_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;