Mercurial > emacs
changeset 10002:5b2b7e378772
(Fdocumentation): Use type test macros.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Fri, 18 Nov 1994 02:10:19 +0000 |
parents | d615506e81be |
children | c5a44b9c6565 |
files | src/doc.c |
diffstat | 1 files changed, 17 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doc.c Fri Nov 18 02:02:18 1994 +0000 +++ b/src/doc.c Fri Nov 18 02:10:19 1994 +0000 @@ -150,17 +150,16 @@ 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 @@ 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 @@ 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))