Hot answers tagged


(advice-add #'undo-tree :filter-return #'undo-tree-advice-history-save-file-name) This advises the function undo-tree, whereas the defadvice form advises undo-tree-make-history-save-file-name. The equivalent advice-add would be (advice-add 'undo-tree-make-history-save-file-name :filter-return #'undo-tree-advice-history-save-file-name)


I tried pp-macroexpand-last-sexp on define-advice block and it turns out that I was right, it is a macro that uses advice-add behind the scenes, but it implicitly creates a defun (since using lambdas for hooks and advising is a "no-no"), so you don't have to do it yourself. It's confusing because frankly define-advice doesn't seem to reduce the code that ...


Yes, it's normal. The code is byte-compiled on the fly. See nadvice.el (advice-p, for example). Because of this it can help to give a piece of advice a user-friendly name, which can kind of describe it. FWIW, you might want to take a look at the dynamic Isearch filtering available with Isearch+. It gives you easy ways to add, combine, and remove Isearch ...


Untested, but your (interactive) form doesn't tell Emacs how to obtain the FUNCTION argument, so that's presumably your problem.

Only top voted, non community-wiki answers of a minimum length are eligible