From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelly Dean Newsgroups: gmane.emacs.bugs Subject: bug#19059: [PATCH] desktop-read re-enables desktop autosave when it shouldn't Date: Fri, 23 Jan 2015 03:45:26 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1421984834 14334 80.91.229.3 (23 Jan 2015 03:47:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2015 03:47:14 +0000 (UTC) To: 19059@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 23 04:47:14 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 1YEVDD-00077K-WC for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Jan 2015 04:47:12 +0100 Original-Received: from localhost ([::1]:56972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEVDD-0003JD-4I for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Jan 2015 22:47:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEVD9-0003Ix-4k for bug-gnu-emacs@gnu.org; Thu, 22 Jan 2015 22:47:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEVD5-0004kv-46 for bug-gnu-emacs@gnu.org; Thu, 22 Jan 2015 22:47:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEVD5-0004kq-0L for bug-gnu-emacs@gnu.org; Thu, 22 Jan 2015 22:47:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YEVD4-0004Q5-Jy for bug-gnu-emacs@gnu.org; Thu, 22 Jan 2015 22:47:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Kelly Dean Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jan 2015 03:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19059 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19059-submit@debbugs.gnu.org id=B19059.142198480116962 (code B ref 19059); Fri, 23 Jan 2015 03:47:02 +0000 Original-Received: (at 19059) by debbugs.gnu.org; 23 Jan 2015 03:46:41 +0000 Original-Received: from localhost ([127.0.0.1]:53369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YEVCj-0004PW-93 for submit@debbugs.gnu.org; Thu, 22 Jan 2015 22:46:41 -0500 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:37865) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YEVCh-0004PN-7y for 19059@debbugs.gnu.org; Thu, 22 Jan 2015 22:46:39 -0500 Original-Received: from mfilter37-d.gandi.net (mfilter37-d.gandi.net [217.70.178.168]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 632BFFB88B for <19059@debbugs.gnu.org>; Fri, 23 Jan 2015 04:46:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter37-d.gandi.net Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter37-d.gandi.net (mfilter37-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id pflXCyCh4tFG for <19059@debbugs.gnu.org>; Fri, 23 Jan 2015 04:46:37 +0100 (CET) X-Originating-IP: 66.220.3.179 Original-Received: from localhost (unknown [66.220.3.179]) (Authenticated sender: kelly@prtime.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 5EBC1FB887 for <19059@debbugs.gnu.org>; Fri, 23 Jan 2015 04:46:35 +0100 (CET) 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:98615 Archived-At: --=-=-= Content-Type: text/plain Since patches are allowed now... --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=desktop-auto-save-bug.patch --- emacs-24.4/lisp/desktop.el +++ emacs-24.4/lisp/desktop.el @@ -1119,7 +1119,8 @@ (desktop-buffer-fail-count 0) (owner (desktop-owner)) ;; Avoid desktop saving during evaluation of desktop buffer. - (desktop-save nil)) + (desktop-save nil) + (desktop-autosave-was-enabled)) (if (and owner (memq desktop-load-locked-desktop '(nil ask)) (or (null desktop-load-locked-desktop) @@ -1135,6 +1136,8 @@ ;; Temporarily disable the autosave that will leave it ;; disabled when loading the desktop fails with errors, ;; thus not overwriting the desktop with broken contents. + (setq desktop-autosave-was-enabled + (memq 'desktop-auto-save-set-timer window-configuration-change-hook)) (desktop-auto-save-disable) ;; Evaluate desktop buffer and remember when it was modified. (load (desktop-full-file-name) t t t) @@ -1188,7 +1191,7 @@ (set-window-prev-buffers window nil) (set-window-next-buffers window nil)))) (setq desktop-saved-frameset nil) - (desktop-auto-save-enable) + (if desktop-autosave-was-enabled (desktop-auto-save-enable)) t)) ;; No desktop file found. (desktop-clear) --=-=-=--