(defmacro defadvice! (symbol arglist &rest body)
"Define an advice called SYMBOL and add it to PLACES.
ARGLIST is as in `defun'. WHERE is a keyword as passed to `advice-add', and
PLACE is the function to which to add the advice, like in `advice-add'.
DOCSTRING and BODY are as in `defun'.
\(fn SYMBOL ARGLIST &rest [WHERE PLACES...] BODY\)"
(declare (indent defun))
(let (where-alist)
(while (keywordp (car body))
(push `(cons ,(pop body) (ensure-list ,(pop body)))
where-alist))
`(progn
(defun ,symbol ,arglist ,@body)
(dolist (targets (list ,@(nreverse where-alist)))
(dolist (target (cdr targets))
(advice-add target (car targets) #',symbol))))))