diff options
| author | Stefan Monnier | 2010-04-29 08:42:01 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-04-29 08:42:01 -0400 |
| commit | d6d2385247fd2a9cacd338ec5ff1b47787ef44fb (patch) | |
| tree | af10b7111b8b48b618493da655909cac599968f6 /src/eval.c | |
| parent | a982c7ec499d6d1571b89978bfca38e2dc464e0d (diff) | |
| download | emacs-d6d2385247fd2a9cacd338ec5ff1b47787ef44fb.tar.gz emacs-d6d2385247fd2a9cacd338ec5ff1b47787ef44fb.zip | |
Fix wrong-docstring problem introduced with hash-consing.
* eval.c (Fautoload): Set doc to a unique number rather than to 0.
Remove unused var `args'.
* lisp.h (XSETCARFASTINT, XSETCDRFASTINT): Remove.
(LOADHIST_ATTACH): Wrap with do...while to avoid surprises for callers.
* doc.c (store_function_docstring): Use XSETCAR.
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/eval.c b/src/eval.c index 184455f7e7d..120365f5f57 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2134,8 +2134,6 @@ this does nothing and returns nil. */) | |||
| 2134 | (function, file, docstring, interactive, type) | 2134 | (function, file, docstring, interactive, type) |
| 2135 | Lisp_Object function, file, docstring, interactive, type; | 2135 | Lisp_Object function, file, docstring, interactive, type; |
| 2136 | { | 2136 | { |
| 2137 | Lisp_Object args[4]; | ||
| 2138 | |||
| 2139 | CHECK_SYMBOL (function); | 2137 | CHECK_SYMBOL (function); |
| 2140 | CHECK_STRING (file); | 2138 | CHECK_STRING (file); |
| 2141 | 2139 | ||
| @@ -2151,8 +2149,11 @@ this does nothing and returns nil. */) | |||
| 2151 | LOADHIST_ATTACH (Fcons (Qautoload, function)); | 2149 | LOADHIST_ATTACH (Fcons (Qautoload, function)); |
| 2152 | else | 2150 | else |
| 2153 | /* We don't want the docstring in purespace (instead, | 2151 | /* We don't want the docstring in purespace (instead, |
| 2154 | Snarf-documentation should (hopefully) overwrite it). */ | 2152 | Snarf-documentation should (hopefully) overwrite it). |
| 2155 | docstring = make_number (0); | 2153 | We used to use 0 here, but that leads to accidental sharing in |
| 2154 | purecopy's hash-consing, so we use a (hopefully) unique integer | ||
| 2155 | instead. */ | ||
| 2156 | docstring = make_number (XHASH (function)); | ||
| 2156 | return Ffset (function, | 2157 | return Ffset (function, |
| 2157 | Fpurecopy (list5 (Qautoload, file, docstring, | 2158 | Fpurecopy (list5 (Qautoload, file, docstring, |
| 2158 | interactive, type))); | 2159 | interactive, type))); |