comparison src/doc.c @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents c5d627a313b1
children 74fd4e045ea6
comparison
equal deleted inserted replaced
379:76b7d63099ad 380:8626e4521993
282 doc = get_doc_string (make_int (- (EMACS_INT) XSUBR (fun)->doc)); 282 doc = get_doc_string (make_int (- (EMACS_INT) XSUBR (fun)->doc));
283 } 283 }
284 else if (COMPILED_FUNCTIONP (fun)) 284 else if (COMPILED_FUNCTIONP (fun))
285 { 285 {
286 Lisp_Object tem; 286 Lisp_Object tem;
287 struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (fun); 287 struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
288 if (! (b->flags.documentationp)) 288 if (! (f->flags.documentationp))
289 return Qnil; 289 return Qnil;
290 tem = compiled_function_documentation (b); 290 tem = compiled_function_documentation (f);
291 if (STRINGP (tem)) 291 if (STRINGP (tem))
292 doc = tem; 292 doc = tem;
293 else if (NATNUMP (tem) || CONSP (tem)) 293 else if (NATNUMP (tem) || CONSP (tem))
294 doc = get_doc_string (tem); 294 doc = get_doc_string (tem);
295 else 295 else
336 { 336 {
337 struct gcpro gcpro1; 337 struct gcpro gcpro1;
338 #ifdef I18N3 338 #ifdef I18N3
339 Lisp_Object domain = Qnil; 339 Lisp_Object domain = Qnil;
340 if (COMPILED_FUNCTIONP (fun)) 340 if (COMPILED_FUNCTIONP (fun))
341 domain = Fcompiled_function_domain (fun); 341 domain = compiled_function_domain (XCOMPILED_FUNCTION (fun));
342 if (NILP (domain)) 342 if (NILP (domain))
343 doc = Fgettext (doc); 343 doc = Fgettext (doc);
344 else 344 else
345 doc = Fdgettext (domain, doc); 345 doc = Fdgettext (domain, doc);
346 #endif 346 #endif
548 } 548 }
549 else if (!CONSP (tem)) 549 else if (!CONSP (tem))
550 { 550 {
551 weird_doc (sym, GETTEXT ("!CONSP(tem)"), 551 weird_doc (sym, GETTEXT ("!CONSP(tem)"),
552 GETTEXT ("function"), pos); 552 GETTEXT ("function"), pos);
553 goto cont; 553 goto cont;
554 } 554 }
555 else 555 else
556 { 556 {
557 /* DOC string is a string not integer 0 */ 557 /* DOC string is a string not integer 0 */
558 #if 0 558 #if 0
571 } 571 }
572 else if (COMPILED_FUNCTIONP (fun)) 572 else if (COMPILED_FUNCTIONP (fun))
573 { 573 {
574 /* Compiled-Function objects sometimes have 574 /* Compiled-Function objects sometimes have
575 slots for it. */ 575 slots for it. */
576 struct Lisp_Compiled_Function *b = 576 struct Lisp_Compiled_Function *f =
577 XCOMPILED_FUNCTION (fun); 577 XCOMPILED_FUNCTION (fun);
578 578
579 /* This compiled-function object must have a 579 /* This compiled-function object must have a
580 slot for the docstring, since we've found a 580 slot for the docstring, since we've found a
581 docstring for it. Unless there were multiple 581 docstring for it. Unless there were multiple
582 definitions of it, and the latter one didn't 582 definitions of it, and the latter one didn't
583 have any doc, which is a legal if slightly 583 have any doc, which is a legal if slightly
584 bogus situation, so don't blow up. */ 584 bogus situation, so don't blow up. */
585 585
586 if (! (b->flags.documentationp)) 586 if (! (f->flags.documentationp))
587 { 587 {
588 weird_doc (sym, GETTEXT ("no doc slot"), 588 weird_doc (sym, GETTEXT ("no doc slot"),
589 GETTEXT ("bytecode"), pos); 589 GETTEXT ("bytecode"), pos);
590 goto weird; 590 goto weird;
591 } 591 }
592 else 592 else
593 { 593 {
594 Lisp_Object old = 594 Lisp_Object old =
595 compiled_function_documentation (b); 595 compiled_function_documentation (f);
596 if (!ZEROP (old)) 596 if (!ZEROP (old))
597 { 597 {
598 weird_doc (sym, GETTEXT ("duplicate"), 598 weird_doc (sym, GETTEXT ("duplicate"),
599 GETTEXT ("bytecode"), pos); 599 GETTEXT ("bytecode"), pos);
600 /* In the case of duplicate doc file entries, 600 /* In the case of duplicate doc file entries,
601 always take the later one. But if the doc is 601 always take the later one. But if the doc is
602 not an int (a string, say) leave it alone. */ 602 not an int (a string, say) leave it alone. */
603 if (!INTP (old)) 603 if (!INTP (old))
604 goto weird; 604 goto weird;
605 } 605 }
606 set_compiled_function_documentation (b, offset); 606 set_compiled_function_documentation (f, offset);
607 } 607 }
608 } 608 }
609 else 609 else
610 { 610 {
611 /* Otherwise the function is undefined or 611 /* Otherwise the function is undefined or
682 doc = XINT (XCAR (tem)); 682 doc = XINT (XCAR (tem));
683 } 683 }
684 } 684 }
685 else if (COMPILED_FUNCTIONP (fun)) 685 else if (COMPILED_FUNCTIONP (fun))
686 { 686 {
687 struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (fun); 687 struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
688 if (! (b->flags.documentationp)) 688 if (! (f->flags.documentationp))
689 doc = -1; 689 doc = -1;
690 else 690 else
691 { 691 {
692 Lisp_Object tem = compiled_function_documentation (b); 692 Lisp_Object tem = compiled_function_documentation (f);
693 if (INTP (tem)) 693 if (INTP (tem))
694 doc = XINT (tem); 694 doc = XINT (tem);
695 } 695 }
696 } 696 }
697 697