unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: read-file-name
       [not found]   ` <c63n4v$7kg0n$1@ID-228056.news.uni-berlin.de>
@ 2004-04-20 21:15     ` Kevin Rodgers
  2004-04-21  3:43       ` read-file-name Elvin Peterson
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Rodgers @ 2004-04-20 21:15 UTC (permalink / raw)


Elvin Peterson wrote:
 > Thanks.  The default is not an issue when the directory DIR is an
 > absolute path.  Shouldn't it show up in the read-file-name
 > documentation?

I don't see any difference in the behavior of read-file-name when DIR is
an absolute vs. relative path.  If I type RET at the prompt, both of
these forms return DIR:

(read-file-name "Image File: " "images")
(read-file-name "Image File: " "/images")

P.S. You probably want to use "images/" as DIR anyway -- see
      file-name-as-directory.

-- 
Kevin Rodgers

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

* Re: read-file-name
  2004-04-20 21:15     ` read-file-name Kevin Rodgers
@ 2004-04-21  3:43       ` Elvin Peterson
  2004-04-21 15:42         ` read-file-name Kevin Rodgers
  2004-04-22  0:35         ` read-file-name Thien-Thi Nguyen
  0 siblings, 2 replies; 4+ messages in thread
From: Elvin Peterson @ 2004-04-21  3:43 UTC (permalink / raw)


Kevin Rodgers wrote:
> Elvin Peterson wrote:
>  > Thanks.  The default is not an issue when the directory DIR is an
>  > absolute path.  Shouldn't it show up in the read-file-name
>  > documentation?
> 
> I don't see any difference in the behavior of read-file-name when DIR is
> an absolute vs. relative path.  If I type RET at the prompt, both of
> these forms return DIR:

Yes, the behavior is the same if you press RET.  However, it is 
completely different for TAB completion, where the first one fails in 
tha absence of the let workaround.

> 
> (read-file-name "Image File: " "images")
> (read-file-name "Image File: " "/images")
> 
> P.S. You probably want to use "images/" as DIR anyway -- see
>      file-name-as-directory.

I have done that, although it only seems to make a difference for VMS.

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

* Re: read-file-name
  2004-04-21  3:43       ` read-file-name Elvin Peterson
@ 2004-04-21 15:42         ` Kevin Rodgers
  2004-04-22  0:35         ` read-file-name Thien-Thi Nguyen
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2004-04-21 15:42 UTC (permalink / raw)


Elvin Peterson wrote:
 > Kevin Rodgers wrote:
 >> I don't see any difference in the behavior of read-file-name when DIR is
 >> an absolute vs. relative path.  If I type RET at the prompt, both of
 >> these forms return DIR:
 >>
 >> (read-file-name "Image File: " "images")
 >> (read-file-name "Image File: " "/images")
 >
 > Yes, the behavior is the same if you press RET.  However, it is
 > completely different for TAB completion, where the first one fails in
 > tha absence of the let workaround.

Ah, well you didn't mention completion in either of your 2 previous
posts.

It does seem to be a bug, that read-file-name signals an error when
insert-default-directory is non-nil and DIR is a relative file name, and
the user types TAB or ?.  So I'm cross-posting this to gnu.emacs.bug and
directing followups there.

-- 
Kevin Rodgers

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

* Re: read-file-name
  2004-04-21  3:43       ` read-file-name Elvin Peterson
  2004-04-21 15:42         ` read-file-name Kevin Rodgers
@ 2004-04-22  0:35         ` Thien-Thi Nguyen
  1 sibling, 0 replies; 4+ messages in thread
From: Thien-Thi Nguyen @ 2004-04-22  0:35 UTC (permalink / raw)


Elvin Peterson <elvin_peterson@yahoo.com> writes:

> I have done that, although it only seems to make a difference for VMS.

filename completion behavior under vms depends on emacs version.
historically, that piece of code was developed apart from the unixoid
filename completion code, the rationale probably being that less gray
hairs would thus be produced.  well, now we have all these colorful
dyes[1] so it turns out the best hair to play w/ is the gray kind, i.e.,
the well-aged and better-maintained mainstream codebase.

fwiw, for the work-in-progress emacs 21.x port[2], which re-integrates
the filename completion implementations (albeit imperfectly due to
axiomatic differences), i believe you can coax analogous behavior under
both unix and vms for the non-nested RELDIR case by using the construct:

  (read-file-name PROMPT (expand-file-name RELDIR))

you can also try fiddling w/ the rest of the `read-file-name' args, to
override the (heuristic, fallable, unix-assuming) defaults.

thi


_________________________________________________________
[1] such as handlers triggering on stylized filenames,
    filenames w/ non-ASCII chars, etc.
[2] http://www.emacswiki.org/cgi-bin/wiki/EmacsOnVMS

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

end of thread, other threads:[~2004-04-22  0:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <c62ci8$6ut3i$1@ID-228056.news.uni-berlin.de>
     [not found] ` <408557E8.3020903@yahoo.com>
     [not found]   ` <c63n4v$7kg0n$1@ID-228056.news.uni-berlin.de>
2004-04-20 21:15     ` read-file-name Kevin Rodgers
2004-04-21  3:43       ` read-file-name Elvin Peterson
2004-04-21 15:42         ` read-file-name Kevin Rodgers
2004-04-22  0:35         ` read-file-name Thien-Thi Nguyen

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