[Top][All Lists]

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

Re: other-buffer advice on kill-buffer

From: Jérémy Compostella
Subject: Re: other-buffer advice on kill-buffer
Date: Tue, 2 Aug 2011 11:58:33 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Alp Aker <alptekin.aker <at> gmail.com> writes:

> Tim Cross wrote:
> > From memory, you cannot advise functions implemented in C, only those
> > implemented in elisp.
> That's not correct.  You can advise a primitive function, but the advice will
> only affect calls to that function made from Lisp, not calls from other
> primitives.
Reading emacs source code let met think that way. Thanks you for confirming my

> Jérémy Compostella wrote:
> >> I have tried to advice the other-buffer function which seems called
> >> (Cf. buffer.c) but my advice is never called in this case. Indeed, my
> >> other-buffer advice is correctly called on switch-to-buffer call but
> >> never on kill-buffer call.
> Are you sure your advice on other-buffer is being called when
> switch-to-buffer is called?  That shouldn't be possible, as switch-to-buffer
> is a primitive, like kill-buffer; neither should see your advice.
Indeed, I did not understand why it was possible in that case. I finally figure
out that actually my switch-to-buffer was bound to iswitchb-buffer which lisp
implemented. My mistake.


reply via email to

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