emacs-devel
[Top][All Lists]
Advanced

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

Re: read-directory-name


From: Luc Teirlinck
Subject: Re: read-directory-name
Date: Fri, 6 May 2005 20:48:55 -0500 (CDT)

>From my prior message:

   >From the following ielm run it appears that the Elisp documentation is
   still correct, even though the code and docstring have changed (on
   April 23) since I checked all of this quite a while ago:

   ELISP> default-directory
   "~/"
   ELISP> (read-directory-name "Directory: " "/etc/")
   "~/"
   ELISP> 

   To get the second line, I just presses RET with /etc/ in the
   minibuffer.

Of course, here is the read-directory-name code:

  (unless dir
    (setq dir default-directory))
  (unless default-dirname
    (setq default-dirname
      (if initial (concat dir initial) default-directory)))
  (read-file-name prompt dir (or default-dirname 
                                 (if initial (expand-file-name initial dir)
                                   dir))
                  mustmatch initial 'file-directory-p))

If both initial and default-dirname are nil, the second unless-form
default-dirname to default-directory.  The or-form then passes
default-directory to read-file-name.  From the docstring, it would
appear that this is not intentional.

Sincerely,

Luc.





reply via email to

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