]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/loadhist.el (unload-feature): Remove ad-hoc ELP code
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 28 Jul 2017 02:51:37 +0000 (22:51 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 28 Jul 2017 02:51:37 +0000 (22:51 -0400)
* lisp/emacs-lisp/elp.el (loadhist-unload-element): Un-instrument functions.

lisp/emacs-lisp/elp.el
lisp/loadhist.el

index d4500f131a27691f1581ca163b9a7a3472a79d8a..7bdd749d5abf0f46d431ea87ec6954fcb2423804 100644 (file)
@@ -583,6 +583,11 @@ displayed."
   (elp-restore-all)
   ;; continue standard unloading
   nil)
+
+(cl-defmethod loadhist-unload-element :before :extra "elp" ((x (head defun)))
+  "Un-instrument before unloading a function."
+  (elp-restore-function (cdr x)))
+
 \f
 (provide 'elp)
 
index 24c3acd1b99f861401742fabe498845c71a1dfdd..b83d023ccf8de22e3928276db0740dd080f06fec 100644 (file)
@@ -301,11 +301,6 @@ something strange, such as redefining an Emacs function."
       ;; Change major mode in all buffers using one defined in the feature being unloaded.
       (unload--set-major-mode)
 
-      (when (fboundp 'elp-restore-function) ; remove ELP stuff first
-       (dolist (elt unload-function-defs-list)
-         (when (symbolp elt)
-           (elp-restore-function elt))))
-
       (mapc #'loadhist-unload-element unload-function-defs-list)
       ;; Delete the load-history element for this file.
       (setq load-history (delq (assoc file load-history) load-history))))