[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use defadvice without infinite loop
From: |
Stefan Monnier |
Subject: |
Re: How to use defadvice without infinite loop |
Date: |
Mon, 29 Sep 2003 15:08:45 GMT |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
> (defadvice save-some-buffers(before my-save-some-buffers activate)
> "Ask to save buffers."
> (interactive)
> ;; Prevent infinite loop
> (ad-deactivate-regexp "my-save-some-buffers")
> (save-some-buffers nil 'my-always-save)
> (ad-activate-regexp "my-save-some-buffers"))
You can try an `around' advice instead of a `before' advice, and then put
two `ad-do-it' in there, modifying the args in between the two calls.
Pretty ugly as well. Maybe the doc suggests a cleaner way to do what
you want.
Stefan