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#22025: Emacs 25 corrupts Emacs 24 .emacs.desktop. Date: Tue, 1 Dec 2015 09:46:57 -0800 (PST) Message-ID: <9d7e9acc-9c9f-4a10-afcc-989e16f8e6a5@default> References: <20151127083837.GB1782@acm.fritz.box> <83r3jbstgq.fsf@gnu.org> <20151201121940.GA2611@acm.fritz.box> <83a8pukwdq.fsf@gnu.org> <20151201170138.GB2611@acm.fritz.box> 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 1448992111 27958 80.91.229.3 (1 Dec 2015 17:48:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Dec 2015 17:48:31 +0000 (UTC) Cc: 22025@debbugs.gnu.org To: Alan Mackenzie , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 01 18:48:13 2015 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 1a3p2B-0001G9-IH for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Dec 2015 18:48:11 +0100 Original-Received: from localhost ([::1]:54114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3p2B-0002X8-17 for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Dec 2015 12:48:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3p27-0002Wu-95 for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2015 12:48:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3p22-0000fA-8C for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2015 12:48:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3p22-0000f5-4P for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2015 12:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a3p21-0004jI-V1 for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2015 12:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Dec 2015 17:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22025 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22025-submit@debbugs.gnu.org id=B22025.144899202418119 (code B ref 22025); Tue, 01 Dec 2015 17:48:01 +0000 Original-Received: (at 22025) by debbugs.gnu.org; 1 Dec 2015 17:47:04 +0000 Original-Received: from localhost ([127.0.0.1]:35308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a3p16-0004iA-7D for submit@debbugs.gnu.org; Tue, 01 Dec 2015 12:47:04 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:41731) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a3p14-0004ho-0Q for 22025@debbugs.gnu.org; Tue, 01 Dec 2015 12:47:02 -0500 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tB1Hl0rY023297 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 1 Dec 2015 17:47:00 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id tB1Hl0cp003734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 1 Dec 2015 17:47:00 GMT Original-Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id tB1HkwiO018263; Tue, 1 Dec 2015 17:46:59 GMT In-Reply-To: <20151201170138.GB2611@acm.fritz.box> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] 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: 208.118.235.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:109513 Archived-At: > I think (but I don't know for sure) that explicitly invoking > `desktop-save' is quite rare I and other Bookmark+ users use it all the time. We create desktops as bookmarks, and switch among them - any number of them - by "jumping" to them. > "- most desktop files will be saved at Emacs shutdown, Are you sure? My guess is that most users who only do that content themselves with a single desktop file, or perhaps 2 or 3. Users of desktop bookmarks might have dozens of them. And saving is independent of Emacs shutdown, logically, and in reality for desktop bookmarks. IMHO, it is a big mistake to assume that desktops are used only in the way provided out of the box. This is one example of that. Another example: It is an unfortunate mistake that desktop.el is written in such a way that it hard-codes an assumption that there is only one desktop file per directory. The code uses a desktop directory (argument or global var) everywhere, instead of a desktop file argument. Yet the directory is used only to find the file. The basic functions, such as `desktop-change-dir' and `desktop-read', assume this, so they don't take a DESKTOP-FILE as an optional arg. I needed to write simple wrapper functions for them, to let users have multiple desktop files in the same directory. There is no reason why a desktop file must be associated with a directory - users should be able to store the files anywhere. For example: (defun bmkp-desktop-change-dir (desktop-file) "Change to desktop saved in DESKTOP-FILE. Kill the desktop as specified by variables `desktop-save-mode' and `desktop-save'. Clear the desktop and load DESKTOP-FILE." (interactive (list (read-file-name "Change to desktop file: "))) (unless (file-name-absolute-p desktop-file) (setq desktop-file (expand-file-name desktop-file))) (let ((desktop-base-file-name (file-name-nondirectory desktop-file)) (desktop-dir (file-name-directory desktop-file)) (desktop-restore-eager t) ; Don't bother with lazy restore. (desktop-globals-to-save (bmkp-remove-if (lambda (elt) (memq elt bmkp-desktop-no-save-vars)) desktop-globals-to-save))) (bmkp-desktop-kill) (desktop-clear) (desktop-read desktop-dir))) Fiddling to bind `desktop-base-file-name' etc. is silly, but necessary because of the desktop.el implementation's assumption about desktop files. This is the kind of thing that can result from thinking things like "explicitly invoking `desktop-save' is quite rare". Don't assume that the originally intended use case is the only one. This said, I don't have anything particular to say now about a change in desktop format or prompting the user (once only) about upgrading the format used. And I haven't looked at the proposed change. FWIW, bookmark.el handles evolution of the bookmark-file format across 3 versions in a way that is transparent to users. Dunno whether the format change for desktop files is similar, but if it is, you might want to take a look at how bookmark.el handles it. Search bookmark.el for "IMPORTANT NOTICE" to see a description of the changes and how they are dealt with. HTH.=20