From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Branham Newsgroups: gmane.emacs.bugs Subject: bug#29179: [PATCH] teach recover-file about autosave files not existing Date: Mon, 06 Nov 2017 15:22:46 -0600 Message-ID: <87tvy7cdax.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1510003390 22096 195.159.176.226 (6 Nov 2017 21:23:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 6 Nov 2017 21:23:10 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.3.1 To: 29179@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 06 22:23:02 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBorG-0005RV-BS for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Nov 2017 22:23:02 +0100 Original-Received: from localhost ([::1]:50310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBorN-00029f-KU for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Nov 2017 16:23:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBorH-00029a-Dd for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 16:23:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBorG-0003y4-J1 for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 16:23:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eBorG-0003xy-ET for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 16:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eBorG-0007nO-5i for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 16:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Nov 2017 21:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29179 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151000337929941 (code B ref -1); Mon, 06 Nov 2017 21:23:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Nov 2017 21:22:59 +0000 Original-Received: from localhost ([127.0.0.1]:54669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBorD-0007mr-KB for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:22:59 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBorC-0007mV-OE for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:22:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBor6-0003w5-L1 for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:22:53 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50793) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eBor6-0003vy-Gg for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:22:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBor5-00027t-G0 for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 16:22:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBor4-0003ux-6r for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 16:22:51 -0500 Original-Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:48841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eBor4-0003ta-1H for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 16:22:50 -0500 Original-Received: by mail-oi0-x229.google.com with SMTP id m198so8624264oig.5 for ; Mon, 06 Nov 2017 13:22:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=gqQPwz7f3GNvQ+MgdXJHHSzHX91AJgUre7CjC/cj+7Q=; b=cmIkwAT1qiH8yMNfFyhoaSmyWAIEhC3HdTlVAupz84nPWZCF2nlfPcFai8q0sp/BYw iPKegSjTF+QYx3AR3xoOu6WitvizUIhlQb+pdMyOcOVz5riQnVR7jK6aKNT20RcXT5mT sRDOkAmNM73kyEbqEtE8Pm2EB7DvmYATVtI1E9TmwxQ+ppJY1oX6w8VHyz8I4C5o8mZD vI8VAEExAuoeGqeULJi1DI7VRGFzkFayHCtRXWh7V6cp6dGzx0wsch+O8eZ9b4jPJ5en 2GFNNITZtS9MGCIICal1FP0LLR2qrV6K7/yEigY39m2dHks9fnu/vTXGz8Afo7dt2Fyi 0v7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=gqQPwz7f3GNvQ+MgdXJHHSzHX91AJgUre7CjC/cj+7Q=; b=LxFpmLWgE+65bd/Nipyi1K4bSM4VyX/UxizBcMrPWKZYBAPQ7jXTIgNcoFDYmU07d3 vH1qq4OvZiP1I7/hBrUxi7mvLD4Owlb9g0zr5SSi1iajDtDYZtJZ8krCeU2RJwe3w4k3 pt/IcQdI7H3m0/i1qOmB5EpVLt7tqHSHcRreGNX7ftw9qg/ChmtWCFhACFuWkpi6yR+h bWcuwV5O0RDCbZWYsuUnqZfDdc3ie4r814UDZPZFcESpkND73ULN60KrKbzsx4DO/f8w Tp7+XmSH8OlEQc77TWgugTg/Dxsb/2Ps4+dzPCewTEfgrPzdRJMtvFOcL9uMUSh3WwBY ZsUg== X-Gm-Message-State: AMCzsaUZS9zQ27Tg8BSOdzMLyaYgseR5CofQb8OSj5h9gRAqvyeGjJY0 vxEbbaFUpK9Mp2Jabaqa9B35GJNJ X-Google-Smtp-Source: ABhQp+R1c1QR5nqLltpUGw8734BlVXqGju4aF7/LieYMgleS7uus5aBKci8qMLIOz8mupElWJXQYPw== X-Received: by 10.202.213.20 with SMTP id m20mr9129193oig.363.1510003368824; Mon, 06 Nov 2017 13:22:48 -0800 (PST) Original-Received: from earth ([2605:6000:e9c9:5c01:58d5:4609:6488:8adc]) by smtp.gmail.com with ESMTPSA id x73sm5910087oia.23.2017.11.06.13.22.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2017 13:22:47 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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" Xref: news.gmane.org gmane.emacs.bugs:139524 Archived-At: --=-=-= Content-Type: text/plain Currently running M-x recover-this-file when an autosave file doesn't exist reports that the autosave file is not current. This changes it so that it'll correctly tell you that the autosave file doesn't exist. Alex ------------------------------------------------------------ >From f0b3de73ba72ada91c3efe2d150b606d35ca4e5c Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Mon, 6 Nov 2017 15:17:40 -0600 Subject: [PATCH] Add more informative error when no autosave file available * lisp/files.el (recover-file): Distinguish between autosave file not existing versus not being current --- lisp/files.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index cda2c1abd5..1bd0ba6427 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5851,7 +5851,11 @@ recover-file (error "%s is an auto-save file" (abbreviate-file-name file))) (let ((file-name (let ((buffer-file-name file)) (make-auto-save-file-name)))) - (cond ((if (file-exists-p file) + (cond ((and (file-exists-p file) + (not (file-exists-p file-name))) + (error "No auto save file %s found" + (abbreviate-file-name file-name))) + ((if (file-exists-p file) (not (file-newer-than-file-p file-name file)) (not (file-exists-p file-name))) (error "Auto-save file %s not current" -- 2.15.0 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-more-informative-error-when-no-autosave-file-ava.patch >From f0b3de73ba72ada91c3efe2d150b606d35ca4e5c Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Mon, 6 Nov 2017 15:17:40 -0600 Subject: [PATCH] Add more informative error when no autosave file available * lisp/files.el (recover-file): Distinguish between autosave file not existing versus not being current --- lisp/files.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index cda2c1abd5..1bd0ba6427 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5851,7 +5851,11 @@ recover-file (error "%s is an auto-save file" (abbreviate-file-name file))) (let ((file-name (let ((buffer-file-name file)) (make-auto-save-file-name)))) - (cond ((if (file-exists-p file) + (cond ((and (file-exists-p file) + (not (file-exists-p file-name))) + (error "No auto save file %s found" + (abbreviate-file-name file-name))) + ((if (file-exists-p file) (not (file-newer-than-file-p file-name file)) (not (file-exists-p file-name))) (error "Auto-save file %s not current" -- 2.15.0 --=-=-=--