all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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; 8+ 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] 8+ 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
                           ` (2 more replies)
  0 siblings, 3 replies; 8+ 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] 8+ 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-21 15:42         ` Kevin Rodgers
  2004-04-22  0:35         ` read-file-name Thien-Thi Nguyen
  2 siblings, 0 replies; 8+ 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] 8+ 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-21 15:42         ` read-file-name Kevin Rodgers
  2004-04-22  0:35         ` read-file-name Thien-Thi Nguyen
  2 siblings, 0 replies; 8+ 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] 8+ 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-21 15:42         ` read-file-name Kevin Rodgers
@ 2004-04-22  0:35         ` Thien-Thi Nguyen
  2 siblings, 0 replies; 8+ 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] 8+ messages in thread

* Re: read-file-name
  2009-11-09 10:14           ` read-file-name (was: FFAP) Juri Linkov
@ 2009-11-09 14:31             ` Stefan Monnier
  2009-11-10  0:55               ` read-file-name Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2009-11-09 14:31 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

> All completion functions support a list of default values
> except `read-file-name'.  The following patch fills this hole.

Looks OK, feel free to install it.

> !       (if (consp default-filename)
> ! 	  (setq default-filename (mapcar 'abbreviate-file-name default-filename))
> ! 	(setq default-filename (abbreviate-file-name default-filename))))

That should be

       (setq default-filename
             (if (consp default-filename)
                 (mapcar 'abbreviate-file-name default-filename)
               (abbreviate-file-name default-filename))))


-- Stefan




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

* Re: read-file-name
  2009-11-09 14:31             ` read-file-name Stefan Monnier
@ 2009-11-10  0:55               ` Juri Linkov
  2009-11-10 17:25                 ` read-file-name Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2009-11-10  0:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

>> All completion functions support a list of default values
>> except `read-file-name'.  The following patch fills this hole.
>
> Looks OK, feel free to install it.
>
>> !       (if (consp default-filename)
>> ! 	  (setq default-filename (mapcar 'abbreviate-file-name default-filename))
>> ! 	(setq default-filename (abbreviate-file-name default-filename))))
>
> That should be
>
>        (setq default-filename
>              (if (consp default-filename)
>                  (mapcar 'abbreviate-file-name default-filename)
>                (abbreviate-file-name default-filename))))

Done.

BTW, do you know an Emacs function that does such
common subexpression elimination?

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: read-file-name
  2009-11-10  0:55               ` read-file-name Juri Linkov
@ 2009-11-10 17:25                 ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2009-11-10 17:25 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

> BTW, do you know an Emacs function that does such
> common subexpression elimination?

No,


        Stefan




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

end of thread, other threads:[~2009-11-10 17:25 UTC | newest]

Thread overview: 8+ 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-21 15:42         ` read-file-name Kevin Rodgers
2004-04-22  0:35         ` read-file-name Thien-Thi Nguyen
2009-11-06  0:13 find-file-literally-at-point Edward O'Connor
2009-11-06  1:45 ` find-file-literally-at-point Juri Linkov
2009-11-06  4:20   ` FFAP (was: find-file-literally-at-point) Stefan Monnier
2009-11-06  4:45     ` FFAP Juri Linkov
2009-11-06 15:18       ` FFAP Stefan Monnier
2009-11-06 21:19         ` FFAP Juri Linkov
2009-11-09 10:14           ` read-file-name (was: FFAP) Juri Linkov
2009-11-09 14:31             ` read-file-name Stefan Monnier
2009-11-10  0:55               ` read-file-name Juri Linkov
2009-11-10 17:25                 ` read-file-name Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.