unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 48301@debbugs.gnu.org
Subject: bug#48301: 28.0.50; Dired asks if buffer "" should be deleted with ls flag -p
Date: Tue, 11 May 2021 15:41:04 +0200	[thread overview]
Message-ID: <87pmxxqogq.fsf@gnu.org> (raw)
In-Reply-To: <87h7j9o0zx.fsf@gnus.org>

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> 1. emacs -Q
>> 2. (setq dired-listing-switches "-Alhp") ;; the -p prints dirs as foo/,
>>                                          ;; i.e., with trailing /.
>> 3. M-x dired RET ~ RET
>> 4. Visit directory ~/foobar in dired
>> 5. Delete ~/foobar directory in dired
>> 6. Dired asks: "Kill Dired buffer of , too?" where it should ask if the
>>    buffer of foobar should be killed.
>>
>> The reason is that with the -p flag to ls which prints directories with
>> trailing slash, `dired-clean-up-after-deletion' is called with filename
>> FN "/home/foo/foobar/" and then (file-name-nondirectory
>> "/home/foo/foobar/") returns "".
>
> I'm unable to reproduce this bug in Emacs 28 -- I get no prompt at all
> when deleting the foobar directory (when testing with "emacs -Q").
> Are there some missing steps here?

Oh, I'm sorry, you are right.  It seems that one needs to require
dired-x, too.  So here a completed/amended recipe:

>> 1. emacs -Q
>> 2. (setq dired-listing-switches "-Alhp") ;; the -p prints dirs as foo/,
>>                                          ;; i.e., with trailing /.

2.1 (require 'dired-x)

>> 3. M-x dired RET ~ RET

3.1 Create foobar subdir using `+ foobar RET'
3.2 Refresh using `g' because only then the new foobar directory will be
    shown as foobar/ instead of foobar (without the trailing /).

>> 4. Visit directory ~/foobar/ in dired (a new dired buffer)
>> 5. Delete ~/foobar/ directory in the original dired buffer
>> 6. Dired asks: "Kill Dired buffer of , too?" where it should ask if the
>>    buffer of foobar should be killed.

Bye,
Tassilo





  reply	other threads:[~2021-05-11 13:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08 21:11 bug#48301: 28.0.50; Dired asks if buffer "" should be deleted with ls flag -p Tassilo Horn
2021-05-11 13:26 ` Lars Ingebrigtsen
2021-05-11 13:41   ` Tassilo Horn [this message]
2021-05-11 19:10     ` Tassilo Horn

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmxxqogq.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=48301@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).