]> code.delx.au - gnu-emacs/blobdiff - src/doc.c
*** empty log message ***
[gnu-emacs] / src / doc.c
index a907118c9ea40598feed7e72f9bac58adc67cdff..6dceb587fcb15374cf49076277bc453601281554 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -102,22 +102,17 @@ get_doc_string (filepos)
 }
 
 DEFUN ("documentation", Fdocumentation, Sdocumentation, 1, 2, 0,
-  "Return the documentation string of FUNCTION.
-Unless a non-nil second argument is given, the
+  "Return the documentation string of FUNCTION.\n\
+Unless a non-nil second argument is given, the\n\
 string is passed through `substitute-command-keys'.")
-  (fun1, raw)
-     Lisp_Object fun1, raw;
+  (function, raw)
+     Lisp_Object function, raw;
 {
   Lisp_Object fun;
   Lisp_Object funcar;
   Lisp_Object tem, doc;
 
-  fun = fun1;
-  while (XTYPE (fun) == Lisp_Symbol)
-    {
-      QUIT;
-      fun = Fsymbol_function (fun);
-    }
+  fun = Findirect_function (function);
 
   switch (XTYPE (fun))
     {
@@ -149,11 +144,11 @@ string is passed through `substitute-command-keys'.")
       funcar = Fcar (fun);
       if (XTYPE (funcar) != Lisp_Symbol)
        return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
-      if (XSYMBOL (funcar) == XSYMBOL (Qkeymap))
+      else if (EQ (funcar, Qkeymap))
        return build_string ("Prefix command (definition is a keymap associating keystrokes with\n\
 subcommands.)");
-      if (XSYMBOL (funcar) == XSYMBOL (Qlambda)
-         || XSYMBOL (funcar) == XSYMBOL (Qautoload))
+      else if (EQ (funcar, Qlambda)
+              || EQ (funcar, Qautoload))
        {
          tem = Fcar (Fcdr (Fcdr (fun)));
          if (XTYPE (tem) == Lisp_String)
@@ -162,10 +157,12 @@ subcommands.)");
            doc = get_doc_string (XFASTINT (tem));
          else
            return Qnil;
+
+         break;
        }
-      if (XSYMBOL (funcar) == XSYMBOL (Qmocklisp))
+      else if (EQ (funcar, Qmocklisp))
        return Qnil;
-      if (XSYMBOL (funcar) == XSYMBOL (Qmacro))
+      else if (EQ (funcar, Qmacro))
        return Fdocumentation (Fcdr (fun), raw);
 
       /* Fall through to the default to report an error.  */
@@ -182,7 +179,7 @@ subcommands.)");
 DEFUN ("documentation-property", Fdocumentation_property, Sdocumentation_property, 2, 2, 0,
   "Return the documentation string that is SYMBOL's PROP property.\n\
 This is like `get', but it can refer to strings stored in the\n\
-`share-lib/DOC' file; and if the value is a string, it is passed through\n\
+`etc/DOC' file; and if the value is a string, it is passed through\n\
 `substitute-command-keys'.  A non-nil third argument avoids this\n\
 translation.")
   (sym, prop, raw)
@@ -201,10 +198,10 @@ translation.")
 DEFUN ("Snarf-documentation", Fsnarf_documentation, Ssnarf_documentation,
   1, 1, 0,
   "Used during Emacs initialization, before dumping runnable Emacs,\n\
-to find pointers to doc strings stored in `share-lib/DOC...' and\n\
+to find pointers to doc strings stored in `etc/DOC...' and\n\
 record them in function definitions.\n\
 One arg, FILENAME, a string which does not include a directory.\n\
-The file is found in `../share-lib' now; found in the `data-directory'\n\
+The file is found in `../etc' now; found in the `data-directory'\n\
 when doc strings are referred to later in the dumped Emacs.")
   (filename)
      Lisp_Object filename;
@@ -222,7 +219,7 @@ when doc strings are referred to later in the dumped Emacs.")
 
 #ifndef CANNOT_DUMP
   name = (char *) alloca (XSTRING (filename)->size + 14);
-  strcpy (name, "../share-lib/");
+  strcpy (name, "../etc/");
 #else /* CANNOT_DUMP */
   CHECK_STRING (Vdata_directory, 0);
   name = (char *) alloca (XSTRING (filename)->size +