[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replacing a function with another one
From: |
Michael Heerdegen |
Subject: |
Re: replacing a function with another one |
Date: |
Wed, 12 Mar 2014 00:21:49 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
lee <lee@yun.yagibdah.de> writes:
> Maybe the problem is that add-advice is too complicated and convoluted.
> I learned about defadvice in like no time, it´s clear and simple ---
> while advice-add is anything but.
On the contrary. nadvice is as simple as it could be. To understand
how an :around advice works, it takes one line
(lambda (&rest r) (apply FUNCTION OLDFUN r))
That's a non-ambiguous specification from which you can clearly derive
how the advice FUNCTION will be used. It can't be simpler. The problem
is that many people are not so used to lambda expressions and parameter
substitution and so they don't understand it. If you take a pencil and
a sheet of paper and evaluate an example for yourself by hand, step by
step, you'll understand how it works. And no, this is not missing in
the documentation. The Emacs documentation is not an introduction into
lambda calculus and writing LISP code. Once you have really understood
how evaluation of expressions in LISP works, you'll understand the above
definition.
> Considering all that, wouldn´t it be much better to create my own
> mode?
I don't think this is appropriate, because what you want can be done in
few lines without making much assumptions about the original package.
Michael.
- Re: replacing a function with another one, (continued)
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/11
- Re: replacing a function with another one, lee, 2014/03/11
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/11
- Re: replacing a function with another one, lee, 2014/03/12
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/13
- Re: replacing a function with another one, Stefan Monnier, 2014/03/13
- Re: replacing a function with another one, lee, 2014/03/15
- Re: replacing a function with another one, Stefan, 2014/03/16
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/11
- Re: replacing a function with another one, lee, 2014/03/11
- Re: replacing a function with another one,
Michael Heerdegen <=
- Re: replacing a function with another one, lee, 2014/03/12
- Re: replacing a function with another one, Florian Beck, 2014/03/12
- Re: replacing a function with another one, Florian Beck, 2014/03/12
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/13
- Re: replacing a function with another one, lee, 2014/03/15
- Re: replacing a function with another one, Stefan Monnier, 2014/03/12
- Re: replacing a function with another one, lee, 2014/03/12
- Re: replacing a function with another one, Jambunathan K, 2014/03/12
- How to propose an emacs patch (Re: replacing a function with another one), lee, 2014/03/15
- Re: How to propose an emacs patch (Re: replacing a function with another one), Jambunathan K, 2014/03/15