unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* exec-path "/:" prefix; file-name-handler-*; start-process
@ 2002-08-20  8:28 Karl Chen
  2002-08-20  8:55 ` Kai Großjohann
  2002-08-24  2:33 ` Richard Stallman
  0 siblings, 2 replies; 5+ messages in thread
From: Karl Chen @ 2002-08-20  8:28 UTC (permalink / raw)



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 / quarl@quarl.org

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

* Re: exec-path "/:" prefix; file-name-handler-*; start-process
  2002-08-20  8:28 exec-path "/:" prefix; file-name-handler-*; start-process Karl Chen
@ 2002-08-20  8:55 ` Kai Großjohann
  2002-08-24  2:33 ` Richard Stallman
  1 sibling, 0 replies; 5+ messages in thread
From: Kai Großjohann @ 2002-08-20  8:55 UTC (permalink / raw)
  Cc: emacs-devel

Karl Chen <quarl@hkn.eecs.berkeley.edu> writes:

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

Just a random thought on this: it's clearly useful that Ange-FTP
grabs filenames like these -- this enables user/host name
completion.

But now, Tramp takes over those files, and so in principle, one could
require the user to use "/ftp:foo" filenames when user/host name
completion is desired, so it might not be necessary anymore to have
Ange-FTP (or Tramp) grab filenames like "/foo".

I'm not sure what to do, though.

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

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

* Re: exec-path "/:" prefix; file-name-handler-*; start-process
  2002-08-20  8:28 exec-path "/:" prefix; file-name-handler-*; start-process Karl Chen
  2002-08-20  8:55 ` Kai Großjohann
@ 2002-08-24  2:33 ` Richard Stallman
  2002-08-24 10:31   ` Kai Großjohann
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2002-08-24  2:33 UTC (permalink / raw)
  Cc: emacs-devel

    Why does initializing `exec-path' need to prepend a "/:" to paths that
    "would otherwise be treated as magic" ?

Because without that they really would mean something else.
If you have a directory /foo:, Emacs would get confused by the
name /foo: without the /: in front.

    All single-directory (single slash) paths in PATH such as /bin turn into
    /:/bin.

The name /bin is not really magic, but it seems to be magic
because of the hostname completion facility.
These names don't need to have /: added, and should not have it.

In the current development version, /: is not added to them.
I am not sure what caused the change; perhaps it has to do
with installing Tramp.  It could be that this has introduced
some other bug or that the hostname completion facility
has been deactivated.  Kai, could you see whether the hostname completion
facility still works?

Anyway, I fixed this problem for 21.3.

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

"/:/bin/bash" is a valid name in Emacs for that file,
so it should work in start-process.  I fixed that, and
call-process too.

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

* Re: exec-path "/:" prefix; file-name-handler-*; start-process
  2002-08-24  2:33 ` Richard Stallman
@ 2002-08-24 10:31   ` Kai Großjohann
  2002-08-25  5:27     ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: Kai Großjohann @ 2002-08-24 10:31 UTC (permalink / raw)
  Cc: q.edg3784561, emacs-devel

Richard Stallman <rms@gnu.org> writes:

> In the current development version, /: is not added to them.
> I am not sure what caused the change; perhaps it has to do
> with installing Tramp.  It could be that this has introduced
> some other bug or that the hostname completion facility
> has been deactivated.  Kai, could you see whether the hostname completion
> facility still works?

Tramp does not support hostname completion at the moment.  Luckily,
Michael Albinus has already written code to support it.  It still
needs to be tested, though.

But I have no idea (yet) what will happen to "/:" in exec-path after
Michael's feature is added to Tramp.  Hm.

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

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

* Re: exec-path "/:" prefix; file-name-handler-*; start-process
  2002-08-24 10:31   ` Kai Großjohann
@ 2002-08-25  5:27     ` Richard Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2002-08-25  5:27 UTC (permalink / raw)
  Cc: q.edg3784561, emacs-devel

    But I have no idea (yet) what will happen to "/:" in exec-path after
    Michael's feature is added to Tramp.  Hm.

I fixed the problem in general.  You just need to add a safe-magic
property to the handler that you use to complete single-component file
names as possible host names.

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

end of thread, other threads:[~2002-08-25  5:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-20  8:28 exec-path "/:" prefix; file-name-handler-*; start-process Karl Chen
2002-08-20  8:55 ` Kai Großjohann
2002-08-24  2:33 ` Richard Stallman
2002-08-24 10:31   ` Kai Großjohann
2002-08-25  5:27     ` Richard Stallman

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