From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#32214: [PATCH] 'message-kill-buffer': fix backup delete question Date: Fri, 20 Jul 2018 19:26:40 -0400 Message-ID: <87va995w0f.fsf@gmail.com> References: <20180719113904.22519-1-sven.willner@gmail.com> <87bmb3l9t9.fsf@gmail.com> <8736wf6w1v.fsf@gmail.com> <87a7qnkuy1.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1532129112 9366 195.159.176.226 (20 Jul 2018 23:25:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 20 Jul 2018 23:25:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Robert Pluim , 32214@debbugs.gnu.org To: Sven Willner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 21 01:25:08 2018 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 1fgelm-0002Fx-OU for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jul 2018 01:25:06 +0200 Original-Received: from localhost ([::1]:50133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgenr-0006Ck-VG for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Jul 2018 19:27:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgeni-0006BB-W2 for bug-gnu-emacs@gnu.org; Fri, 20 Jul 2018 19:27:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgenf-0007X2-1Q for bug-gnu-emacs@gnu.org; Fri, 20 Jul 2018 19:27:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45045) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fgene-0007Wo-Sk for bug-gnu-emacs@gnu.org; Fri, 20 Jul 2018 19:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fgene-0004c0-HD for bug-gnu-emacs@gnu.org; Fri, 20 Jul 2018 19:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jul 2018 23:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32214 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 32214-submit@debbugs.gnu.org id=B32214.153212920917707 (code B ref 32214); Fri, 20 Jul 2018 23:27:02 +0000 Original-Received: (at 32214) by debbugs.gnu.org; 20 Jul 2018 23:26:49 +0000 Original-Received: from localhost ([127.0.0.1]:50063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgenQ-0004bX-OK for submit@debbugs.gnu.org; Fri, 20 Jul 2018 19:26:48 -0400 Original-Received: from mail-it0-f44.google.com ([209.85.214.44]:55207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgenP-0004bK-HB for 32214@debbugs.gnu.org; Fri, 20 Jul 2018 19:26:47 -0400 Original-Received: by mail-it0-f44.google.com with SMTP id s7-v6so16800489itb.4 for <32214@debbugs.gnu.org>; Fri, 20 Jul 2018 16:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=lDNyxWjitibBqWzf4AtMnJkUDar/XxEEJteEC3+pYzY=; b=MidlNkeGpFLGmMQ9uP8seDn0MBcjAVStmYMh2NpExFCdYbNhF0vYSvlZN4LLZeURSp VsjruXWPaRU4hUV21soIHyHOhANtXb3tqgFh5WjevG0bm3acSQ2JWez4REusb/7pYFsL lXdIf88tVdV2T7narLRNXCXG2V3H6fWgd2GHHt/Rwy6ZOUz9/kHkccq9IyDZqiEfcEu6 jNjqgSke5tARu3vXRTFuV4edGvvX2ABBpjdn+vpm9qrHyzYf8oJc5ndF0/9/EpS6l6cK wpGzFVt/ov/zSak4rEYOn42MIDoQYx6THdQydk6dUlN7WiW3K23IOvnBWF80OB1oZyaH 9AEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=lDNyxWjitibBqWzf4AtMnJkUDar/XxEEJteEC3+pYzY=; b=RXLiglt+X79WEZgJYtKstKi3dIgUQcYwjfdfxMZsglv0y1nQvEYpOgl8/2R6RiDc/Q YThDq6+vAuBgzfnq78p3tmzIANrycVVgczyDvVz+8IXoN78E9+hdm13pbUekFZihQaEQ LZFWf+4ZU04d7npyUEBxQY92whCM2/5+pRcoR0NI4i6F1qWLXy2VEvQI9t6Tpxc9SawV M1a3xzfg9oodLtGtCqx755/DUbLEsymA+fiIYV+F5QTSZymwnr1lFlZgP0Tg8hcNdMkH 1D3FhGqQ8nZwNStbBEykPPci7P0H+dxiawjq0pCT0n4t6xKwJWGQAoRinhpGjH0tO+Ob CTMg== X-Gm-Message-State: AOUpUlE+ysuN4e4iw8t2sRMp1fRbDjc3KQ1Pz8An4+CH0QR2bkzHuioB oRknmq9Of/U9Xd5Ek+zxXvg+qp0c X-Google-Smtp-Source: AAOMgpdT2mblS0m1T5Ohhc6GCaeeKeOwMyzcpZFLbt2laG1WQ6kpdOMdKqzct+SikiVdqIhZgjQZOg== X-Received: by 2002:a24:a308:: with SMTP id p8-v6mr3504455ite.53.1532129201745; Fri, 20 Jul 2018 16:26:41 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 69-v6sm3563654itk.3.2018.07.20.16.26.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jul 2018 16:26:41 -0700 (PDT) In-Reply-To: <87a7qnkuy1.fsf@gmail.com> (Sven Willner's message of "Thu, 19 Jul 2018 19:16:06 +0200") 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:148755 Archived-At: Sven Willner writes: > also, the 'when' part should only include the actual deletion of the > backup file >> (ignore-errors >> (delete-file auto-save-file-name)) > rather than also draft diassociation >> (let ((message-draft-article draft-article)) >> (message-disassociate-draft))) > also fixed in the updated patch. > Subject: [PATCH] 'message-kill-buffer': fix backup delete question > > Before 'message-kill-buffer' would ask to delete backup file if draft has been > saved regardless if a backup file has actually been created. Now only ask if > a backup file exists. > + (when (and auto-save-file-name > + (file-exists-p auto-save-file-name) > + file-name > + (file-exists-p file-name) Does it still make sense to check for file-name here? If we're just deleting the auto save file, we should probably check for that only (but see below, I'm not sure if this is actually correct). > + (progn > + ;; If the message buffer has lived in a dedicated window, > + ;; `kill-buffer' has killed the frame. Thus the > + ;; `yes-or-no-p' may show up in a lowered frame. Make sure > + ;; that the user can see the question by raising the > + ;; current frame: > + (raise-frame) > + (yes-or-no-p (format "Remove the backup file%s? " > + (if modified " too" ""))))) I wonder if "backup" is meant to refer to the draft copy (as far as I can tell (through the many layers of indirection), the draft "dissociation" is also some kind of deletion). If so, then I think this change isn't a "fix" at all. > + (ignore-errors > + (delete-file auto-save-file-name))) > + (let ((message-draft-article draft-article)) > + (message-disassociate-draft)) > (message-do-actions actions))))