diff options
| author | Stefan Monnier | 2011-03-21 12:42:16 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-03-21 12:42:16 -0400 |
| commit | cafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch) | |
| tree | 7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /src/doc.c | |
| parent | a08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff) | |
| parent | 4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff) | |
| download | emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip | |
Merge from trunk
Diffstat (limited to 'src/doc.c')
| -rw-r--r-- | src/doc.c | 36 |
1 files changed, 21 insertions, 15 deletions
| @@ -323,17 +323,20 @@ string is passed through `substitute-command-keys'. */) | |||
| 323 | { | 323 | { |
| 324 | Lisp_Object fun; | 324 | Lisp_Object fun; |
| 325 | Lisp_Object funcar; | 325 | Lisp_Object funcar; |
| 326 | Lisp_Object tem, doc; | 326 | Lisp_Object doc; |
| 327 | int try_reload = 1; | 327 | int try_reload = 1; |
| 328 | 328 | ||
| 329 | documentation: | 329 | documentation: |
| 330 | 330 | ||
| 331 | doc = Qnil; | 331 | doc = Qnil; |
| 332 | 332 | ||
| 333 | if (SYMBOLP (function) | 333 | if (SYMBOLP (function)) |
| 334 | && (tem = Fget (function, Qfunction_documentation), | 334 | { |
| 335 | !NILP (tem))) | 335 | Lisp_Object tem = Fget (function, Qfunction_documentation); |
| 336 | return Fdocumentation_property (function, Qfunction_documentation, raw); | 336 | if (!NILP (tem)) |
| 337 | return Fdocumentation_property (function, Qfunction_documentation, | ||
| 338 | raw); | ||
| 339 | } | ||
| 337 | 340 | ||
| 338 | fun = Findirect_function (function, Qnil); | 341 | fun = Findirect_function (function, Qnil); |
| 339 | if (SUBRP (fun)) | 342 | if (SUBRP (fun)) |
| @@ -349,13 +352,16 @@ string is passed through `substitute-command-keys'. */) | |||
| 349 | { | 352 | { |
| 350 | if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING) | 353 | if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING) |
| 351 | return Qnil; | 354 | return Qnil; |
| 352 | tem = AREF (fun, COMPILED_DOC_STRING); | ||
| 353 | if (STRINGP (tem)) | ||
| 354 | doc = tem; | ||
| 355 | else if (NATNUMP (tem) || CONSP (tem)) | ||
| 356 | doc = tem; | ||
| 357 | else | 355 | else |
| 358 | return Qnil; | 356 | { |
| 357 | Lisp_Object tem = AREF (fun, COMPILED_DOC_STRING); | ||
| 358 | if (STRINGP (tem)) | ||
| 359 | doc = tem; | ||
| 360 | else if (NATNUMP (tem) || CONSP (tem)) | ||
| 361 | doc = tem; | ||
| 362 | else | ||
| 363 | return Qnil; | ||
| 364 | } | ||
| 359 | } | 365 | } |
| 360 | else if (STRINGP (fun) || VECTORP (fun)) | 366 | else if (STRINGP (fun) || VECTORP (fun)) |
| 361 | { | 367 | { |
| @@ -372,9 +378,8 @@ string is passed through `substitute-command-keys'. */) | |||
| 372 | || (EQ (funcar, Qclosure) && (fun = XCDR (fun), 1)) | 378 | || (EQ (funcar, Qclosure) && (fun = XCDR (fun), 1)) |
| 373 | || EQ (funcar, Qautoload)) | 379 | || EQ (funcar, Qautoload)) |
| 374 | { | 380 | { |
| 375 | Lisp_Object tem1; | 381 | Lisp_Object tem1 = Fcdr (Fcdr (fun)); |
| 376 | tem1 = Fcdr (Fcdr (fun)); | 382 | Lisp_Object tem = Fcar (tem1); |
| 377 | tem = Fcar (tem1); | ||
| 378 | if (STRINGP (tem)) | 383 | if (STRINGP (tem)) |
| 379 | doc = tem; | 384 | doc = tem; |
| 380 | /* Handle a doc reference--but these never come last | 385 | /* Handle a doc reference--but these never come last |
| @@ -542,7 +547,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 542 | char buf[1024 + 1]; | 547 | char buf[1024 + 1]; |
| 543 | register EMACS_INT filled; | 548 | register EMACS_INT filled; |
| 544 | register EMACS_INT pos; | 549 | register EMACS_INT pos; |
| 545 | register char *p, *end; | 550 | register char *p; |
| 546 | Lisp_Object sym; | 551 | Lisp_Object sym; |
| 547 | char *name; | 552 | char *name; |
| 548 | int skip_file = 0; | 553 | int skip_file = 0; |
| @@ -601,6 +606,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 601 | pos = 0; | 606 | pos = 0; |
| 602 | while (1) | 607 | while (1) |
| 603 | { | 608 | { |
| 609 | register char *end; | ||
| 604 | if (filled < 512) | 610 | if (filled < 512) |
| 605 | filled += emacs_read (fd, &buf[filled], sizeof buf - 1 - filled); | 611 | filled += emacs_read (fd, &buf[filled], sizeof buf - 1 - filled); |
| 606 | if (!filled) | 612 | if (!filled) |