bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] Emacs cygwin path completion support


From: Eli Zaretskii
Subject: Re: [patch] Emacs cygwin path completion support
Date: Mon, 01 Jan 2001 21:05:28 +0200

> From: address@hidden (Jari Aalto+mail.emacs)
> Newsgroups: gnu.emacs.bug
> Date: 01 Jan 2001 18:49:24 +0200
>
> + (defun w32-cygwin-path-to-dos (path)
> +   "Convert cygwin like //c/temp  or /cygdrive/d/temp path to
> + dos notation c:/temp."
> +   ;;  NOTE for cygwin and bash shell prompt
> +   ;;  We can't require a slash after the drive letter, because
> +   ;;  //c   and  /cygdrive/c   are all top level roots.
> +   ;;
> +   ;; The bash shell's PS1 setting \w (The current working directory)
> +   ;; Does not add trailing slash.
> +   (cond
> +    ((or (string-match "^//\\([a-z]\\)/?$" path)
> +     (string-match "^/cygdrive/\\([a-z]\\)/?$" path))
> +     (concat (match-string 1 path) ":/"))
> +    ((or (string-match "^//\\([a-z]\\)\\(.*\\)" path)
> +     (string-match "^/cygdrive/\\([a-z]\\)\\(.*\\)" path))
> +     (concat (match-string 1 path) ":" (match-string 2 path)))
> +    (t
> +     path)))

The last two regexps are still too general, I think.  For example,
"^/cygdrive/\\([a-z]\\)\\(.*\\)" will let "/cygdrive/foobar" be
converted to "f:oobar".  That's not what you want, I think.

I see the note you put in the comment above, but I think it only
pertains to the case like "/cygdrive/c" which you test in the first
part of `cond'.  Wouldn't using "^/cygdrive/\\([a-z]\\)\\(/.*\\)", and
similar for the "//c/foo" syntax, be better in the second part?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]