From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#1315: uniquify-buffer-name bug on save Date: Thu, 13 Nov 2008 04:09:22 -0500 Message-ID: <47i78801p.fsf@fencepost.gnu.org> References: <1mod0qezel.fsf@fencepost.gnu.org> Reply-To: Glenn Morris , 1315@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1226568632 6156 80.91.229.12 (13 Nov 2008 09:30:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2008 09:30:32 +0000 (UTC) Cc: 1315@emacsbugs.donarmstrong.com To: Reuben Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 13 10:31:33 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L0YXx-0002M2-El for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Nov 2008 10:31:29 +0100 Original-Received: from localhost ([127.0.0.1]:44642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0YWp-0001X5-7B for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Nov 2008 04:30:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0YWk-0001W2-Fk for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2008 04:30:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0YWi-0001U9-6R for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2008 04:30:13 -0500 Original-Received: from [199.232.76.173] (port=48815 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0YWi-0001U6-1n for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2008 04:30:12 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:58215) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L0YWh-000546-PP for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2008 04:30:12 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAD9U76Y000623; Thu, 13 Nov 2008 01:30:07 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mAD9F3gE029230; Thu, 13 Nov 2008 01:15:03 -0800 X-Loop: don@donarmstrong.com Resent-From: Glenn Morris Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 13 Nov 2008 09:15:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1315 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1315-submit@emacsbugs.donarmstrong.com id=B1315.122656736727883 (code B ref 1315); Thu, 13 Nov 2008 09:15:03 +0000 Original-Received: (at 1315) by emacsbugs.donarmstrong.com; 13 Nov 2008 09:09:27 +0000 Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAD99NY7027876 for <1315@emacsbugs.donarmstrong.com>; Thu, 13 Nov 2008 01:09:25 -0800 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1L0YCY-0001ER-9q; Thu, 13 Nov 2008 04:09:22 -0500 X-Spook: Mole Aladdin Albright Watergate Etacs government lock X-Ran: {EQX!yy>'%vR>&Ag<)v0]jHv,U];ax5Bn@-]YCQQ6`0o;tK#b"qZ(N87(Ar*z^6a$hBAA$ X-Hue: cyan X-Attribution: GM In-Reply-To: (Reuben Thomas's message of "Sat, 8 Nov 2008 23:15:53 +0100 (CET)") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 13 Nov 2008 04:30:13 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:22315 Archived-At: Please try this (lightly tested) patch against CVS trunk: *** uniquify.el.~1.75.~ 2008-07-01 20:02:50.000000000 -0700 --- uniquify.el 2008-11-13 00:57:08.000000000 -0800 *************** *** 427,448 **** ;;; Hooks from the rest of Emacs ;; Buffer deletion ;; Rerationalize after a buffer is killed, to reduce coinciding buffer names. ;; This mechanism uses `kill-buffer-hook', which runs *before* deletion, so ;; it calls `uniquify-rerationalize-w/o-cb' to rerationalize the buffer list ;; ignoring the current buffer (which is going to be deleted anyway). ! (defun uniquify-maybe-rerationalize-w/o-cb () "Re-rationalize buffer names, ignoring current buffer. For use on `kill-buffer-hook'." ! (if (and (cdr uniquify-managed) ! uniquify-buffer-name-style ! uniquify-after-kill-buffer-p) ! (uniquify-rerationalize-w/o-cb uniquify-managed))) ;; Ideally we'd like to add it buffer-locally, but that doesn't work ;; because kill-buffer-hook is not permanent-local :-( ! (add-hook 'kill-buffer-hook 'uniquify-maybe-rerationalize-w/o-cb) ;; The logical place to put all this code is in generate-new-buffer-name. ;; It's written in C, so we would add a generate-new-buffer-name-function --- 427,452 ---- ;;; Hooks from the rest of Emacs + (defun uniquify-maybe-rerationalize-w/o-cb () + "Re-rationalize buffer names, ignoring current buffer." + (and (cdr uniquify-managed) + uniquify-buffer-name-style + (uniquify-rerationalize-w/o-cb uniquify-managed))) + ;; Buffer deletion ;; Rerationalize after a buffer is killed, to reduce coinciding buffer names. ;; This mechanism uses `kill-buffer-hook', which runs *before* deletion, so ;; it calls `uniquify-rerationalize-w/o-cb' to rerationalize the buffer list ;; ignoring the current buffer (which is going to be deleted anyway). ! (defun uniquify-kill-buffer-function () "Re-rationalize buffer names, ignoring current buffer. For use on `kill-buffer-hook'." ! (and uniquify-after-kill-buffer-p ! (uniquify-maybe-rerationalize-w/o-cb))) ;; Ideally we'd like to add it buffer-locally, but that doesn't work ;; because kill-buffer-hook is not permanent-local :-( ! (add-hook 'kill-buffer-hook 'uniquify-kill-buffer-function) ;; The logical place to put all this code is in generate-new-buffer-name. ;; It's written in C, so we would add a generate-new-buffer-name-function