summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/nadvice.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-10-02 22:17:09 +0200
committerAndrea Corallo <akrl@sdf.org>2020-10-05 20:46:15 +0200
commitad5a2bbde071138cacadd19b95f2638741fd5d8d (patch)
treeda75247557c37de7b2c32f206436be3a54816902 /lisp/emacs-lisp/nadvice.el
parent323200044f0c3f716f8f78a6f5e39349fe039117 (diff)
downloademacs-ad5a2bbde071138cacadd19b95f2638741fd5d8d.tar.gz
Revert "Add `advice-flet' macro"
Diffstat (limited to 'lisp/emacs-lisp/nadvice.el')
-rw-r--r--lisp/emacs-lisp/nadvice.el26
1 files changed, 0 insertions, 26 deletions
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index 21da038dc1c..5b3aa708508 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -356,32 +356,6 @@ of the piece of advice."
(macroexp-let2 nil new `(advice--remove-function ,getter ,function)
`(unless (eq ,new ,getter) ,(funcall setter new)))))
-;;;###autoload
-(defmacro advice-flet (bindings &rest body)
- ;; FIXME add doc.
- (declare (indent 1))
- (let ((let-binds ())
- (ad-add ())
- (ad-del ()))
- (dolist (bind bindings)
- (let* ((fun-name (car bind))
- (fun (cadr bind))
- (tmp-sym (gensym (symbol-name fun-name))))
- (push `(,tmp-sym ,fun) let-binds)
- (push `(advice-add #',fun-name
- ,(if (= (length bind) 3)
- (nth 2 bind)
- :override)
- ,tmp-sym)
- ad-add)
- (push `(advice-remove #',fun-name ,tmp-sym) ad-del)))
- `(let ,(reverse let-binds)
- (unwind-protect
- (progn
- ,@(reverse ad-add)
- ,@body)
- ,@(reverse ad-del)))))
-
(defun advice-function-mapc (f function-def)
"Apply F to every advice function in FUNCTION-DEF.
F is called with two arguments: the function that was added, and the