all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Andrew Eggenberger <andrew@lakecitygraphic.com>
Cc: 34816@debbugs.gnu.org
Subject: bug#34816: 25.2; dired regexp fails for filenames that begin with a space
Date: Tue, 12 Mar 2019 10:00:38 +0100	[thread overview]
Message-ID: <875zsosc09.fsf@gmx.de> (raw)
In-Reply-To: <00F945C7-01EA-4396-A566-C0DFAF8B77CA@lakecitygraphic.com> (Andrew Eggenberger's message of "Mon, 11 Mar 2019 11:13:05 -0500")

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.





  reply	other threads:[~2019-03-12  9: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 [this message]
2020-08-18 17:00   ` Stefan Kangas
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

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

  git send-email \
    --in-reply-to=875zsosc09.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=34816@debbugs.gnu.org \
    --cc=andrew@lakecitygraphic.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.