aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-11-18 02:10:19 +0000
committerKarl Heuer1994-11-18 02:10:19 +0000
commit5b5f6883582eeaac37dc1037320e1567a5271825 (patch)
tree63aafa630becec41d1e7e5a700f76d390d50af8a /src
parente0f93814bf93d5205c1d2f7b92c61685848b1ed0 (diff)
downloademacs-5b5f6883582eeaac37dc1037320e1567a5271825.tar.gz
emacs-5b5f6883582eeaac37dc1037320e1567a5271825.zip
(Fdocumentation): Use type test macros.
Diffstat (limited to 'src')
-rw-r--r--src/doc.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/doc.c b/src/doc.c
index a22034ae9d2..d6c76592e78 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -150,17 +150,16 @@ string is passed through `substitute-command-keys'.")
150 150
151 fun = Findirect_function (function); 151 fun = Findirect_function (function);
152 152
153 switch (XTYPE (fun)) 153 if (SUBRP (fun))
154 { 154 {
155 case Lisp_Subr:
156 if (XSUBR (fun)->doc == 0) return Qnil; 155 if (XSUBR (fun)->doc == 0) return Qnil;
157 if ((EMACS_INT) XSUBR (fun)->doc >= 0) 156 if ((EMACS_INT) XSUBR (fun)->doc >= 0)
158 doc = build_string (XSUBR (fun)->doc); 157 doc = build_string (XSUBR (fun)->doc);
159 else 158 else
160 doc = get_doc_string (- (EMACS_INT) XSUBR (fun)->doc); 159 doc = get_doc_string (- (EMACS_INT) XSUBR (fun)->doc);
161 break; 160 }
162 161 else if (COMPILEDP (fun))
163 case Lisp_Compiled: 162 {
164 if (XVECTOR (fun)->size <= COMPILED_DOC_STRING) 163 if (XVECTOR (fun)->size <= COMPILED_DOC_STRING)
165 return Qnil; 164 return Qnil;
166 tem = XVECTOR (fun)->contents[COMPILED_DOC_STRING]; 165 tem = XVECTOR (fun)->contents[COMPILED_DOC_STRING];
@@ -170,13 +169,13 @@ string is passed through `substitute-command-keys'.")
170 doc = get_doc_string (XFASTINT (tem)); 169 doc = get_doc_string (XFASTINT (tem));
171 else 170 else
172 return Qnil; 171 return Qnil;
173 break; 172 }
174 173 else if (STRINGP (fun) || VECTORP (fun))
175 case Lisp_String: 174 {
176 case Lisp_Vector:
177 return build_string ("Keyboard macro."); 175 return build_string ("Keyboard macro.");
178 176 }
179 case Lisp_Cons: 177 else if (CONSP (fun))
178 {
180 funcar = Fcar (fun); 179 funcar = Fcar (fun);
181 if (!SYMBOLP (funcar)) 180 if (!SYMBOLP (funcar))
182 return Fsignal (Qinvalid_function, Fcons (fun, Qnil)); 181 return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
@@ -193,18 +192,18 @@ subcommands.)");
193 doc = get_doc_string (XFASTINT (tem)); 192 doc = get_doc_string (XFASTINT (tem));
194 else 193 else
195 return Qnil; 194 return Qnil;
196
197 break;
198 } 195 }
199 else if (EQ (funcar, Qmocklisp)) 196 else if (EQ (funcar, Qmocklisp))
200 return Qnil; 197 return Qnil;
201 else if (EQ (funcar, Qmacro)) 198 else if (EQ (funcar, Qmacro))
202 return Fdocumentation (Fcdr (fun), raw); 199 return Fdocumentation (Fcdr (fun), raw);
203 200 else
204 /* Fall through to the default to report an error. */ 201 goto oops;
205 202 }
206 default: 203 else
207 return Fsignal (Qinvalid_function, Fcons (fun, Qnil)); 204 {
205 oops:
206 Fsignal (Qinvalid_function, Fcons (fun, Qnil));
208 } 207 }
209 208
210 if (NILP (raw)) 209 if (NILP (raw))