summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2017-07-28 12:02:01 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2017-07-28 12:02:01 -0400
commitbfb8d33fd18b1d9fd5868204d472cb19f5bcafbe (patch)
tree3ca8b55d994ad39e94fd972b02e6d7d539339c25 /lisp/emacs-lisp
parentb2225a374f24f1ee1a881bfd5d3c1f7b57447e47 (diff)
downloademacs-bfb8d33fd18b1d9fd5868204d472cb19f5bcafbe.tar.gz
emacs-bfb8d33fd18b1d9fd5868204d472cb19f5bcafbe.tar.bz2
emacs-bfb8d33fd18b1d9fd5868204d472cb19f5bcafbe.zip
* lisp/subr.el (define-symbol-prop): New function
(symbol-file): Make it find symbol property definitions. * lisp/emacs-lisp/pcase.el (pcase-defmacro): * lisp/emacs-lisp/ert.el (ert-set-test): Use it instead of `put'. (ert-describe-test): Adjust call to symbol-file accordingly.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/ert.el11
-rw-r--r--lisp/emacs-lisp/pcase.el4
2 files changed, 4 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 5186199cfce..d7bd331c11b 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -135,16 +135,9 @@ Emacs bug 6581 at URL `http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6581'."
;; Note that nil is still a valid value for the `name' slot in
;; ert-test objects. It designates an anonymous test.
(error "Attempt to define a test named nil"))
- (put symbol 'ert--test definition)
- ;; Register in load-history, so `symbol-file' can find us, and so
- ;; unload-feature can unload our tests.
- (cl-pushnew `(ert-deftest . ,symbol) current-load-list :test #'equal)
+ (define-symbol-prop symbol 'ert--test definition)
definition)
-(cl-defmethod loadhist-unload-element ((x (head ert-deftest)))
- (let ((name (cdr x)))
- (put name 'ert--test nil)))
-
(defun ert-make-test-unbound (symbol)
"Make SYMBOL name no test. Return SYMBOL."
(cl-remprop symbol 'ert--test)
@@ -2539,7 +2532,7 @@ To be used in the ERT results buffer."
(insert (if test-name (format "%S" test-name) "<anonymous test>"))
(insert " is a test")
(let ((file-name (and test-name
- (symbol-file test-name 'ert-deftest))))
+ (symbol-file test-name 'ert--test))))
(when file-name
(insert (format-message " defined in `%s'"
(file-name-nondirectory file-name)))
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index b40161104d2..253b60e7534 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -418,8 +418,8 @@ to this macro."
(when decl (setq body (remove decl body)))
`(progn
(defun ,fsym ,args ,@body)
- (put ',fsym 'edebug-form-spec ',(cadr (assq 'debug decl)))
- (put ',name 'pcase-macroexpander #',fsym))))
+ (define-symbol-prop ',fsym 'edebug-form-spec ',(cadr (assq 'debug decl)))
+ (define-symbol-prop ',name 'pcase-macroexpander #',fsym))))
(defun pcase--match (val upat)
"Build a MATCH structure, hoisting all `or's and `and's outside."