From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 06 11:42:57 2017 Received: (at submit) by debbugs.gnu.org; 6 Sep 2017 15:42:57 +0000 Received: from localhost ([127.0.0.1]:53204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpcTh-0002ui-Hs for submit@debbugs.gnu.org; Wed, 06 Sep 2017 11:42:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpcTe-0002uT-70 for submit@debbugs.gnu.org; Wed, 06 Sep 2017 11:42:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpcTX-0001gf-DG for submit@debbugs.gnu.org; Wed, 06 Sep 2017 11:42:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45642) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dpcTX-0001gV-8Q for submit@debbugs.gnu.org; Wed, 06 Sep 2017 11:42:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpcTV-0000wg-Lz for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2017 11:42:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpcTT-0001Yk-2C for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2017 11:42:45 -0400 Received: from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]:33168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpcTS-0001SC-R9 for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2017 11:42:42 -0400 Received: by mail-oi0-x236.google.com with SMTP id r20so14892911oie.0 for ; Wed, 06 Sep 2017 08:42:41 -0700 (PDT) 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=XI9Qqg5J5YXdsvRevWVlqObhsdmALXYK2VUGxxauC0s=; b=h90j5RlG/HHcOh9hKlU6FDGBfBbi5YTleCkCMpsrXEVuOhNFFUgCiae5oS3/tjox7e 7njU8y/cebnuj8PVCtWAALDJC5NVY619b4dIiX2WdRWDPyua8RsHI0yGtIucRCl41CvM bqTGS7w52nzvMTT/viHNHkHxyzGRs7By1bXP/RpjvEy3YuqlOL42almDbeABUkFSBnJh uIXwq4qkoMYIeHzIqCtjoFfjrE6VFYIOT2rRqPOgcoE+cpzFDmujPJ6Gp9ePfy2009b5 zSZAejx5wcjckka8TwvUi0jNzgtMNz1G1sqVI67zAhtuQQPxo93lSJLQVSMvgB2Rla1K uetA== 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=XI9Qqg5J5YXdsvRevWVlqObhsdmALXYK2VUGxxauC0s=; b=dxkdb3RgYiycXw4WgxARB0Qyi/TKSr9uIIjzJtHH4Fp8du4bz9f6tgRDSNNB10XuDt 5cMZdC0LxBos1kGIpGmWFCK/5JUqO9xCX0i5asS7l+beRO/1jS/l3mciCuqyB+On6dK2 j605MGbpb9gwuGus0oPFIQ+bP03R7c1uxMwe/kEZAy3aGaD/j0cNncX44U69L442/7uq GhuCJjv/xjY57ZNyqO2xWETuMnMYGPORjqkojWvZhT+3s3sUqAwNapgqzbmlWO5S8x/w 9tC4ScDl5UFxZeUnoK+BqsGsYST+sGclh+yNWen9989ND5SmzKzoW4ejztrGdx/rU2QB u62Q== X-Gm-Message-State: AHPjjUif1j37eULde2q6UCqLMRPr74DuuoT3vc3w+0Wxbpe+WKuYR5Ur vOCv/ltQyNfPt541cTY= X-Google-Smtp-Source: ADKCNb677psOjqpS2tusRKDFN/IGKiiaYMbduhm5yjeyob9V2F70PwpfMGV/Kqge8M7HACrURPJMFQ== X-Received: by 10.202.84.15 with SMTP id i15mr3090343oib.255.1504712560041; Wed, 06 Sep 2017 08:42:40 -0700 (PDT) Received: from mars (nat-128-62-50-36.public.utexas.edu. [128.62.50.36]) by smtp.gmail.com with ESMTPSA id n16sm164881oig.10.2017.09.06.08.42.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Sep 2017 08:42:38 -0700 (PDT) User-agent: mu4e 0.9.18; emacs 25.2.1 From: Alex Branham To: bug-gnu-emacs@gnu.org Subject: [PATCH] New variable controls whether dired confirms to kill buffers visiting deleted files Date: Wed, 06 Sep 2017 10:42:37 -0500 Message-ID: <87r2vjkf4i.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain Hello, This is a patch to include a new variable that, when set to nil, makes dired kill buffers visiting deleted files without confirmation. There are apparently some people interested in this: https://emacs.stackexchange.com/questions/30676/how-to-always-kill-dired-buffer-when-deleting-a-folder I read through the CONTRIBUTE file, but please let me know if something is wrong with the commit message and I can redo it. Alex --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-dired-confirm-killing-deleted-buffers.patch >From e8be25d16b6381cafa8b345b0509944e1dc66c68 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Wed, 6 Sep 2017 10:29:50 -0500 Subject: [PATCH] Add dired-confirm-killing-deleted-buffers * lisp/dired-x.el (dired-clean-confirm-killing-deleted-buffers): * lisp/dired.el (dired-clean-up-after-deletion): Just kill buffers visiting deleted files without confirming if dired-clean-confirm-killing-deleted-buffers is nil * etc/NEWS: Document the change Copyright-paperwork-exempt: yes --- etc/NEWS | 4 ++++ lisp/dired-x.el | 6 ++++++ lisp/dired.el | 28 +++++++++++++++++----------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2824349a53..4194f307b4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -594,6 +594,10 @@ this is controlled by the 'wdired-create-parent-directories' variable. *** 'W' is now bound to 'browse-url-of-dired-file', and is useful for viewing HTML files and the like. ++++ +*** New variable 'dired-clean-confirm-killing-deleted-buffers' +controls whether dired asks to kill buffers visiting deleted files + --- ** html2text is now marked obsolete. diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 1425278bdc..bfb5574da3 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -243,6 +243,12 @@ dired-clean-up-buffers-too :type 'boolean :group 'dired-x) +(defcustom dired-clean-confirm-killing-deleted-buffers t + "If nil, don't ask whether to kill buffers visiting deleted files." + :version "26.1" + :type 'boolean + :group 'dired-x) + ;;; KEY BINDINGS. (define-key dired-mode-map "\C-x\M-o" 'dired-omit-mode) diff --git a/lisp/dired.el b/lisp/dired.el index ff62183f09..bac3933502 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3164,28 +3164,34 @@ dired-delete-entry (dired-clean-up-after-deletion file)) (defvar dired-clean-up-buffers-too) +(defvar dired-clean-confirm-killing-deleted-buffers) (defun dired-clean-up-after-deletion (fn) "Clean up after a deleted file or directory FN. -Removes any expanded subdirectory of deleted directory. -If `dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil, -also offers to kill buffers visiting deleted files and directories." +Removes any expanded subdirectory of deleted directory. If +`dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil, +also offers to kill buffers visiting deleted files and +directories. Similarly, if `dired-x' is loaded and +`dired-clean-confirm-killing-deleted-buffers is nil, kill the +buffers without asking.'" (save-excursion (and (cdr dired-subdir-alist) - (dired-goto-subdir fn) - (dired-kill-subdir))) + (dired-goto-subdir fn) + (dired-kill-subdir))) ;; Offer to kill buffer of deleted file FN. (when (and (featurep 'dired-x) dired-clean-up-buffers-too) (let ((buf (get-file-buffer fn))) (and buf - (funcall #'y-or-n-p - (format "Kill buffer of %s, too? " - (file-name-nondirectory fn))) + (or (not dired-clean-confirm-killing-deleted-buffers) + (funcall #'y-or-n-p + (format "Kill buffer of %s, too? " + (file-name-nondirectory fn)))) (kill-buffer buf))) (let ((buf-list (dired-buffers-for-dir (expand-file-name fn)))) (and buf-list - (y-or-n-p (format "Kill Dired buffer%s of %s, too? " - (dired-plural-s (length buf-list)) - (file-name-nondirectory fn))) + (or (not dired-clean-confirm-killing-deleted-buffers) + (y-or-n-p (format "Kill Dired buffer%s of %s, too? " + (dired-plural-s (length buf-list)) + (file-name-nondirectory fn)))) (dolist (buf buf-list) (kill-buffer buf)))))) -- 2.14.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 06 12:37:03 2017 Received: (at 28373) by debbugs.gnu.org; 6 Sep 2017 16:37:03 +0000 Received: from localhost ([127.0.0.1]:53260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpdK3-0006AS-6I for submit@debbugs.gnu.org; Wed, 06 Sep 2017 12:37:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpdK1-00069x-F2 for 28373@debbugs.gnu.org; Wed, 06 Sep 2017 12:37:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpdJp-0001pd-7l for 28373@debbugs.gnu.org; Wed, 06 Sep 2017 12:36:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpdJp-0001pD-4H; Wed, 06 Sep 2017 12:36:49 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4875 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dpdJo-0006h8-DC; Wed, 06 Sep 2017 12:36:49 -0400 Date: Wed, 06 Sep 2017 19:36:48 +0300 Message-Id: <83ingv238f.fsf@gnu.org> From: Eli Zaretskii To: Alex Branham In-reply-to: <87r2vjkf4i.fsf@gmail.com> (message from Alex Branham on Wed, 06 Sep 2017 10:42:37 -0500) Subject: Re: bug#28373: [PATCH] New variable controls whether dired confirms to kill buffers visiting deleted files References: <87r2vjkf4i.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28373 Cc: 28373@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Alex Branham > Date: Wed, 06 Sep 2017 10:42:37 -0500 > > This is a patch to include a new variable that, when set to nil, makes dired kill buffers visiting deleted files without confirmation. > > There are apparently some people interested in this: > > https://emacs.stackexchange.com/questions/30676/how-to-always-kill-dired-buffer-when-deleting-a-folder > > I read through the CONTRIBUTE file, but please let me know if something is wrong with the commit message and I can redo it. Thanks. A few comments: > * lisp/dired-x.el (dired-clean-confirm-killing-deleted-buffers): > * lisp/dired.el (dired-clean-up-after-deletion): Just kill buffers > visiting deleted files without confirming if > dired-clean-confirm-killing-deleted-buffers is nil This log entry makes it sound as if similar changes were made in both dired.el and dired-x.el, which is not what your changes do. The entry for dired-x.el should only say this: * lisp/dired-x.el (dired-clean-confirm-killing-deleted-buffers): New variable. > diff --git a/lisp/dired.el b/lisp/dired.el > index ff62183f09..bac3933502 100644 > --- a/lisp/dired.el > +++ b/lisp/dired.el > @@ -3164,28 +3164,34 @@ dired-delete-entry > (dired-clean-up-after-deletion file)) > > (defvar dired-clean-up-buffers-too) > +(defvar dired-clean-confirm-killing-deleted-buffers) Why did you need this defvar? > (defun dired-clean-up-after-deletion (fn) > "Clean up after a deleted file or directory FN. > -Removes any expanded subdirectory of deleted directory. > -If `dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil, > -also offers to kill buffers visiting deleted files and directories." > +Removes any expanded subdirectory of deleted directory. If > +`dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil, > +also offers to kill buffers visiting deleted files and > +directories. Similarly, if `dired-x' is loaded and > +`dired-clean-confirm-killing-deleted-buffers is nil, kill the > +buffers without asking.'" We use the US English convention of leaving 2 spaces between sentences. Also, I'd simplify the last sentence to avoid repeating what the previous one says, and perhaps even make one sentence out of the two. > (save-excursion (and (cdr dired-subdir-alist) > - (dired-goto-subdir fn) > - (dired-kill-subdir))) > + (dired-goto-subdir fn) > + (dired-kill-subdir))) Please don't change whitespace where you aren't changing code. > + (or (not dired-clean-confirm-killing-deleted-buffers) > + (funcall #'y-or-n-p > + (format "Kill buffer of %s, too? " > + (file-name-nondirectory fn)))) Isn't it better to use this instead: (and dired-clean-confirm-killing-deleted-buffers (funcall ... ? What you wrote is akin to double negation, IMO. Thanks again for working on this. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 06 14:11:56 2017 Received: (at 28373) by debbugs.gnu.org; 6 Sep 2017 18:11:56 +0000 Received: from localhost ([127.0.0.1]:53322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpenr-0008Nm-UT for submit@debbugs.gnu.org; Wed, 06 Sep 2017 14:11:56 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:36148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpenq-0008Na-9N for 28373@debbugs.gnu.org; Wed, 06 Sep 2017 14:11:54 -0400 Received: by mail-oi0-f49.google.com with SMTP id x190so30520422oix.3 for <28373@debbugs.gnu.org>; Wed, 06 Sep 2017 11:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=Oi+g3vm78kOsqRreZXMmzO5iMq27gaJhd6reo3Xmbfg=; b=KLBVj095bjhPSPkpUDFk1BM9hmNNqTdtsyfaPe9mHXKIkXUaaBQnystewULc03Bo58 2HksFpjkUngIJiMrkD14HXENQbo7j2BDph5gM1YGiFVNueRhncDRrNk8eNiOYk7GvwGO 9mq+XipDNJWk422k1i1agcUBrxMJcdxpourEscpx8uRag+mxaPW0aLdWHYuM1WXQelxm Xs2Kxd6H2stZ7ZnzADCmPN1eUTqzJU/1p+fx/voK+wDzb1H014d6LHZYaju3EJYLEkmb fmOY9AS4IF2N9IZzNv4OxGQOIXwyTUY8SRuyC25iHd406GJLmHFCPIcr6K9Q7fVF/TmI AXvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=Oi+g3vm78kOsqRreZXMmzO5iMq27gaJhd6reo3Xmbfg=; b=ZzkNZx3zlxl0pwnyS4G9wZRsTasvC9oRhABnxparSAf2kxzYp9PKR7UCuI2jeQdeU5 Ncl7FiUHIrGF2F4e1xmh78Q4Mxib2IBBUzo1nnPjGhAHr3a0fU3EzHLCb+jE0icKPJog U04q40X2YfADGj7lWEmuDNRi9HJ2vRaAqkftqdMzEBaVetoibEONTKU9BywnALz4f9oA gtR6ev1RnsE5yZsuUTdufTayzmO/QAWilYx2A4C+RQHU7AI1r4uNnb7L+7ttv362ybTF Mdgn5QTujPkndUbqxDODMYzhigdQSSpwpT/ia1872h3x8XPs5+nEyIEmeRzIh+FI3fXQ v1vg== X-Gm-Message-State: AHPjjUhpnLtl8ECND9wdGwYjSPYUXUiaukI0pLwY9dzrVsIHjMhYkw7x zmstM63YKYx/iLzsMd4= X-Google-Smtp-Source: ADKCNb7AzxMvABhwK4s2guGnJjI0odIhYbmvM35Og7EdzHzII9tv2MmPylEvSNH2LLdoHMdA1qvR/A== X-Received: by 10.202.79.206 with SMTP id d197mr21011oib.192.1504721508064; Wed, 06 Sep 2017 11:11:48 -0700 (PDT) Received: from mars (nat-128-62-50-36.public.utexas.edu. [128.62.50.36]) by smtp.gmail.com with ESMTPSA id m63sm416387oia.21.2017.09.06.11.11.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Sep 2017 11:11:46 -0700 (PDT) References: <87r2vjkf4i.fsf@gmail.com> <83ingv238f.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.2.1 From: Alex Branham To: Eli Zaretskii Subject: Re: bug#28373: [PATCH] New variable controls whether dired confirms to kill buffers visiting deleted files In-reply-to: <83ingv238f.fsf@gnu.org> Date: Wed, 06 Sep 2017 13:11:45 -0500 Message-ID: <87pob3k87y.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28373 Cc: 28373@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) --=-=-= Content-Type: text/plain Thanks for the review. I think I've addressed the things you've brought up; specific replies below. While I have your attention, how do I start the process of FSF copyright assignment? I'd rather start it now so I don't have to deal with it later. And do I have to do one form for Emacs and another for org-mode, or will one form take care of both? Thanks! On Wed 06 Sep 2017 at 16:36, Eli Zaretskii wrote: >> * lisp/dired-x.el (dired-clean-confirm-killing-deleted-buffers): >> * lisp/dired.el (dired-clean-up-after-deletion): Just kill buffers >> visiting deleted files without confirming if >> dired-clean-confirm-killing-deleted-buffers is nil > > This log entry makes it sound as if similar changes were made in both > dired.el and dired-x.el, which is not what your changes do. The entry > for dired-x.el should only say this: > > * lisp/dired-x.el (dired-clean-confirm-killing-deleted-buffers): New variable. Thanks, modified > >> diff --git a/lisp/dired.el b/lisp/dired.el >> index ff62183f09..bac3933502 100644 >> --- a/lisp/dired.el >> +++ b/lisp/dired.el >> @@ -3164,28 +3164,34 @@ dired-delete-entry >> (dired-clean-up-after-deletion file)) >> >> (defvar dired-clean-up-buffers-too) >> +(defvar dired-clean-confirm-killing-deleted-buffers) > > Why did you need this defvar? I assumed I did since the other dired-clean variable is there. I guess I don't, though. > >> (defun dired-clean-up-after-deletion (fn) >> "Clean up after a deleted file or directory FN. >> -Removes any expanded subdirectory of deleted directory. >> -If `dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil, >> -also offers to kill buffers visiting deleted files and directories." >> +Removes any expanded subdirectory of deleted directory. If >> +`dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil, >> +also offers to kill buffers visiting deleted files and >> +directories. Similarly, if `dired-x' is loaded and >> +`dired-clean-confirm-killing-deleted-buffers is nil, kill the >> +buffers without asking.'" > > We use the US English convention of leaving 2 spaces between > sentences. Also, I'd simplify the last sentence to avoid repeating > what the previous one says, and perhaps even make one sentence out of > the two. Modified, thanks. > >> (save-excursion (and (cdr dired-subdir-alist) >> - (dired-goto-subdir fn) >> - (dired-kill-subdir))) >> + (dired-goto-subdir fn) >> + (dired-kill-subdir))) > > Please don't change whitespace where you aren't changing code. That slipped past me, sorry! > >> + (or (not dired-clean-confirm-killing-deleted-buffers) >> + (funcall #'y-or-n-p >> + (format "Kill buffer of %s, too? " >> + (file-name-nondirectory fn)))) > > Isn't it better to use this instead: > > (and dired-clean-confirm-killing-deleted-buffers > (funcall ... > > ? What you wrote is akin to double negation, IMO. I changed it to this. I could've sworn this is what I wrote originally and it didn't work, but it seems to work fine now. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Add-dired-confirm-killing-deleted-buffers.patch >From 452435ac4816b7561056ad0ab75f6387e09b0296 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Wed, 6 Sep 2017 13:05:38 -0500 Subject: [PATCH] Add dired-confirm-killing-deleted-buffers * lisp/dired-x.el (dired-clean-confirm-killing-deleted-buffers): New variable. * lisp/dired.el (dired-clean-up-after-deletion): Just kill buffers visiting deleted files without confirming if dired-clean-confirm-killing-deleted-buffers is nil * etc/NEWS: Document the change Copyright-paperwork-exempt: yes --- etc/NEWS | 4 ++++ lisp/dired-x.el | 6 ++++++ lisp/dired.el | 22 +++++++++++++--------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2824349a53..4194f307b4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -594,6 +594,10 @@ this is controlled by the 'wdired-create-parent-directories' variable. *** 'W' is now bound to 'browse-url-of-dired-file', and is useful for viewing HTML files and the like. ++++ +*** New variable 'dired-clean-confirm-killing-deleted-buffers' +controls whether dired asks to kill buffers visiting deleted files + --- ** html2text is now marked obsolete. diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 1425278bdc..bfb5574da3 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -243,6 +243,12 @@ dired-clean-up-buffers-too :type 'boolean :group 'dired-x) +(defcustom dired-clean-confirm-killing-deleted-buffers t + "If nil, don't ask whether to kill buffers visiting deleted files." + :version "26.1" + :type 'boolean + :group 'dired-x) + ;;; KEY BINDINGS. (define-key dired-mode-map "\C-x\M-o" 'dired-omit-mode) diff --git a/lisp/dired.el b/lisp/dired.el index ff62183f09..33b9e66704 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3167,9 +3167,11 @@ dired-clean-up-buffers-too (defun dired-clean-up-after-deletion (fn) "Clean up after a deleted file or directory FN. -Removes any expanded subdirectory of deleted directory. -If `dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil, -also offers to kill buffers visiting deleted files and directories." +Removes any expanded subdirectory of deleted directory. If +`dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil, +kill any buffers visiting those files, prompting for +confirmation. To disable confirmation, see +`dired-clean-confirm-killing-deleted-buffers'." (save-excursion (and (cdr dired-subdir-alist) (dired-goto-subdir fn) (dired-kill-subdir))) @@ -3177,15 +3179,17 @@ dired-clean-up-after-deletion (when (and (featurep 'dired-x) dired-clean-up-buffers-too) (let ((buf (get-file-buffer fn))) (and buf - (funcall #'y-or-n-p - (format "Kill buffer of %s, too? " - (file-name-nondirectory fn))) + (and dired-clean-confirm-killing-deleted-buffers + (funcall #'y-or-n-p + (format "Kill buffer of %s, too? " + (file-name-nondirectory fn)))) (kill-buffer buf))) (let ((buf-list (dired-buffers-for-dir (expand-file-name fn)))) (and buf-list - (y-or-n-p (format "Kill Dired buffer%s of %s, too? " - (dired-plural-s (length buf-list)) - (file-name-nondirectory fn))) + (and dired-clean-confirm-killing-deleted-buffers + (y-or-n-p (format "Kill Dired buffer%s of %s, too? " + (dired-plural-s (length buf-list)) + (file-name-nondirectory fn)))) (dolist (buf buf-list) (kill-buffer buf)))))) -- 2.14.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 06 14:43:02 2017 Received: (at 28373) by debbugs.gnu.org; 6 Sep 2017 18:43:02 +0000 Received: from localhost ([127.0.0.1]:53344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpfHy-0000el-0r for submit@debbugs.gnu.org; Wed, 06 Sep 2017 14:43:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpfHw-0000eS-46 for 28373@debbugs.gnu.org; Wed, 06 Sep 2017 14:43:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpfHn-0002OO-IZ for 28373@debbugs.gnu.org; Wed, 06 Sep 2017 14:42:54 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpfHn-0002OJ-F6; Wed, 06 Sep 2017 14:42:51 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1223 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dpfHj-0004XL-6g; Wed, 06 Sep 2017 14:42:51 -0400 Date: Wed, 06 Sep 2017 21:42:37 +0300 Message-Id: <83a8271xeq.fsf@gnu.org> From: Eli Zaretskii To: Alex Branham In-reply-to: <87pob3k87y.fsf@gmail.com> (message from Alex Branham on Wed, 06 Sep 2017 13:11:45 -0500) Subject: Re: bug#28373: [PATCH] New variable controls whether dired confirms to kill buffers visiting deleted files References: <87r2vjkf4i.fsf@gmail.com> <83ingv238f.fsf@gnu.org> <87pob3k87y.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28373 Cc: 28373@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Alex Branham > Cc: 28373@debbugs.gnu.org > Date: Wed, 06 Sep 2017 13:11:45 -0500 > > Thanks for the review. I think I've addressed the things you've brought up; specific replies below. Thanks, I will look into this soon. > While I have your attention, how do I start the process of FSF copyright assignment? I'd rather start it now so I don't have to deal with it later. And do I have to do one form for Emacs and another for org-mode, or will one form take care of both? Form sent off-list. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 08 05:41:11 2017 Received: (at 28373-done) by debbugs.gnu.org; 8 Sep 2017 09:41:11 +0000 Received: from localhost ([127.0.0.1]:55318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqFmh-0003R4-38 for submit@debbugs.gnu.org; Fri, 08 Sep 2017 05:41:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqFmf-0003Qp-Oo for 28373-done@debbugs.gnu.org; Fri, 08 Sep 2017 05:41:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqFmV-0004BU-Ta for 28373-done@debbugs.gnu.org; Fri, 08 Sep 2017 05:41:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqFmV-0004BA-QF; Fri, 08 Sep 2017 05:40:59 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3340 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dqFmU-0000PM-Vq; Fri, 08 Sep 2017 05:40:59 -0400 Date: Fri, 08 Sep 2017 12:41:04 +0300 Message-Id: <83mv65y1cf.fsf@gnu.org> From: Eli Zaretskii To: Alex Branham In-reply-to: <87pob3k87y.fsf@gmail.com> (message from Alex Branham on Wed, 06 Sep 2017 13:11:45 -0500) Subject: Re: bug#28373: [PATCH] New variable controls whether dired confirms to kill buffers visiting deleted files References: <87r2vjkf4i.fsf@gmail.com> <83ingv238f.fsf@gnu.org> <87pob3k87y.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28373-done Cc: 28373-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Alex Branham > Cc: 28373@debbugs.gnu.org > Date: Wed, 06 Sep 2017 13:11:45 -0500 > > Thanks for the review. I think I've addressed the things you've brought up; specific replies below. Thanks, pushed to the master branch. Two minor nits for the future: . please always mention the bug number in the commit log message . the NEWS entry should be marked with "+++" only if the new feature is described in the appropriate manual; otherwise it should be either marked with "---" (if it doesn't need to be in the manual), or not marked at all (which is a signal for the maintainers to consider documenting it at some future point). This is explained at the beginning of NEWS. From unknown Wed Jun 25 00:25:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 06 Oct 2017 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator