all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Crappyness of Emacs Version 24.5.1 defadvice
Date: Thu, 30 Jun 2016 14:43:52 +0200	[thread overview]
Message-ID: <8760sqg83b.fsf@web.de> (raw)
In-Reply-To: 874m8c14ow.dlv@debian.org

Rémi Vanicat <vanicat@debian.org> 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	other threads:[~2016-06-30 12:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27  5:46 Crappyness of Emacs Version 24.5.1 defadvice Davin Pearson
2016-06-28  5:58 ` Davin Pearson
2016-06-28 11:11   ` Dmitry Gutov
2016-06-28 12:59     ` Michael Heerdegen
2016-06-28 14:21   ` Drew Adams
     [not found]   ` <mailman.239.1467123719.26859.help-gnu-emacs@gnu.org>
2016-06-29  1:48     ` Davin Pearson
2016-06-29  1:55       ` Michael Heerdegen
     [not found]       ` <mailman.260.1467165391.26859.help-gnu-emacs@gnu.org>
2016-06-29  7:01         ` Davin Pearson
2016-06-29  9:02           ` Alexis
2016-06-29  7:05         ` Davin Pearson
2016-06-30 12:46           ` Michael Heerdegen
     [not found]           ` <mailman.320.1467290787.26859.help-gnu-emacs@gnu.org>
2016-06-30 13:09             ` Joost Kremers
2016-06-30 21:16               ` Michael Heerdegen
2016-06-29 13:54       ` Rémi Vanicat
2016-06-30 12:43         ` Michael Heerdegen [this message]
2016-07-01 11:39 ` Fwd: " Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760sqg83b.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.