From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#17048: switch-to-buffer function show killed buffers names Date: Thu, 20 Mar 2014 08:45:31 -0700 (PDT) Message-ID: <0ef3a4c3-3d8f-47ca-91c5-26ccc08c3046@default> References: <20140320121001.14c43fa4@jcubic> <20140320161346.3b7e1e87@jcubic> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1395330380 23150 80.91.229.3 (20 Mar 2014 15:46:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Mar 2014 15:46:20 +0000 (UTC) Cc: 17048@debbugs.gnu.org To: Jakub Jankiewicz , Stefan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 20 16:46:27 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WQfAl-0004o4-74 for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Mar 2014 16:46:23 +0100 Original-Received: from localhost ([::1]:47693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQfAk-0005BF-RP for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Mar 2014 11:46:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQfAY-0004AY-M7 for bug-gnu-emacs@gnu.org; Thu, 20 Mar 2014 11:46:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQfAQ-0000S8-1Z for bug-gnu-emacs@gnu.org; Thu, 20 Mar 2014 11:46:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQfAP-0000S2-Ta for bug-gnu-emacs@gnu.org; Thu, 20 Mar 2014 11:46:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WQfAP-0001Id-NV for bug-gnu-emacs@gnu.org; Thu, 20 Mar 2014 11:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Mar 2014 15:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17048 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17048-submit@debbugs.gnu.org id=B17048.13953303404949 (code B ref 17048); Thu, 20 Mar 2014 15:46:01 +0000 Original-Received: (at 17048) by debbugs.gnu.org; 20 Mar 2014 15:45:40 +0000 Original-Received: from localhost ([127.0.0.1]:42445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WQfA2-0001Hi-8E for submit@debbugs.gnu.org; Thu, 20 Mar 2014 11:45:39 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:36880) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WQf9z-0001HU-A3 for 17048@debbugs.gnu.org; Thu, 20 Mar 2014 11:45:36 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s2KFjXUx023248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 Mar 2014 15:45:33 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s2KFjWbj027971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Mar 2014 15:45:32 GMT Original-Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s2KFjVJx027964; Thu, 20 Mar 2014 15:45:31 GMT In-Reply-To: <20140320161346.3b7e1e87@jcubic> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:87030 Archived-At: > Yes it's history, I think this fix the bug (but only for buffer names) >=20 > (add-hook 'kill-buffer-hook > (lambda () > (setq buffer-name-history (delete (buffer-name) > buffer-name-history)))) >=20 Bad idea. And not a bug. The history is supposed to be just that: a history of buffer names that the user has entered as minibuffer input. That this or that command might use this history for various things is irrelevant to this. If a given command has no use for buffer names that do not correspond to currently live buffers then it is _up to that command_ to DTRT for its own use. And not by modifying the history list but by filtering a copy of it. IOW, any such filtering should be done, if needed, by the code that USES the history variable. It should not be done to the variable itself, and especially not by some general code such as a kill-buffer hook. And in particular, command `switch-to-buffer' should NOT filter out such buffer names. Besides the full history being important, _a priori_, this command is specifically designed to let you create a new buffer, including a new buffer with the same name as one that previously existed but has been killed. Or, as Stefan pointed out, one that has a similar name (e.g. by editing a history-list entry). It is trivial for a user to write a command that, for example, lets her choose only among existing (live) buffers. And in that case she can also decide whether she wants the available history to be filtered similarly. Nothing wrong with that. But that is not `switch-to-buffer'.