emacs-devel
[Top][All Lists]
Advanced

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

exec-path "/:" prefix; file-name-handler-*; start-process


From: Karl Chen
Subject: exec-path "/:" prefix; file-name-handler-*; start-process
Date: Tue, 20 Aug 2002 01:28:04 -0700 (PDT)

Why does initializing `exec-path' need to prepend a "/:" to paths that
"would otherwise be treated as magic" ?
[emacs.c : decode_env_path ():
      ...
      tem = Ffind_file_name_handler (element, Qt);
      if (! NILP (tem))
        element = concat2 (build_string ("/:"), element);
      ...
]

All single-directory (single slash) paths in PATH such as /bin turn into
/:/bin. This may be the fault of sloppy regexes in ange-ftp. Seems like a
dirty hack, having to say "this is a normal path."

At first I thought it was a bug - there are unresolved bug reports about
it in debian archives. I even wrote a lisp kludge around it to get rid of
all initial "/:"s in exec-path.

I use (simplified):
  (setq explicit-shell-file-name (which "bash"))

On many systems bash is first found in /bin. (which "bash") finds
"/:/bin/bash" since (file-executable-p "/:/bin/bash") returns t. However,
"/:/bin/bash" is not acceptable as an `explicit-shell-file-name' for
`shell' since it eventually calls `comint-exec' which calls
`start-process'.

I think either the /: prefixing can/should be removed from
decode_env_path(), or file-name-handler stuff should be expanded to
start-process and possibly other functions.

If it still is neccessary for exec-path to have "/:" for single-directory
paths (probably is; I don't know anything about emacs internals), then it
should at least be documented in `exec-path' that the default-generated
directory names in it could have a superfluous /:  prepended. Then it
would have been easy to figure out to add a "s,^/:,," in which.el.

-- 
Karl Chen / address@hidden






reply via email to

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