unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dave Goel <deego3@gmail.com>
Cc: luangruo@yahoo.com, emacs-devel@gnu.org
Subject: Re: Dired delete(d) the wrong file!
Date: Fri, 05 Jul 2024 14:05:18 +0300	[thread overview]
Message-ID: <868qyg6qvl.fsf@gnu.org> (raw)
In-Reply-To: <CAOCW0DjA73VvHAe+sJvA5KBUFOzbjVaTZWxE2KCPPP_fopG8Yw@mail.gmail.com> (message from Dave Goel on Fri, 5 Jul 2024 04:39:29 -0400)

> From: Dave Goel <deego3@gmail.com>
> Date: Fri, 5 Jul 2024 04:39:29 -0400
> Cc: luangruo@yahoo.com, emacs-devel@gnu.org
> 
>  > Eli's patch works!
> 
> I still don't understand one thing -
> 
> The problem is now fixed, right? 

Yes, I think so.

> It appears that it's still using a very hacky regexp - see (defvar directory-listing-before-filename-regexp...)
> during file deletion.
> which does all kinds of hacky checks, guessing where the timestring ends and where the filename begins.
> 
> (A) So, is this still a hack? 
> (B) Is the problem fixed for good, or can one still concoct edge cases?
> (C) If it is fixed, then why does that regex need this massive hack?

That regexp is the best heuristic we could come up with that caters to
the various formats of date and time that the various versions of 'ls'
out there produce.  It is true that the regexp can be tricked into
mistakes, but we could not find a better solution that supports all
the valid use cases.  We use the --dired option of 'ls' when available
precisely for this reason: to allow Dired to determine the file names
reliably.  If --dired is not supported, then there will be problems
with certain file names, yes.  That is a known limitation, so users
are encouraged to install GNU Coreutils (which is where GNU 'ls' comes
from) to make Dired immune to those problems.



  reply	other threads:[~2024-07-05 11:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-04 22:36 Dired delete(d) the wrong file! Dave Goel
2024-07-04 23:35 ` Dave Goel
2024-07-05  1:40   ` Dave Goel
2024-07-05  8:01     ` Tassilo Horn
2024-07-05  1:24 ` Po Lu
2024-07-05  5:43   ` Eli Zaretskii
2024-07-05  5:50     ` Dave Goel
2024-07-05  7:33       ` Eli Zaretskii
2024-07-05  8:06         ` Dave Goel
2024-07-05  8:12           ` Dave Goel
2024-07-05  8:26             ` Dave Goel
2024-07-05  8:39               ` Dave Goel
2024-07-05 11:05                 ` Eli Zaretskii [this message]
2024-07-05 19:02                   ` Dave Goel
2024-07-05 11:00               ` Eli Zaretskii
2024-07-05  9:53         ` Stefan Kangas
2024-07-05 10:52           ` Eli Zaretskii
2024-07-05 23:28         ` Michael Heerdegen via Emacs development discussions.
2024-07-06  6:17           ` Eli Zaretskii
2024-07-05  5:50     ` Po Lu
2024-07-05  7:11       ` Michael Heerdegen via Emacs development discussions.

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=868qyg6qvl.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=deego3@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.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 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).