unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: "Francesco Potortì" <pot@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: dired cannot access file names with a quote
Date: Sat, 23 Feb 2008 17:28:20 -0500	[thread overview]
Message-ID: <87r6f3ux2z.fsf@stupidchicken.com> (raw)
In-Reply-To: <E1JH3IM-0004TS-T0@fencepost.gnu.org> (Richard Stallman's message of "Mon\, 21 Jan 2008 15\:31\:02 -0500")

> The subject describes what I suspect is the cause of the bug, but I am
> not sure, because I made no real investigation
>
> $ touch /tmp/First-October\ \'07.pdf
> $ emacs -Q
> C-x d /tmp/Firs TAB RET
>  ==> Listing directory failed but `access-file' worked

I think the fix is to quote ' as well in shell-quote-wildcard-pattern.
Could someone on this list double-check?


*** emacs/lisp/files.el.~1.896.2.37.~	2008-01-29 13:34:43.000000000 -0500
--- emacs/lisp/files.el	2008-02-23 17:25:50.000000000 -0500
***************
*** 4774,4780 ****
  
  PATTERN is assumed to represent a file-name wildcard suitable for the
  underlying filesystem.  For Unix and GNU/Linux, the characters from the
! set [ \\t\\n;<>&|()#$] are quoted with a backslash; for DOS/Windows, all
  the parts of the pattern which don't include wildcard characters are
  quoted with double quotes.
  Existing quote characters in PATTERN are left alone, so you can pass
--- 4774,4780 ----
  
  PATTERN is assumed to represent a file-name wildcard suitable for the
  underlying filesystem.  For Unix and GNU/Linux, the characters from the
! set [ \\t\\n;<>&|()#$'] are quoted with a backslash; for DOS/Windows, all
  the parts of the pattern which don't include wildcard characters are
  quoted with double quotes.
  Existing quote characters in PATTERN are left alone, so you can pass
***************
*** 4806,4812 ****
  	  (concat result (substring pattern beg) "\""))))
       (t
        (let ((beg 0))
! 	(while (string-match "[ \t\n;<>&|()#$]" pattern beg)
  	  (setq pattern
  		(concat (substring pattern 0 (match-beginning 0))
  			"\\"
--- 4806,4812 ----
  	  (concat result (substring pattern beg) "\""))))
       (t
        (let ((beg 0))
! 	(while (string-match "[ \t\n;<>&|()#$']" pattern beg)
  	  (setq pattern
  		(concat (substring pattern 0 (match-beginning 0))
  			"\\"




  reply	other threads:[~2008-02-23 22:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-21 20:31 [jidanni@jidanni.org: find-library-name perhaps should try .emacs] Richard Stallman
2008-02-23 22:28 ` Chong Yidong [this message]
2008-02-23 22:49   ` dired cannot access file names with a quote Glenn Morris
2008-02-23 23:55     ` Chong Yidong
2008-02-24  0:26   ` Stefan Monnier
2008-02-25 17:41   ` Chong Yidong

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=87r6f3ux2z.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=pot@gnu.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).