all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* "ange-ftp" with a space in filename
@ 2008-07-14 18:19 shoichi takasaki
  0 siblings, 0 replies; 7+ messages in thread
From: shoichi takasaki @ 2008-07-14 18:19 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]


Hi there,

I just started using 'ange-ftp' on an emacs built for windows and encounter access issues when a filename or directory name contains a space in it. This should be very common issues as I can imagine a space can be used all the time for filenames in Windows world. How do you get around with this except modifying elisp code for it?  

(I am hoping this issue is not left out due to a political issue between Unix and Windows system. But I don't think that is the case as Dired can work perfectly for local files with or without a space in it.)

emacs-version: GNU Emacs 22.0.990.1 (i386-mingw-nt5.1.2600) of 2007-05-23 on LENNART-69DE564 (patched)

Thanks.
Shoichi

_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

[-- Attachment #2: Type: text/html, Size: 1040 bytes --]

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

* Re: "ange-ftp" with a space in filename
       [not found] <mailman.14734.1216088696.18990.help-gnu-emacs@gnu.org>
@ 2008-07-15 14:56 ` Michael Albinus
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Albinus @ 2008-07-15 14:56 UTC (permalink / raw)
  To: shoichi takasaki; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

shoichi takasaki <shoichi23@hotmail.com> writes:

> Hi there,

Hi,

> I just started using 'ange-ftp' on an emacs built for windows and
> encounter access issues when a filename or directory name contains a
> space in it. This should be very common issues as I can imagine a
> space can be used all the time for filenames in Windows world. How
> do you get around with this except modifying elisp code for it?
>
> emacs-version: GNU Emacs 22.0.990.1 (i386-mingw-nt5.1.2600) of
> 2007-05-23 on LENNART-69DE564 (patched)

Please try the appended patch. It was submitted towards Emacs 23, and
it shall fix the problem in your Emacs version as well.

Sorry, it DOES modify the code. But I don't know another way to solve it.

> Thanks.
> Shoichi


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1780 bytes --]

*** ange-ftp.el	2007/03/09 09:14:19	1.84
--- ange-ftp.el	2008/02/19 19:22:28	1.97
***************
*** 1523,1541 ****
  
  (defun ange-ftp-quote-string (string)
    "Quote any characters in STRING that may confuse the ftp process."
!   (apply 'concat
! 	 (mapcar (lambda (char)
! 		   ;; This is said to be wrong; ftp is said to
! 		   ;; need quoting only for ", and that by doubling it.
! 		   ;; But experiment says this kind of quoting is correct
! 		   ;; when talking to ftp on GNU/Linux systems.
! 		   (if (or (<= char ? )
! 			   (> char ?\~)
! 			   (= char ?\")
! 			   (= char ?\\))
! 		       (vector ?\\ char)
! 		     (vector char)))
! 		 string)))
  
  (defun ange-ftp-barf-if-not-directory (directory)
    (or (file-directory-p directory)
--- 1523,1535 ----
  
  (defun ange-ftp-quote-string (string)
    "Quote any characters in STRING that may confuse the ftp process."
!   ;; This is said to be wrong; ftp is said to need quoting only for ",
!   ;; and that by doubling it.  But experiment says UNIX-style kind of
!   ;; quoting is correct when talking to ftp on GNU/Linux systems, and
!   ;; W32-style kind of quoting on, yes, W32 systems.
!   (if (stringp string)
!       (shell-quote-argument string)
!     ""))
  
  (defun ange-ftp-barf-if-not-directory (directory)
    (or (file-directory-p directory)
***************
*** 3766,3772 ****
  	    (ange-ftp-send-cmd
  	     t-host
  	     t-user
! 	     (list 'put (or temp2 filename) t-name)
  	     (or msg
  		 (if (and temp2 f-parsed)
  		     (format "Putting %s" newname)
--- 3760,3766 ----
  	    (ange-ftp-send-cmd
  	     t-host
  	     t-user
! 	     (list 'put (or temp2 (ange-ftp-quote-string filename)) t-name)
  	     (or msg
  		 (if (and temp2 f-parsed)
  		     (format "Putting %s" newname)

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

* Re: "ange-ftp" with a space in filename
@ 2008-07-16 23:37 shoichi takasaki
  2008-07-17  8:36 ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: shoichi takasaki @ 2008-07-16 23:37 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: michael.albinus

[-- Attachment #1: Type: text/plain, Size: 995 bytes --]



> Please try the appended patch. It was submitted towards Emacs 23, and
> it shall fix the problem in your Emacs version as well.

This patch didn't work for my emacs. After applying this patch, I cannot even access to the FTP site that I was testing on. The following is the error I get when I try to open an FTP connection:

cd /cygwin/cygwin/cygwin/
550 /cygwin/cygwin/cygwin: No such file or directory.

I appreciate if you have any input on this. As you can see, I have cygwin installed on my machine. That is why the root folder is "cygwin". I don't have three /cygwin folders though.

> Sorry, it DOES modify the code. But I don't know another way to solve it.

Don't be. I meant to say for me personally to modify code as I thought this is a common issue. I thought there must be a patch.

Regards,
Shoichi


_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

[-- Attachment #2: Type: text/html, Size: 1214 bytes --]

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

* Re: "ange-ftp" with a space in filename
  2008-07-16 23:37 shoichi takasaki
@ 2008-07-17  8:36 ` Michael Albinus
  2008-07-17 17:07   ` shoichi takasaki
  2008-07-17 21:28   ` shoichi takasaki
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Albinus @ 2008-07-17  8:36 UTC (permalink / raw)
  To: shoichi takasaki; +Cc: help-gnu-emacs

shoichi takasaki <shoichi23@hotmail.com> writes:

>> Please try the appended patch. It was submitted towards Emacs 23, and
>> it shall fix the problem in your Emacs version as well.
>
> This patch didn't work for my emacs. After applying this patch, I cannot even access to the FTP site that I was testing on. The following is the error I get when I try to open an FTP connection:
>
> cd /cygwin/cygwin/cygwin/
> 550 /cygwin/cygwin/cygwin: No such file or directory.

Could you, please, show the *whole* contents of the ange-ftp buffer?

> Regards,
> Shoichi

Best regards, Michael.





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

* RE: "ange-ftp" with a space in filename
  2008-07-17  8:36 ` Michael Albinus
@ 2008-07-17 17:07   ` shoichi takasaki
  2008-07-17 21:28   ` shoichi takasaki
  1 sibling, 0 replies; 7+ messages in thread
From: shoichi takasaki @ 2008-07-17 17:07 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]



Hi Michael,

> >> Please try the appended patch. It was submitted towards Emacs 23, and
> >> it shall fix the problem in your Emacs version as well.
> >
> > This patch didn't work for my emacs. After applying this patch, I cannot even access to the FTP site that I was testing on. The following is the error I get when I try to open an FTP connection:
> >
> > cd /cygwin/cygwin/cygwin/
> > 550 /cygwin/cygwin/cygwin: No such file or directory.
> 
> Could you, please, show the *whole* contents of the ange-ftp buffer?
> 

(I should have done this earlier but) I used 'emacs -q' to see if this issue takes place or not and it didn't. With this patch, I am able to connect to the same FTP that I had a connection issue and can also open a directory with a space in the name. I will see what is causing this issue when I run emacs with my setup files. If I need your further help, I will be back. Thank you so much for the patch and help! :)

Shoichi

_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

[-- Attachment #2: Type: text/html, Size: 1456 bytes --]

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

* RE: "ange-ftp" with a space in filename
  2008-07-17  8:36 ` Michael Albinus
  2008-07-17 17:07   ` shoichi takasaki
@ 2008-07-17 21:28   ` shoichi takasaki
  2008-07-18  4:50     ` Michael Albinus
  1 sibling, 1 reply; 7+ messages in thread
From: shoichi takasaki @ 2008-07-17 21:28 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]


Hi






> (I should have done this earlier but) I used 'emacs -q' to see if this issue takes place or not and it didn't. > With this patch, I am able to connect to the same FTP that I had a connection issue and can also open a > directory with a space in the name. I will see what is causing this issue when I run emacs with my setup > files. If I need your further help, I will be back. Thank you so much for the patch and help! :)

I figured out that the line that causing this difference in my .emacs is below:
(setq shell-file-name "bash")

This is set as "c:\Program Files\Emacs\emacs\bin\cmdproxy.exe" in default and the patch works then. I am not sure why this 'bash' causes this issue. Would be great if you or someone can explain this to me.

Shoichi


_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

[-- Attachment #2: Type: text/html, Size: 1400 bytes --]

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

* Re: "ange-ftp" with a space in filename
  2008-07-17 21:28   ` shoichi takasaki
@ 2008-07-18  4:50     ` Michael Albinus
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Albinus @ 2008-07-18  4:50 UTC (permalink / raw)
  To: shoichi takasaki; +Cc: help-gnu-emacs

shoichi takasaki <shoichi23@hotmail.com> writes:

> Hi

Hi,

> I figured out that the line that causing this difference in my .emacs
> is below:
> (setq shell-file-name "bash")
>
> This is set as "c:\Program Files\Emacs\emacs\bin\cmdproxy.exe" in
> default and the patch works then. I am not sure why this 'bash' causes
> this issue. Would be great if you or someone can explain this to me.

Sorry, I don't use W32, so I cannot help.

> Shoichi

Best regards, Michael.




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

end of thread, other threads:[~2008-07-18  4:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.14734.1216088696.18990.help-gnu-emacs@gnu.org>
2008-07-15 14:56 ` "ange-ftp" with a space in filename Michael Albinus
2008-07-16 23:37 shoichi takasaki
2008-07-17  8:36 ` Michael Albinus
2008-07-17 17:07   ` shoichi takasaki
2008-07-17 21:28   ` shoichi takasaki
2008-07-18  4:50     ` Michael Albinus
  -- strict thread matches above, loose matches on Subject: below --
2008-07-14 18:19 shoichi takasaki

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.