[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 05:10:31 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
lee <lee@yun.yagibdah.de> writes:
> > Of course you can also write
> >
> > (advice-add
> > 'hi-lock-write-interactive-patterns :around
> > (lambda (f)
> > (let ((hi-lock-interactive-patterns
> > (append hi-lock-interactive-patterns
> > hi-lock-file-patterns))))
> > (funcall f)))
>
> And if f refers to the original function, why not use a before advice
> instead? And I thought "let" limits the scope of the variable to what
> is between its brackets.
Good catch! Yes, sorry, the parens were wrong, I meant this:
(advice-add
'hi-lock-write-interactive-patterns :around
(lambda (f)
(let ((hi-lock-interactive-patterns
(append hi-lock-interactive-patterns
hi-lock-file-patterns)))
(funcall f))))
Thanks,
Michael.
- Re: replacing a function with another one, (continued)
- 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, Michael Heerdegen, 2014/03/12
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/12
- 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, lee, 2014/03/15
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/17
- Re: replacing a function with another one, lee, 2014/03/12
- Re: replacing a function with another one, Stefan Monnier, 2014/03/12
- Re: replacing a function with another one,
Michael Heerdegen <=
- Re: replacing a function with another one, Stefan Monnier, 2014/03/10
- Re: replacing a function with another one, lee, 2014/03/10
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/10
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/10
- 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, Stefan Monnier, 2014/03/12
- Re: replacing a function with another one, lee, 2014/03/12
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/13