From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#17873: 24.4.50; `desktop-save' Date: Mon, 30 Jun 2014 02:59:20 +0300 Organization: JURTA Message-ID: <87ha332qul.fsf@mail.jurta.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1404087756 10418 80.91.229.3 (30 Jun 2014 00:22:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Jun 2014 00:22:36 +0000 (UTC) Cc: 17873@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 30 02:22:28 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 1X1PMZ-0008W2-9t for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Jun 2014 02:22:27 +0200 Original-Received: from localhost ([::1]:59780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1PMY-0003jF-RP for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jun 2014 20:22:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1PMN-0003d1-T4 for bug-gnu-emacs@gnu.org; Sun, 29 Jun 2014 20:22:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1PMC-0006s4-Cc for bug-gnu-emacs@gnu.org; Sun, 29 Jun 2014 20:22:15 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1PMC-0006s0-8d for bug-gnu-emacs@gnu.org; Sun, 29 Jun 2014 20:22:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X1PMB-0000Vf-M3 for bug-gnu-emacs@gnu.org; Sun, 29 Jun 2014 20:22:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Jun 2014 00:22:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17873-submit@debbugs.gnu.org id=B17873.14040877071921 (code B ref 17873); Mon, 30 Jun 2014 00:22:03 +0000 Original-Received: (at 17873) by debbugs.gnu.org; 30 Jun 2014 00:21:47 +0000 Original-Received: from localhost ([127.0.0.1]:37221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1PLu-0000Uv-7n for submit@debbugs.gnu.org; Sun, 29 Jun 2014 20:21:46 -0400 Original-Received: from alc-vshost7.dreamhost.com ([69.163.216.107]:46317 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1PLr-0000Um-B2 for 17873@debbugs.gnu.org; Sun, 29 Jun 2014 20:21:44 -0400 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D4BCC348328ED2; Sun, 29 Jun 2014 17:21:38 -0700 (PDT) In-Reply-To: (Drew Adams's message of "Sun, 29 Jun 2014 09:47:07 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) 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:90988 Archived-At: > 1. The doc string says: > > If AUTO-SAVE is non-nil, compare the saved contents to the one last saved, > and don't save the buffer if they are the same. > > Saved contents of what? One what last saved? Saved contents cannot be > compared to "the one" anything. > > I think you mean "compare the current desktop information to that in the > desktop file." If you are avoiding saving (because the contents are the > same) then you cannot speak of comparing the "saved contents" - the > contents have not yet been saved. > > And what buffer? This is about saving a desktop in a desktop-file. > There is no notion of a buffer here - at the user level. The code puts > the desktop info into a buffer (which then might get saved), but that is > implementation-level. > > What `desktop-save' does needs to be described at a user level (what, > not how, unless that is important to users). Just say that if the > desktop information has not changed since it was last saved then the > file is not rewritten. Is this how you propose to fix the docstring? === modified file 'lisp/desktop.el' --- lisp/desktop.el 2014-06-24 23:23:41 +0000 +++ lisp/desktop.el 2014-06-29 23:58:41 +0000 @@ -946,8 +946,9 @@ (defun desktop-save (dirname &optional r "Save the desktop in a desktop file. Parameter DIRNAME specifies where to save the desktop file. Optional parameter RELEASE says whether we're done with this desktop. -If AUTO-SAVE is non-nil, compare the saved contents to the one last saved, -and don't save the buffer if they are the same." +If AUTO-SAVE is non-nil, compare the current desktop information +to that in the desktop file, and if the desktop information has not +changed since it was last saved then the file is not rewritten." (interactive (list ;; Or should we just use (car desktop-path)? (let ((default (if (member "." desktop-path) > 2. I also have a question about the behavior: Why is writing the > file even when the content is unchanged the default behavior? Why the > need to specify AUTO-SAVE instead of an optional SAVE-EVEN-IF-NO-CHANGE? > Is this just for backward compatibility? (Before AUTO-SAVE was > introduced the behavior was to update the file even if the desktop > info was not changed.) When the user executes `M-x desktop-save RET' explicitly, the desktop has to be saved unconditionally as expected by users, e.g. it will update the file timestamp, and do other usual things. The only missing thing that `desktop-save' doesn't do yet is creating a backup copy, but this is currently under discussion in bug#17351.