1.0.42.49: fix (SETF DOCUMENTATION) for macros
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 21 Sep 2010 11:23:32 +0000 (11:23 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 21 Sep 2010 11:23:32 +0000 (11:23 +0000)
 Fixes lp#643958.

 Patch Stas Boukarev, test-case by yours truly.

 Nice and simple, so going in mid-freeze.

NEWS
src/pcl/documentation.lisp
tests/interface.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 653806a..feef931 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -57,6 +57,8 @@ changes relative to sbcl-1.0.42
     in frames that do not have sufficient debug information.
   * bug fix: exceeding FD_SETSIZE limit now results in an sensible error
     (lp#316068)
+  * bug fix: (SETF DOCUMENTATION) of a macro works properly. (lp#643958, thanks
+    to Stas Boukarev)
 
 changes in sbcl-1.0.42 relative to sbcl-1.0.41
   * build changes
index d5d4eb2..7bc2e58 100644 (file)
@@ -63,7 +63,8 @@
 
 (defmethod (setf documentation) (new-value (x symbol) (doc-type (eql 'function)))
   (when (and (legal-fun-name-p x) (fboundp x))
-    (setf (documentation (symbol-function x) t) new-value)))
+    (setf (documentation (or (macro-function x) (symbol-function x)) t)
+          new-value)))
 
 (defmethod (setf documentation) (new-value (x symbol) (doc-type (eql 'compiler-macro)))
   (awhen (compiler-macro-function x)
index 6f697a5..3837060 100644 (file)
   (flet ((zoo () (gogo)))
     (defmethod gogo () nil)
     (describe 'gogo)))
+
+(defmacro bug-643958-test ()
+  "foo"
+  :ding!)
+
+(with-test (:name :bug-643958)
+  (assert (equal "foo" (documentation 'bug-643958-test 'function)))
+  (setf (documentation 'bug-643958-test 'function) "bar")
+  (assert (equal "bar" (documentation 'bug-643958-test 'function))))
 \f
 ;;;; success
index 28d864a..5ec2273 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.42.48"
+"1.0.42.49"