help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Crappyness of Emacs Version 24.5.1 defadvice


From: Michael Heerdegen
Subject: Re: Crappyness of Emacs Version 24.5.1 defadvice
Date: Thu, 30 Jun 2016 14:43:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux)

Rémi Vanicat <address@hidden> writes:

>   (defun my-describe-mode-before-advice (oldfun &optional buffer)
>     "my documentation"
>     (delete-other-windows)
>     (apply oldfun buffer))
>
>   (advice-add 'describe-mode :around #'my-describe-mode-before-advice)
>
> Or better with a before advice:
>
>   (defun my-describe-mode-before-advice (&optional buffer)
>     "my documentation"
>     (delete-other-windows))
>
>   (advice-add 'describe-mode :before #'my-desccribe-mode-before-advice)

No need to repeat the argument list of the original function if you
don't use the arguments in the body:

(defun my-describe-mode-before-advice (&rest _ignore)
   "my documentation"
   (delete-other-windows))


Michael.




reply via email to

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