[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About advices.

From: Stefan Monnier
Subject: Re: About advices.
Date: Wed, 27 Nov 2013 15:52:26 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> What the right way to use advices? (I know that best way it to not use it
> at all.;))

Here's how in Emacs-24.4:

   (defun my-advice (&rest args)
     (message "After s-t-b: %S" args))
   (advice-add 'switch-to-buffer :after #'my-advice)

and when you're tired of those messages, you turn them off with

   (advice-remove 'switch-to-buffer #'my-advice)

-- Stefan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]