From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 22.1.90; desktop-save throws (error "No buffer named ") Date: Tue, 12 Feb 2008 01:44:13 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1202777273 1450 80.91.229.12 (12 Feb 2008 00:47:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Feb 2008 00:47:53 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, Martin Fischer To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 12 01:48:16 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 1JOjJh-0000VB-MT for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2008 01:48:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOjJE-0000Rf-1q for ged-emacs-devel@m.gmane.org; Mon, 11 Feb 2008 19:47:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOjJ8-0000Pb-2d for emacs-devel@gnu.org; Mon, 11 Feb 2008 19:47:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOjJ7-0000PP-GU for emacs-devel@gnu.org; Mon, 11 Feb 2008 19:47:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOjJ7-0000PM-BY for emacs-devel@gnu.org; Mon, 11 Feb 2008 19:47:33 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOjJ7-0002q3-EB for emacs-devel@gnu.org; Mon, 11 Feb 2008 19:47:33 -0500 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JOjJ6-0005SH-FX for emacs-pretest-bug@gnu.org; Mon, 11 Feb 2008 19:47:32 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JOjFw-0002Lm-3t for emacs-pretest-bug@gnu.org; Mon, 11 Feb 2008 19:44:19 -0500 Original-Received: from wr-out-0506.google.com ([64.233.184.231]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOjFv-0002Le-P7 for emacs-pretest-bug@gnu.org; Mon, 11 Feb 2008 19:44:15 -0500 Original-Received: by wr-out-0506.google.com with SMTP id 58so4253570wri.10 for ; Mon, 11 Feb 2008 16:44:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=boy1BCNhQSTLaydoXR+whzhdDjgILiGGVDreShQfGU4=; b=pMS4DP/dl4T6EolpWyP/yiY7w4FRzeesWmViDCwysx4GbTztYHZcfFaEzaq5JCdvVcrwS0yplB1+U2SYv1vR8A3xMRFaggrxQgpKJB+jvdM5JzJQZWv30ADCTYwfcgS5Pp0aUMBGHWQZUQgBFqSTO/DP41geompYaqsiiiEPxK4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QS2PMkzAVum7F4wWaygiqzqei2yCAyErOFytBrjT5/sz+r2roltkOObwip3HjnskFyXoWHTfCa4gT5bOGLGoLoViWNORypJyuL1PqaXEgPLUDWx3x2XlmqUHpYrsG+WEGjBFuLv1BZmtGno+8XF8zPAMKibN8dxArmmEEplwSEc= Original-Received: by 10.115.47.1 with SMTP id z1mr717967waj.117.1202777053819; Mon, 11 Feb 2008 16:44:13 -0800 (PST) Original-Received: by 10.114.170.5 with HTTP; Mon, 11 Feb 2008 16:44:13 -0800 (PST) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 (Google crawlbot) 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:88813 gmane.emacs.pretest.bugs:21039 Archived-At: On Feb 8, 2008 10:17 PM, Stefan Monnier wrote: > 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. > 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? Juanma Index: lisp/uniquify.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/uniquify.el,v retrieving revision 1.62.2.7 diff -u -2 -r1.62.2.7 uniquify.el --- lisp/uniquify.el 7 Jan 2008 02:44:10 -0000 1.62.2.7 +++ lisp/uniquify.el 12 Feb 2008 00:10:32 -0000 @@ -190,4 +190,10 @@ (put 'uniquify-managed 'permanent-local t) +;; Used in desktop.el to save the non-uniquified buffer name +(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)))) + ;;; Main entry point. Index: lisp/desktop.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/desktop.el,v retrieving revision 1.108.2.6 diff -u -2 -r1.108.2.6 desktop.el --- lisp/desktop.el 7 Jan 2008 02:44:57 -0000 1.108.2.6 +++ lisp/desktop.el 12 Feb 2008 00:14:02 -0000 @@ -136,6 +136,4 @@ ;;; Code: -(defvar uniquify-managed) - (defvar desktop-file-version "206" "Version number of desktop file format. @@ -654,9 +652,9 @@ (set-buffer buffer) (list + ;; base name of the buffer; replaces the buffer name if managed by uniquify + (and (fboundp 'uniquify-buffer-base-name) (uniquify-buffer-base-name)) ;; basic information (desktop-file-name (buffer-file-name) desktop-dirname) - (if (bound-and-true-p uniquify-managed) - (uniquify-item-base (car uniquify-managed)) - (buffer-name)) + (buffer-name) major-mode ;; minor modes @@ -887,5 +885,5 @@ (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n") (dolist (l (mapcar 'desktop-buffer-info (buffer-list))) - (when (apply 'desktop-save-buffer-p l) + (when (apply 'desktop-save-buffer-p (cdr l)) (insert "(" (if (or (not (integerp eager)) @@ -897,4 +895,7 @@ " " desktop-file-version) + (let ((base (pop l))) + ;; If the base name is non-nil, we substitute it for the buffer name + (when base (setcar (nthcdr 1 l) base))) (dolist (e l) (insert "\n " (desktop-value-to-string e)))