Current implementation use `substitute-in-file-name' which substitute environment variables; that function deal with '//' differently as expected on unix systems:

In unix systems there is no difference between:

I)  /foo//bar/baz
II) /foo/bar/baz

but `substitute-in-file-name' will translate I) into:
/bar/baz

I found more sensible if 'parse-colon-path' would made no difference
between I) and II).

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In *scratch* buffer after started session with:
emacs -Q

(let ((foo "/home/user/soft/bin/:/usr/bin/:/usr/local/bin"))
  (setenv "FOO" foo)
  (parse-colon-path "$FOO"))
("/home/user/soft/bin/:/usr/bin/:/usr/local/bin/")
(let ((foo "/home/user/soft/bin/:/usr/bin/:usr/local/bin/"))
  (setenv "FOO" foo)
  (parse-colon-path "$FOO"))
("/")

(let ((foo "/home/user/soft//bin/:/usr/bin/:/usr/local/bin"))
  (setenv "FOO" foo)
  (parse-colon-path "$FOO"))
("/bin/:/usr/bin/:/usr/local/bin/")

(let ((foo "/home/user/soft//bin/:/usr/bin/:/usr/local/bin/"))
  (setenv "FOO" foo)
  (parse-colon-path "$FOO"))
("/")

(let ((foo "/home/user/soft/bin/:/usr/bin/"))
  (setenv "FOO" foo)
  (parse-colon-path (getenv "FOO")))
("/home/user/soft/bin/" "/usr/bin/")

(let* ((foo "/home/user")
       (bar "$FOO/soft/bin/:/usr/bin/"))
  (setenv "FOO" foo)
  (setenv "BAR" bar)
  (parse-colon-path (getenv "BAR")))
("/home/user/soft/bin/" "/usr/bin/")

(let* ((foo "/home/user/")
           (bar "$FOO/soft/bin/:/usr/bin/"))
  (setenv "FOO" foo)
  (setenv "BAR" bar)
  (parse-colon-path (getenv "BAR")))
("/soft/bin/" "/usr/bin/")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Emacs  : GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll 
bars)
 of 2015-09-06
Package: Org-mode version 8.2.10 (release_8.2.10 @ 
/home/calancha/tmp/emacs_git/emacs/lisp/org/)

Reply via email to