From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?=D3scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: iswitchb-kill-buffer and uniquify-buffer-name-style Date: Sat, 22 Mar 2008 02:11:57 +0100 Message-ID: <1w63h89u.fsf@telefonica.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206148349 2490 80.91.229.12 (22 Mar 2008 01:12:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Mar 2008 01:12:29 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 22 02:12:59 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JcsI6-0005Db-MF for ged-emacs-devel@m.gmane.org; Sat, 22 Mar 2008 02:12:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcsHW-000607-5S for ged-emacs-devel@m.gmane.org; Fri, 21 Mar 2008 21:12:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JcsHR-0005zJ-M0 for emacs-devel@gnu.org; Fri, 21 Mar 2008 21:12:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JcsHN-0005yK-Vj for emacs-devel@gnu.org; Fri, 21 Mar 2008 21:12:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcsHN-0005yB-R8 for emacs-devel@gnu.org; Fri, 21 Mar 2008 21:12:13 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JcsHN-0002u2-Im for emacs-devel@gnu.org; Fri, 21 Mar 2008 21:12:13 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JcsHF-0002T7-Il for emacs-devel@gnu.org; Sat, 22 Mar 2008 01:12:05 +0000 Original-Received: from 112.red-81-38-8.dynamicip.rima-tde.net ([81.38.8.112]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 22 Mar 2008 01:12:05 +0000 Original-Received: from ofv by 112.red-81-38-8.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 22 Mar 2008 01:12:05 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 112.red-81-38-8.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (windows-nt) Cancel-Lock: sha1:/A6un9uajhctd5O8n4IfxO8ynRI= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:93154 Archived-At: If uniquify-buffer-name-style is not nil and you open /foo/Makefile and /bar/Makefile, your buffers are named foo/Makefile and bar/Makefile or similar. If you use iswitchb for switching buffers and kill foo/Makefile from the iswitchb prompt (C-k), bar/Makefile is automagically renamed to Makefile, but iswitchb does not notice this, and keeps showing bar/Makefile, which is wrong. If you select it iswitchb will ask if you want to create a new buffer named bar/Makefile. Non-offuscated description: M-x set-variable uniquify-buffer-name-style forward M-x iswitchb-mode C-x C-f /foo/Makefile C-x C-f /bar/Makefile C-x b M a k e C-k Let's suppose we killed bar/Makefile. Then, foo/Makefile was renamed by uniquify.el to simply Makefile, but foo/Makefile still is in the list of buffers. I'm trying to fix this and I'm confused. The definition of iswitchb-kill-buffer ends with this: (if (get-buffer buf) ;; buffer couldn't be killed. (setq iswitchb-rescan t) ;; else buffer was killed so remove name from list. (setq iswitchb-buflist (delq buf iswitchb-buflist))) My first attempt was to (setq iswitchb-rescan t) unconditionally, but this does not work (the buffer list is left unmodified, including the killed buffer). Then I replaced the above code with (iswitchb-make-buflist nil). This fixes the problem, but the new list does not remember which buffer was at the front of the list. Is there a bug on the way iswitchb-rescan is managed or a more deeper issue within iswitchb? -- Oscar