unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* handle cygwin path from ldapsearch
@ 2004-09-22  0:47 Tak Ota
  2004-09-23 20:44 ` Tak Ota
  0 siblings, 1 reply; 10+ messages in thread
From: Tak Ota @ 2004-09-22  0:47 UTC (permalink / raw)


The following patch provides correct handling of file path generated
by cygwin version of ldapsearch.

-Tak

2004-09-21  Takaaki Ota  <Takaaki.Ota@am.sony.com>

	* net/ldap.el (ldap-search): Handle cygwin file path appropriately.


*** ../../../../pub/emacs/emacs-21.3.50/lisp/net/ldap.el	Wed May 19 12:06:54 2004
--- ldap.el	Tue Sep 21 17:33:16 2004
***************
*** 582,592 ****
  	  (while (looking-at "^\\(\\w*\\)[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$")
  	    (setq name (match-string 1)
  		  value (match-string 3))
!             ;; Need to handle file:///D:/... as generated by OpenLDAP
!             ;; on DOS/Windows as local files.
!             (if (and (memq system-type '(windows-nt ms-dos))
!                      (eq (string-match "/\\(.:.*\\)$" value) 0))
!                 (setq value (match-string 1 value)))
  	    ;; Do not try to open non-existent files
  	    (if (equal value "")
  		(setq value " ")
--- 582,596 ----
  	  (while (looking-at "^\\(\\w*\\)[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$")
  	    (setq name (match-string 1)
  		  value (match-string 3))
!             ;; Need to handle pagan path
!             (if (memq system-type '(windows-nt ms-dos))
! 		(cond
! 		 ;; file:///D:/... as generated by OpenLDAP on DOS/Windows as local files.
! 		 ((string-match "/\\(.:.*\\)$" value)
! 		  (setq value (match-string 1 value)))
! 		 ;; /cygdrive/c/... as generated by OpenLDAP on Cygwin
! 		 ((string-match "/cygdrive/\\(.\\)\\(/.*\\)$" value)
! 		  (setq value (concat (match-string 1 value) ":" (match-string 2 value))))))
  	    ;; Do not try to open non-existent files
  	    (if (equal value "")
  		(setq value " ")

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

* Re: handle cygwin path from ldapsearch
  2004-09-22  0:47 handle cygwin path from ldapsearch Tak Ota
@ 2004-09-23 20:44 ` Tak Ota
  2004-09-23 20:57   ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Tak Ota @ 2004-09-23 20:44 UTC (permalink / raw)


Could someone please take a look at this?  I know it is not a very
high priority issue but the patch is not terribly complicated either.
If it looks reasonable please check it in.  Thank you.

-Tak

Tue, 21 Sep 2004 17:47:45 -0700 (PDT): Tak Ota <Takaaki.Ota@am.sony.com> wrote:

The following patch provides correct handling of file path generated
by cygwin version of ldapsearch.

-Tak

2004-09-21  Takaaki Ota  <Takaaki.Ota@am.sony.com>

	* net/ldap.el (ldap-search): Handle cygwin file path appropriately.


*** ../../../../pub/emacs/emacs-21.3.50/lisp/net/ldap.el	Wed May 19 12:06:54 2004
--- ldap.el	Tue Sep 21 17:33:16 2004
***************
*** 582,592 ****
  	  (while (looking-at "^\\(\\w*\\)[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$")
  	    (setq name (match-string 1)
  		  value (match-string 3))
!             ;; Need to handle file:///D:/... as generated by OpenLDAP
!             ;; on DOS/Windows as local files.
!             (if (and (memq system-type '(windows-nt ms-dos))
!                      (eq (string-match "/\\(.:.*\\)$" value) 0))
!                 (setq value (match-string 1 value)))
  	    ;; Do not try to open non-existent files
  	    (if (equal value "")
  		(setq value " ")
--- 582,596 ----
  	  (while (looking-at "^\\(\\w*\\)[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$")
  	    (setq name (match-string 1)
  		  value (match-string 3))
!             ;; Need to handle pagan path
!             (if (memq system-type '(windows-nt ms-dos))
! 		(cond
! 		 ;; file:///D:/... as generated by OpenLDAP on DOS/Windows as local files.
! 		 ((string-match "/\\(.:.*\\)$" value)
! 		  (setq value (match-string 1 value)))
! 		 ;; /cygdrive/c/... as generated by OpenLDAP on Cygwin
! 		 ((string-match "/cygdrive/\\(.\\)\\(/.*\\)$" value)
! 		  (setq value (concat (match-string 1 value) ":" (match-string 2 value))))))
  	    ;; Do not try to open non-existent files
  	    (if (equal value "")
  		(setq value " ")


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: handle cygwin path from ldapsearch
  2004-09-23 20:44 ` Tak Ota
@ 2004-09-23 20:57   ` Stefan Monnier
  2004-09-23 21:46     ` Tak Ota
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2004-09-23 20:57 UTC (permalink / raw)
  Cc: emacs-devel

> Could someone please take a look at this?  I know it is not a very
> high priority issue but the patch is not terribly complicated either.
> If it looks reasonable please check it in.  Thank you.

Is this patch necessary on a cigwin build of Emacs?
Is this patch necessary if you're using cygwin-mount.el?

I.e. is this really specific to ldap.el ?


        Stefan

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

* Re: handle cygwin path from ldapsearch
  2004-09-23 20:57   ` Stefan Monnier
@ 2004-09-23 21:46     ` Tak Ota
  2004-09-23 21:58       ` Stefan Monnier
  2004-09-23 22:01       ` Tak Ota
  0 siblings, 2 replies; 10+ messages in thread
From: Tak Ota @ 2004-09-23 21:46 UTC (permalink / raw)
  Cc: emacs-devel

Thu, 23 Sep 2004 16:57:46 -0400: Stefan Monnier <monnier@iro.umontreal.ca> wrote:

Good questions.

> Is this patch necessary on a cigwin build of Emacs?

I suppose so.  I'll build one and confirm this.

> Is this patch necessary if you're using cygwin-mount.el?

I am not familiar with cygwin-mount.el.  What does it do?

> I.e. is this really specific to ldap.el ?

In this case yes.  But the root of the problem is cygwin specific
path dialect (D:\ABC\DEF becomes /cygdrive/D/ABC/DEF).

-Tak

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

* Re: handle cygwin path from ldapsearch
  2004-09-23 21:46     ` Tak Ota
@ 2004-09-23 21:58       ` Stefan Monnier
  2004-09-23 22:03         ` Tak Ota
  2004-09-23 22:56         ` Jason Rumney
  2004-09-23 22:01       ` Tak Ota
  1 sibling, 2 replies; 10+ messages in thread
From: Stefan Monnier @ 2004-09-23 21:58 UTC (permalink / raw)
  Cc: emacs-devel

>> Is this patch necessary on a cigwin build of Emacs?
> I suppose so.  I'll build one and confirm this.

>> Is this patch necessary if you're using cygwin-mount.el?

> I am not familiar with cygwin-mount.el.  What does it do?

>> I.e. is this really specific to ldap.el ?

> In this case yes.  But the root of the problem is cygwin specific
> path dialect (D:\ABC\DEF becomes /cygdrive/D/ABC/DEF).

Right, but this problem is not specific to ldap but to cygwin.
When cygwin built, Emacs understands those filenames.
As for cygin-mount.el, it makes non-cygwin Emacs understand those file names
as well (by using a file-name-handler that rewrites them to the non-cygwin
format).


        Stefan

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

* Re: handle cygwin path from ldapsearch
  2004-09-23 21:46     ` Tak Ota
  2004-09-23 21:58       ` Stefan Monnier
@ 2004-09-23 22:01       ` Tak Ota
  1 sibling, 0 replies; 10+ messages in thread
From: Tak Ota @ 2004-09-23 22:01 UTC (permalink / raw)
  Cc: emacs-devel

Thu, 23 Sep 2004 14:46:04 -0700 (PDT): Tak Ota <Takaaki.Ota@am.sony.com> wrote:

> Thu, 23 Sep 2004 16:57:46 -0400: Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> 
> Good questions.
> 
> > Is this patch necessary on a cigwin build of Emacs?
> 
> I suppose so.  I'll build one and confirm this.

Actually I take this back.  Cygwin built emacs should understand the
/cygdrive/D/ABC/DEF path appropriately.  However, the patch is
irrelevant to cygwin built emacs since its system type is not
windows-nt or ms-dos but cygwin.

-Tak

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

* Re: handle cygwin path from ldapsearch
  2004-09-23 21:58       ` Stefan Monnier
@ 2004-09-23 22:03         ` Tak Ota
  2004-09-24 11:42           ` Stefan
  2004-09-23 22:56         ` Jason Rumney
  1 sibling, 1 reply; 10+ messages in thread
From: Tak Ota @ 2004-09-23 22:03 UTC (permalink / raw)
  Cc: emacs-devel

Thu, 23 Sep 2004 17:58:42 -0400: Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> >> Is this patch necessary on a cigwin build of Emacs?
> > I suppose so.  I'll build one and confirm this.
> 
> >> Is this patch necessary if you're using cygwin-mount.el?
> 
> > I am not familiar with cygwin-mount.el.  What does it do?
> 
> >> I.e. is this really specific to ldap.el ?
> 
> > In this case yes.  But the root of the problem is cygwin specific
> > path dialect (D:\ABC\DEF becomes /cygdrive/D/ABC/DEF).
> 
> Right, but this problem is not specific to ldap but to cygwin.
> When cygwin built, Emacs understands those filenames.
> As for cygin-mount.el, it makes non-cygwin Emacs understand those file names
> as well (by using a file-name-handler that rewrites them to the non-cygwin
> format).

Where can I find cygwin-mount.el?  Maybe that's the right answer.

-Tak

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

* Re: handle cygwin path from ldapsearch
  2004-09-23 21:58       ` Stefan Monnier
  2004-09-23 22:03         ` Tak Ota
@ 2004-09-23 22:56         ` Jason Rumney
  2004-09-23 23:14           ` Tak Ota
  1 sibling, 1 reply; 10+ messages in thread
From: Jason Rumney @ 2004-09-23 22:56 UTC (permalink / raw)
  Cc: Tak Ota, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Right, but this problem is not specific to ldap but to cygwin.
> When cygwin built, Emacs understands those filenames.
> As for cygin-mount.el, it makes non-cygwin Emacs understand those file names
> as well (by using a file-name-handler that rewrites them to the non-cygwin
> format).

cygwin-mount.el works transparently, but it is not distributed with
Emacs, so perhaps it would be better to use convert-standard-filename
here (and anywhere else that Emacs parses filenames from process
output).

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

* Re: handle cygwin path from ldapsearch
  2004-09-23 22:56         ` Jason Rumney
@ 2004-09-23 23:14           ` Tak Ota
  0 siblings, 0 replies; 10+ messages in thread
From: Tak Ota @ 2004-09-23 23:14 UTC (permalink / raw)
  Cc: monnier, emacs-devel

Thu, 23 Sep 2004 23:56:16 +0100: Jason Rumney <jasonr@gnu.org> wrote:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> > Right, but this problem is not specific to ldap but to cygwin.
> > When cygwin built, Emacs understands those filenames.
> > As for cygin-mount.el, it makes non-cygwin Emacs understand those file names
> > as well (by using a file-name-handler that rewrites them to the non-cygwin
> > format).
> 
> cygwin-mount.el works transparently, but it is not distributed with
> Emacs, so perhaps it would be better to use convert-standard-filename
> here (and anywhere else that Emacs parses filenames from process
> output).

Aha!  That is the perfect function for this.  I didn't know the
existence of such function.

BTW, I'm not familiar with cygwin-mount.el but it sounds useful.  Is
there a reason why it is not included in emacs?  I rely on cygwin
because of its complete coverage and good maintenance.  However,
cygwin emacs is much slower and requires X emulation to have graphical
user interface.  I believe there is a good demand of using native
emacs (mingw/MSVC built) together with cygwin tools.

-Tak

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

* Re: handle cygwin path from ldapsearch
  2004-09-23 22:03         ` Tak Ota
@ 2004-09-24 11:42           ` Stefan
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan @ 2004-09-24 11:42 UTC (permalink / raw)
  Cc: emacs-devel

> Where can I find cygwin-mount.el?  Maybe that's the right answer.

"Google Emacs cygwin-mount.el" should find it for you.


        Stefan

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

end of thread, other threads:[~2004-09-24 11:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-22  0:47 handle cygwin path from ldapsearch Tak Ota
2004-09-23 20:44 ` Tak Ota
2004-09-23 20:57   ` Stefan Monnier
2004-09-23 21:46     ` Tak Ota
2004-09-23 21:58       ` Stefan Monnier
2004-09-23 22:03         ` Tak Ota
2004-09-24 11:42           ` Stefan
2004-09-23 22:56         ` Jason Rumney
2004-09-23 23:14           ` Tak Ota
2004-09-23 22:01       ` Tak Ota

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