From: Eli Zaretskii <eliz@gnu.org>
To: Alex Branham <alex.branham@gmail.com>
Cc: 28373@debbugs.gnu.org
Subject: bug#28373: [PATCH] New variable controls whether dired confirms to kill buffers visiting deleted files
Date: Wed, 06 Sep 2017 19:36:48 +0300 [thread overview]
Message-ID: <83ingv238f.fsf@gnu.org> (raw)
In-Reply-To: <87r2vjkf4i.fsf@gmail.com> (message from Alex Branham on Wed, 06 Sep 2017 10:42:37 -0500)
> From: Alex Branham <alex.branham@gmail.com>
> 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.
next prev parent reply other threads:[~2017-09-06 16:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 15:42 bug#28373: [PATCH] New variable controls whether dired confirms to kill buffers visiting deleted files Alex Branham
2017-09-06 16:36 ` Eli Zaretskii [this message]
2017-09-06 18:11 ` Alex Branham
2017-09-06 18:42 ` Eli Zaretskii
2017-09-08 9:41 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83ingv238f.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=28373@debbugs.gnu.org \
--cc=alex.branham@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.