[Top][All Lists]

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r111086: gmm-utils.el (gmm-flet,

From: Katsumi Yamaoka
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r111086: gmm-utils.el (gmm-flet, gmm-labels): New macros.
Date: Wed, 05 Dec 2012 14:46:04 +0900
User-agent: Gnus/5.130006 (真 Gnus v0.6) Emacs/24.3.50 (i686-pc-cygwin)

Stefan Monnier wrote:
>> Defadvice?  Uhm, that defadvice code exists in an official source
>> code is very ugly, I feel. :<

> The problem with defadvice is that it overrides functions.  The letf
> cases we're talking about also override functions, so they're just as
> nasty as uses of defadvice.

Defadvice overrides functions lastingly but letf does it transiently.
Moreover defadvice makes it slow a bit even when it is unnecessary
to modify the behavior.  Maybe this is another reason I don't prefer
using defadvice in an official source code.  I don't want to make
generic functions worse by modifying only for particular users.

> Worse, they don't even announce themselves in the docstring and they
> often remove themselves before you get a chance to see that some
> overriding is going on.

> So, yes, I much prefer defadvice.

I agree to conceal what it does is nasty.  The best thing I think
is to modify it permanently, rather than advising it, so as to be
able to switch the behavior for a certain purpose (unless the change
makes it regress).  However, Gnus should run on many versions of
Emacsen, so there is a limit on modifying things in old Emacsen.
Therefore I believe using flet or cl-letf is the second best.

BTW, I have a plan to implement gmm-called-interactively-p.

reply via email to

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