aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.c
diff options
context:
space:
mode:
authorKarl Heuer <[email protected]>1994-11-18 02:10:19 +0000
committerKarl Heuer <[email protected]>1994-11-18 02:10:19 +0000
commit5b5f6883582eeaac37dc1037320e1567a5271825 (patch)
tree63aafa630becec41d1e7e5a700f76d390d50af8a /src/doc.c
parente0f93814bf93d5205c1d2f7b92c61685848b1ed0 (diff)
(Fdocumentation): Use type test macros.
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/doc.c b/src/doc.c
index a22034ae9d..d6c76592e7 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -150,17 +150,16 @@ string is passed through `substitute-command-keys'.")
fun = Findirect_function (function);
- switch (XTYPE (fun))
+ if (SUBRP (fun))
{
- case Lisp_Subr:
if (XSUBR (fun)->doc == 0) return Qnil;
if ((EMACS_INT) XSUBR (fun)->doc >= 0)
doc = build_string (XSUBR (fun)->doc);
else
doc = get_doc_string (- (EMACS_INT) XSUBR (fun)->doc);
- break;
-
- case Lisp_Compiled:
+ }
+ else if (COMPILEDP (fun))
+ {
if (XVECTOR (fun)->size <= COMPILED_DOC_STRING)
return Qnil;
tem = XVECTOR (fun)->contents[COMPILED_DOC_STRING];
@@ -170,13 +169,13 @@ string is passed through `substitute-command-keys'.")
doc = get_doc_string (XFASTINT (tem));
else
return Qnil;
- break;
-
- case Lisp_String:
- case Lisp_Vector:
+ }
+ else if (STRINGP (fun) || VECTORP (fun))
+ {
return build_string ("Keyboard macro.");
-
- case Lisp_Cons:
+ }
+ else if (CONSP (fun))
+ {
funcar = Fcar (fun);
if (!SYMBOLP (funcar))
return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
@@ -193,18 +192,18 @@ subcommands.)");
doc = get_doc_string (XFASTINT (tem));
else
return Qnil;
-
- break;
}
else if (EQ (funcar, Qmocklisp))
return Qnil;
else if (EQ (funcar, Qmacro))
return Fdocumentation (Fcdr (fun), raw);
-
- /* Fall through to the default to report an error. */
-
- default:
- return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
+ else
+ goto oops;
+ }
+ else
+ {
+ oops:
+ Fsignal (Qinvalid_function, Fcons (fun, Qnil));
}
if (NILP (raw))