From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 22.1.90; desktop-save throws (error "No buffer named ") Date: Mon, 11 Feb 2008 22:39:03 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1202787567 24750 80.91.229.12 (12 Feb 2008 03:39:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Feb 2008 03:39:27 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, Martin Fischer To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 12 04:39:50 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 1JOlzo-0004Gb-Dg for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2008 04:39:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOlzK-0000dU-Sc for ged-emacs-devel@m.gmane.org; Mon, 11 Feb 2008 22:39:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOlzG-0000bz-3D for emacs-devel@gnu.org; Mon, 11 Feb 2008 22:39:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOlzD-0000aA-Fc for emacs-devel@gnu.org; Mon, 11 Feb 2008 22:39:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOlzD-0000a7-8z for emacs-devel@gnu.org; Mon, 11 Feb 2008 22:39:11 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOlzD-0004Ub-5m for emacs-devel@gnu.org; Mon, 11 Feb 2008 22:39:11 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JOlzC-0002h9-Hm for emacs-pretest-bug@gnu.org; Mon, 11 Feb 2008 22:39:10 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JOlz9-0004Tp-MD for emacs-pretest-bug@gnu.org; Mon, 11 Feb 2008 22:39:10 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOlz9-0004Td-97 for emacs-pretest-bug@gnu.org; Mon, 11 Feb 2008 22:39:07 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAHGjsEdMCpK7/2dsb2JhbACrE3s X-IronPort-AV: E=Sophos;i="4.25,336,1199682000"; d="scan'208";a="14330023" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 11 Feb 2008 22:39:04 -0500 Original-Received: from pastel.home ([76.10.146.187]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id SFZ46804; Mon, 11 Feb 2008 22:39:04 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id EA8697FD8; Mon, 11 Feb 2008 22:39:03 -0500 (EST) In-Reply-To: (Juanma Barranquero's message of "Tue, 12 Feb 2008 01:44:13 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:88822 gmane.emacs.pretest.bugs:21040 Archived-At: >> Actually, any use of the "base name" will be uniquify-specific as well, >> so I'll still say "Yuck!". > Well, I'm trying to fix a problem derived of the interaction of > uniquify and desktop, so using uniquify-specific info seems > unavoidable. Yes, that's what I figured as well, which is why I think it's fine to do it, but only if the interface between the two is made cleaner. >> Indeed for uniquified buffers, you should only [need to] save the >> base-name to disk, so there's no need to change the disk representation >> of your data. > The "base name" and the buffer name are two different pieces of info; > even if no uniquify is present, it would be perhaps interesting to > know (and save) whether "my-buffer<2>" is called so by user fiat or > via rename-buffer's UNIQUE argument; but that is not needed right now. > Anyway. Does this version lessen your yucky factor somewhat? Yes, very much so. > +(defun uniquify-buffer-base-name () > + "Return the base name of the current buffer." > + (and (bound-and-true-p uniquify-managed) > + (uniquify-item-base (car uniquify-managed)))) There's a (defvar uniquify-managed nil ...) earlier in that file, so you shouldn't need the `bound-and-true-p', just use (defun uniquify-buffer-base-name () "Return the base name of the current buffer. Return nil if the buffer is not managed by uniquify." (and uniquify-managed (uniquify-item-base (car uniquify-managed)))) -- Stefan