From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: dired cannot access file names with a quote Date: Sat, 23 Feb 2008 17:28:20 -0500 Message-ID: <87r6f3ux2z.fsf@stupidchicken.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203805804 26298 80.91.229.12 (23 Feb 2008 22:30:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Feb 2008 22:30:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Francesco =?utf-8?Q?Potort=C3=AC?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 23 23:30:29 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JT2t1-0005CW-09 for ged-emacs-devel@m.gmane.org; Sat, 23 Feb 2008 23:30:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT2sV-0001Qq-8B for ged-emacs-devel@m.gmane.org; Sat, 23 Feb 2008 17:29:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JT2sR-0001Qd-1z for emacs-devel@gnu.org; Sat, 23 Feb 2008 17:29:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JT2sO-0001QR-Jt for emacs-devel@gnu.org; Sat, 23 Feb 2008 17:29:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT2sO-0001QO-D2 for emacs-devel@gnu.org; Sat, 23 Feb 2008 17:29:48 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JT2sK-0000EU-Hv; Sat, 23 Feb 2008 17:29:44 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 84F5C4E495; Sat, 23 Feb 2008 17:28:20 -0500 (EST) In-Reply-To: (Richard Stallman's message of "Mon\, 21 Jan 2008 15\:31\:02 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.91 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90168 Archived-At: > 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)) "\\"