all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Mark Lillibridge <mdl@alum.mit.edu>
Cc: 13305@debbugs.gnu.org
Subject: bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?)
Date: Thu, 03 Jan 2013 12:22:34 -0500	[thread overview]
Message-ID: <jwvbod6b2z8.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87d2xovgsh.fsf@foil.strangled.net> (Mark Lillibridge's message of "Tue, 01 Jan 2013 11:34:22 -0800")

>     For some reason I was thinking that changes to interactive didn't
> work properly with advice.  Just using defun can be more convenient than
> advice, however, when you are in a hurry for a temporary patch.

Fine, but don't expect everything else to handle it just right.

>     It's too bad there isn't a macro for replace-defun that acts
> syntactically identical to defun except that it uses advice to patch
> lazily the built-in (e.g., part of Emacs distribution) function.

Instead of (replace-defun foo (ARGS) BODY), you can write
(advice-add foo :around (lambda (_ignore ARGS) BODY))
If needed we could add a :replace to advice-add, so it'd be
(advice-add foo :replace (lambda (ARGS) BODY)), but I'm not convinced
it's worth the trouble.


        Stefan





  reply	other threads:[~2013-01-03 17:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-29 20:16 bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) Mark Lillibridge
2012-12-31  2:57 ` Stefan Monnier
2013-01-01 19:34   ` Mark Lillibridge
2013-01-03 17:22     ` Stefan Monnier [this message]
2013-01-23  2:16     ` Stefan Monnier
2012-12-31  2:59 ` Stefan Monnier
2013-01-01 19:35   ` Mark Lillibridge
2013-01-03 17:19     ` Stefan Monnier

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=jwvbod6b2z8.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=13305@debbugs.gnu.org \
    --cc=mdl@alum.mit.edu \
    /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.