diff options
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/doc.c | 36 |
2 files changed, 24 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 31b4ee92e26..16cfc1d6d2f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2011-03-15 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-03-15 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to | ||
| 4 | avoid shadowing. | ||
| 5 | |||
| 3 | * lisp.h (eassert): Check that the argument compiles, even if | 6 | * lisp.h (eassert): Check that the argument compiles, even if |
| 4 | ENABLE_CHECKING is not defined. | 7 | ENABLE_CHECKING is not defined. |
| 5 | 8 | ||
| @@ -322,17 +322,20 @@ string is passed through `substitute-command-keys'. */) | |||
| 322 | { | 322 | { |
| 323 | Lisp_Object fun; | 323 | Lisp_Object fun; |
| 324 | Lisp_Object funcar; | 324 | Lisp_Object funcar; |
| 325 | Lisp_Object tem, doc; | 325 | Lisp_Object doc; |
| 326 | int try_reload = 1; | 326 | int try_reload = 1; |
| 327 | 327 | ||
| 328 | documentation: | 328 | documentation: |
| 329 | 329 | ||
| 330 | doc = Qnil; | 330 | doc = Qnil; |
| 331 | 331 | ||
| 332 | if (SYMBOLP (function) | 332 | if (SYMBOLP (function)) |
| 333 | && (tem = Fget (function, Qfunction_documentation), | 333 | { |
| 334 | !NILP (tem))) | 334 | Lisp_Object tem = Fget (function, Qfunction_documentation); |
| 335 | return Fdocumentation_property (function, Qfunction_documentation, raw); | 335 | if (!NILP (tem)) |
| 336 | return Fdocumentation_property (function, Qfunction_documentation, | ||
| 337 | raw); | ||
| 338 | } | ||
| 336 | 339 | ||
| 337 | fun = Findirect_function (function, Qnil); | 340 | fun = Findirect_function (function, Qnil); |
| 338 | if (SUBRP (fun)) | 341 | if (SUBRP (fun)) |
| @@ -348,13 +351,16 @@ string is passed through `substitute-command-keys'. */) | |||
| 348 | { | 351 | { |
| 349 | if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING) | 352 | if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING) |
| 350 | return Qnil; | 353 | return Qnil; |
| 351 | tem = AREF (fun, COMPILED_DOC_STRING); | ||
| 352 | if (STRINGP (tem)) | ||
| 353 | doc = tem; | ||
| 354 | else if (NATNUMP (tem) || CONSP (tem)) | ||
| 355 | doc = tem; | ||
| 356 | else | 354 | else |
| 357 | return Qnil; | 355 | { |
| 356 | Lisp_Object tem = AREF (fun, COMPILED_DOC_STRING); | ||
| 357 | if (STRINGP (tem)) | ||
| 358 | doc = tem; | ||
| 359 | else if (NATNUMP (tem) || CONSP (tem)) | ||
| 360 | doc = tem; | ||
| 361 | else | ||
| 362 | return Qnil; | ||
| 363 | } | ||
| 358 | } | 364 | } |
| 359 | else if (STRINGP (fun) || VECTORP (fun)) | 365 | else if (STRINGP (fun) || VECTORP (fun)) |
| 360 | { | 366 | { |
| @@ -370,9 +376,8 @@ string is passed through `substitute-command-keys'. */) | |||
| 370 | else if (EQ (funcar, Qlambda) | 376 | else if (EQ (funcar, Qlambda) |
| 371 | || EQ (funcar, Qautoload)) | 377 | || EQ (funcar, Qautoload)) |
| 372 | { | 378 | { |
| 373 | Lisp_Object tem1; | 379 | Lisp_Object tem1 = Fcdr (Fcdr (fun)); |
| 374 | tem1 = Fcdr (Fcdr (fun)); | 380 | Lisp_Object tem = Fcar (tem1); |
| 375 | tem = Fcar (tem1); | ||
| 376 | if (STRINGP (tem)) | 381 | if (STRINGP (tem)) |
| 377 | doc = tem; | 382 | doc = tem; |
| 378 | /* Handle a doc reference--but these never come last | 383 | /* Handle a doc reference--but these never come last |
| @@ -539,7 +544,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 539 | char buf[1024 + 1]; | 544 | char buf[1024 + 1]; |
| 540 | register EMACS_INT filled; | 545 | register EMACS_INT filled; |
| 541 | register EMACS_INT pos; | 546 | register EMACS_INT pos; |
| 542 | register char *p, *end; | 547 | register char *p; |
| 543 | Lisp_Object sym; | 548 | Lisp_Object sym; |
| 544 | char *name; | 549 | char *name; |
| 545 | int skip_file = 0; | 550 | int skip_file = 0; |
| @@ -598,6 +603,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 598 | pos = 0; | 603 | pos = 0; |
| 599 | while (1) | 604 | while (1) |
| 600 | { | 605 | { |
| 606 | register char *end; | ||
| 601 | if (filled < 512) | 607 | if (filled < 512) |
| 602 | filled += emacs_read (fd, &buf[filled], sizeof buf - 1 - filled); | 608 | filled += emacs_read (fd, &buf[filled], sizeof buf - 1 - filled); |
| 603 | if (!filled) | 609 | if (!filled) |