Synchronized with flim-1_14_5.
[elisp/flim.git] / luna.el
diff --git a/luna.el b/luna.el
index 0199aed..f33b83f 100644 (file)
--- a/luna.el
+++ b/luna.el
@@ -164,8 +164,13 @@ The optional 5th BODY is the body of the method."
           (sym (luna-class-find-or-make-member
                 (luna-find-class ',class) ',name))
           (cache (get ',name 'luna-method-cache)))
-       (if cache
-          (unintern ',class cache))
+       (and cache
+           (fboundp sym)
+           (mapatoms
+            (lambda (s)
+              (if (memq (symbol-function sym) (symbol-value s))
+                  (unintern s cache)))
+            cache))
        (fset sym func)
        (put sym 'luna-method-qualifier ,method-qualifier))))