unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [jidanni@jidanni.org: find-library-name perhaps should try .emacs]
@ 2008-01-21 20:31 Richard Stallman
  2008-02-23 22:28 ` dired cannot access file names with a quote Chong Yidong
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2008-01-21 20:31 UTC (permalink / raw)
  To: emacs-devel

Would someone please DTRT and ack?

------- Start of forwarded message -------
To: bug-gnu-emacs@gnu.org
From: jidanni@jidanni.org
Date: Mon, 21 Jan 2008 11:05:55 +0800
Message-ID: <87abmzzxm4.fsf@jidanni.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Subject: find-library-name perhaps should try .emacs 

  C-h k runs the command describe-key
which showed me
  C-x t runs the command jidanni-tidy-buffer
  which is an interactive compiled Lisp function in `/home/jidanni/.emacs.elc'.
But when I clicked that filename, I got
  find-library-name: Can't find library /home/jidanni/.emacs.el
Why of course. It's in .emacs, not .emacs.el.

(I use (add-hook 'emacs-lisp-mode-hook '(lambda () (add-hook
 'after-save-hook '(lambda () (byte-compile-file buffer-file-name) )
 nil t))) to make it.) emacs-version "22.1.1"
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: dired cannot access file names with a quote
  2008-01-21 20:31 [jidanni@jidanni.org: find-library-name perhaps should try .emacs] Richard Stallman
@ 2008-02-23 22:28 ` Chong Yidong
  2008-02-23 22:49   ` Glenn Morris
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chong Yidong @ 2008-02-23 22:28 UTC (permalink / raw)
  To: Francesco Potortì; +Cc: emacs-devel

> 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))
  			"\\"




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: dired cannot access file names with a quote
  2008-02-23 22:28 ` dired cannot access file names with a quote Chong Yidong
@ 2008-02-23 22:49   ` Glenn Morris
  2008-02-23 23:55     ` Chong Yidong
  2008-02-24  0:26   ` Stefan Monnier
  2008-02-25 17:41   ` Chong Yidong
  2 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2008-02-23 22:49 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Francesco Potortì, emacs-devel

Chong Yidong wrote:

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

Won't that break things like 'foo*' that people might want to pass to
shell-quote-wildcard-pattern, as per the comment in the function's
doc-string?

'foo*' and \'foo*\' are not the same to the shell.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: dired cannot access file names with a quote
  2008-02-23 22:49   ` Glenn Morris
@ 2008-02-23 23:55     ` Chong Yidong
  0 siblings, 0 replies; 6+ messages in thread
From: Chong Yidong @ 2008-02-23 23:55 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Francesco Potortì, emacs-devel

Glenn Morris <rgm@gnu.org> writes:

> Chong Yidong wrote:
>
>> I think the fix is to quote ' as well in shell-quote-wildcard-pattern.
>> Could someone on this list double-check?
>
> Won't that break things like 'foo*' that people might want to pass to
> shell-quote-wildcard-pattern, as per the comment in the function's
> doc-string?
>
> 'foo*' and \'foo*\' are not the same to the shell.

Don't the quote characters referred to in the docstring refer to
backslash (\)?

The only place that calls shell-quote-wildcard-pattern in the Emacs
source tree is insert-directory, and the logic in insert-directory
indicates that shell-quote-wildcard-pattern is simply intended to
quote special characters that would screw up the call to `ls'.  Is
there any way of passing a ' character in the file argument to
insert-directory, except as a literal part of a filename?




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: dired cannot access file names with a quote
  2008-02-23 22:28 ` dired cannot access file names with a quote Chong Yidong
  2008-02-23 22:49   ` Glenn Morris
@ 2008-02-24  0:26   ` Stefan Monnier
  2008-02-25 17:41   ` Chong Yidong
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2008-02-24  0:26 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Francesco Potort\x1fFFFFFF, emacs-devel

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

I haven't had time to check if that makes sense, but if it makes sense,
then " should probably be added as well.


        Stefan


> *** 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))
>   			"\\"





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: dired cannot access file names with a quote
  2008-02-23 22:28 ` dired cannot access file names with a quote Chong Yidong
  2008-02-23 22:49   ` Glenn Morris
  2008-02-24  0:26   ` Stefan Monnier
@ 2008-02-25 17:41   ` Chong Yidong
  2 siblings, 0 replies; 6+ messages in thread
From: Chong Yidong @ 2008-02-25 17:41 UTC (permalink / raw)
  To: Francesco Potortì; +Cc: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

>> 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?

I've checked this change into both the branch and the trunk.  I think
it's safe, but please keep an eye out for anything unusual.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-25 17:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21 20:31 [jidanni@jidanni.org: find-library-name perhaps should try .emacs] Richard Stallman
2008-02-23 22:28 ` dired cannot access file names with a quote Chong Yidong
2008-02-23 22:49   ` Glenn Morris
2008-02-23 23:55     ` Chong Yidong
2008-02-24  0:26   ` Stefan Monnier
2008-02-25 17:41   ` Chong Yidong

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).