]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/cl-macs.el: Use `define-symbol-prop` (bug#50869)
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 3 Sep 2022 14:46:46 +0000 (10:46 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 3 Sep 2022 14:55:10 +0000 (10:55 -0400)
(cl-define-compiler-macro, cl-defstruct, cl-deftype): Prefer
`define-symbol-prop` over `put` so `unload-feature` can undo
those definitions.

lisp/emacs-lisp/cl-macs.el

index 80ca43c902a37146c72f31d400c25478f3cedfbc..edd633675dc6a8b402fafb8a737949b4ef30838b 100644 (file)
@@ -3105,7 +3105,7 @@ To see the documentation for a defined struct type, use
                   `(and ,pred-form t)))
             forms)
       (push `(eval-and-compile
-               (put ',name 'cl-deftype-satisfies ',predicate))
+               (define-symbol-prop ',name 'cl-deftype-satisfies ',predicate))
             forms))
     (let ((pos 0) (descp descs))
       (while descp
@@ -3570,7 +3570,7 @@ and then returning foo."
        (cl-defun ,fname ,(if (memq '&whole args) (delq '&whole args)
                            (cons '_cl-whole-arg args))
          ,@body)
-       (put ',func 'compiler-macro #',fname))))
+       (define-symbol-prop ',func 'compiler-macro #',fname))))
 
 ;;;###autoload
 (defun cl-compiler-macroexpand (form)
@@ -3679,8 +3679,8 @@ macro that returns its `&whole' argument."
 The type name can then be used in `cl-typecase', `cl-check-type', etc."
   (declare (debug cl-defmacro) (doc-string 3) (indent 2))
   `(cl-eval-when (compile load eval)
-     (put ',name 'cl-deftype-handler
-          (cl-function (lambda (&cl-defs ('*) ,@arglist) ,@body)))))
+     (define-symbol-prop ',name 'cl-deftype-handler
+                         (cl-function (lambda (&cl-defs ('*) ,@arglist) ,@body)))))
 
 (cl-deftype extended-char () '(and character (not base-char)))
 ;; Define fixnum so `cl-typep' recognize it and the type check emitted