diff options
Diffstat (limited to 'src/doc.c')
| -rw-r--r-- | src/doc.c | 18 |
1 files changed, 3 insertions, 15 deletions
| @@ -339,16 +339,7 @@ string is passed through `substitute-command-keys'. */) | |||
| 339 | if (CONSP (fun) && EQ (XCAR (fun), Qmacro)) | 339 | if (CONSP (fun) && EQ (XCAR (fun), Qmacro)) |
| 340 | fun = XCDR (fun); | 340 | fun = XCDR (fun); |
| 341 | if (SUBRP (fun)) | 341 | if (SUBRP (fun)) |
| 342 | { | 342 | doc = make_number (XSUBR (fun)->doc); |
| 343 | if (XSUBR (fun)->doc == 0) | ||
| 344 | return Qnil; | ||
| 345 | /* FIXME: This is not portable, as it assumes that string | ||
| 346 | pointers have the top bit clear. */ | ||
| 347 | else if ((intptr_t) XSUBR (fun)->doc >= 0) | ||
| 348 | doc = build_string (XSUBR (fun)->doc); | ||
| 349 | else | ||
| 350 | doc = make_number ((intptr_t) XSUBR (fun)->doc); | ||
| 351 | } | ||
| 352 | else if (COMPILEDP (fun)) | 343 | else if (COMPILEDP (fun)) |
| 353 | { | 344 | { |
| 354 | if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING) | 345 | if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING) |
| @@ -473,7 +464,7 @@ aren't strings. */) | |||
| 473 | /* Scanning the DOC files and placing docstring offsets into functions. */ | 464 | /* Scanning the DOC files and placing docstring offsets into functions. */ |
| 474 | 465 | ||
| 475 | static void | 466 | static void |
| 476 | store_function_docstring (Lisp_Object obj, ptrdiff_t offset) | 467 | store_function_docstring (Lisp_Object obj, EMACS_INT offset) |
| 477 | { | 468 | { |
| 478 | /* Don't use indirect_function here, or defaliases will apply their | 469 | /* Don't use indirect_function here, or defaliases will apply their |
| 479 | docstrings to the base functions (Bug#2603). */ | 470 | docstrings to the base functions (Bug#2603). */ |
| @@ -502,10 +493,7 @@ store_function_docstring (Lisp_Object obj, ptrdiff_t offset) | |||
| 502 | 493 | ||
| 503 | /* Lisp_Subrs have a slot for it. */ | 494 | /* Lisp_Subrs have a slot for it. */ |
| 504 | else if (SUBRP (fun)) | 495 | else if (SUBRP (fun)) |
| 505 | { | 496 | XSUBR (fun)->doc = offset; |
| 506 | intptr_t negative_offset = - offset; | ||
| 507 | XSUBR (fun)->doc = (char *) negative_offset; | ||
| 508 | } | ||
| 509 | 497 | ||
| 510 | /* Bytecode objects sometimes have slots for it. */ | 498 | /* Bytecode objects sometimes have slots for it. */ |
| 511 | else if (COMPILEDP (fun)) | 499 | else if (COMPILEDP (fun)) |