unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Andrew Eggenberger <andrew@lakecitygraphic.com>, 34816@debbugs.gnu.org
Subject: bug#34816: 25.2; dired regexp fails for filenames that begin with a space
Date: Tue, 18 Aug 2020 17:00:50 +0000	[thread overview]
Message-ID: <CADwFkmmW6bGzzjqzUYPVp2RxFtDU4TWX_4WpOQERsaEsoHQU2Q@mail.gmail.com> (raw)
In-Reply-To: <875zsosc09.fsf@gmx.de> (Michael Albinus's message of "Tue, 12 Mar 2019 10:00:38 +0100")

Michael Albinus <michael.albinus@gmx.de> writes:

> Andrew Eggenberger <andrew@lakecitygraphic.com> writes:
>
> Hi Andrew,
>
>> Trying to use dired-do-rename-regexp caused the following error:
>>
>> (file-error Renaming No such file or directory
>> /Users/andrew/Public/Temp_2019/Temp_2.25.19/Tiger Pride/- 1B, Thieren,
>> Addison.JPG /Users/andrew/Public/Temp_2019/Temp_2.25.19/Tiger
>> Pride/Addison, Thieren.jpg)
>>
>> The reason for the file error is that the filename actually begins
>> with
>> a space character before the hyphen. It appears that the mechanism
>> used to identify filenames within dired isn't sensitive to opening
>> spaces.
>
> It isn't as simple as it looks. Often, dired uses a command like "ls -al
> --dired". This gives precise information, where file names are located
> in the output, and Emacs could determine also file names starting with
> spaces.
>
> If this ls option isn't available, something like "ls -al" is
> applied. From the output it isn't obvious, whether a leading space
> belongs to a file name, or whether it is just a separator to the
> date. One could implement heuristics (check the column other file names
> start with), but this isn't implemented.
>
> If it comes to remote file names, the situation is even worse, because
> you cannot always assume a proper ls command on the remote side.
>
> One alternative for you might to use ls-lisp.el. It doesn't apply "ls
> -al", but tries to collect the needed information differently. Due to
> this, dired might have a better idea about file names.
>
> Best regards, Michael.

So is the conclusion here to either use GNU ls, or otherwise ls-lisp.el?
If so, should this bug be closed?

Best regards,
Stefan Kangas





  reply	other threads:[~2020-08-18 17:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 16:13 bug#34816: 25.2; dired regexp fails for filenames that begin with a space Andrew Eggenberger
2019-03-12  9:00 ` Michael Albinus
2020-08-18 17:00   ` Stefan Kangas [this message]
2020-08-18 17:42     ` Michael Albinus

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=CADwFkmmW6bGzzjqzUYPVp2RxFtDU4TWX_4WpOQERsaEsoHQU2Q@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=34816@debbugs.gnu.org \
    --cc=andrew@lakecitygraphic.com \
    --cc=michael.albinus@gmx.de \
    /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).