From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: other-buffer advice on kill-buffer Date: Tue, 2 Aug 2011 10:55:01 +1000 Message-ID: References: <8662mgg2ea.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1312246512 19667 80.91.229.12 (2 Aug 2011 00:55:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 2 Aug 2011 00:55:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?ISO-8859-1?Q?J=E9r=E9my_Compostella?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 02 02:55:08 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qo3GG-0007VS-HI for ged-emacs-devel@m.gmane.org; Tue, 02 Aug 2011 02:55:08 +0200 Original-Received: from localhost ([::1]:41868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo3GG-0003Hf-4d for ged-emacs-devel@m.gmane.org; Mon, 01 Aug 2011 20:55:08 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo3GD-0003GN-Fr for emacs-devel@gnu.org; Mon, 01 Aug 2011 20:55:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qo3GC-0003HB-0W for emacs-devel@gnu.org; Mon, 01 Aug 2011 20:55:05 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:45089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo3GB-0003Gp-PC for emacs-devel@gnu.org; Mon, 01 Aug 2011 20:55:03 -0400 Original-Received: by iyb14 with SMTP id 14so9246479iyb.0 for ; Mon, 01 Aug 2011 17:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=ld/dWqmtWVjZKURgIui5gRrjfcZJl51MQZyum5p/3yI=; b=ujR0N3xNlnPYgFfdbSRY0BU1anin8tSlCASw9HQLCulTds4U4xip/+XRxIlmiDTPSr lKR5YYR2+i+Thij39ocJt5cvGZoepB3Ufcoa3k370LFmPcvvbsCRL+roBCGOtav/UoCl u+RtM27FWhnRattseE/xmCLVf+dWkHaNZecU0= Original-Received: by 10.231.68.210 with SMTP id w18mr3376488ibi.186.1312246501973; Mon, 01 Aug 2011 17:55:01 -0700 (PDT) Original-Received: by 10.231.36.200 with HTTP; Mon, 1 Aug 2011 17:55:01 -0700 (PDT) In-Reply-To: <8662mgg2ea.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142657 Archived-At: 2011/8/2 J=E9r=E9my Compostella : > All, > > I'm trying to modify the behavior of the kill-buffer function to fit my > needs. I would like to limit the list of eligible buffers used to select > the buffer which will be displayed in place of the killed buffer. > > 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. > > So am I missing something ? > Is there a restriction on advices for C implemented function ? > How the kill-buffer function select the new displayed buffer ? Could I > really modify its behavior and how ? > Yes, there are some restrictions in how defadvice can be used and which function sit can affect. From memory, you cannot advise functions implemented in C, only those implemented in elisp. With respect to the buffer display, there is a current work being done in this area for emas 24. If you are using emacs 24, have a look at the buffer-display-alist thread. One of the things that was being asked for was examples of how the new configuration could/would be used. Your request may be a good test case. If your using emacs23 or earlier, personally, I would hold off until the emacs 24 changes have settled as you will likely have to change things once emacs 24 is released anyway. One of the objectives, as I understand it, is to make this sort of configuration easier and more flexible.so I expect you would be considered to be what they call an 'interested party'. Tim