home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / emacs / help / 4811 < prev    next >
Encoding:
Text File  |  1992-11-16  |  2.4 KB  |  47 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!stanford.edu!agate!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!traffic.den.mmc.com!kevin
  3. From: kevin@traffic.den.mmc.com (Kevin Rodgers)
  4. Subject: Reading a remote directory name interactively
  5. Message-ID: <9211161753.AA02935@traffic>
  6. Sender: daemon@cis.ohio-state.edu
  7. Reply-To: kevin@traffic.den.mmc.com
  8. Organization: Martin Marietta Western Internal Systems, Technical Operations
  9. Date: Mon, 16 Nov 1992 17:53:28 GMT
  10. Lines: 35
  11.  
  12.  
  13. I'm trying to write an interactive command that prompts for and reads
  14. (with completion) an existing directory name, but I'm having some
  15. problems:
  16.  
  17. There is a global variable that specifies the directory the command
  18. should use as the default directory, so that the user enters the
  19. argument relative to that place in the filesystem.  (The default
  20. directory is on a remote machine, so the command requires the ange-ftp
  21. package; we've got version 4.20 installed.)  Now since the default
  22. directory for reading this argument isn't necessarily the same as the
  23. default directory of the buffer from which the command is invoked, I
  24. can't just use the 'D' character code in a string argument descriptor to
  25. interactive.  (If interactive did not have to appear at top level, I
  26. could just lambda-bind default-directory before calling interactive.)
  27.  
  28. So I figure I have to write a form that can do the job, and read-file-
  29. name looks like a good place to start since the default directory and
  30. whether the name must match an existing file are controlled by optional
  31. arguments to it (see the 'Reading File Names' info node of the Elisp
  32. manual).  However, while testing this solution, I discovered this
  33. problem: when I enter an existing (remote) directory name, it refuses to
  34. return.  I am sure the name is valid, because I can complete it with TAB
  35. or SPC (which appends a trailing "/" to the name) before typing RET.
  36.  
  37. I've also learned that when existing file names are entered, the
  38. minibuffer-local-must-match keymap is in effect, and RET is bound in
  39. that keymap to minibuffer-complete-and-exit.  Why won't that function
  40. accept a directory name, and how can I get it to do so?  There appears
  41. to be a lot of interaction between read-file-name and ange-ftp, which
  42. redefines read-file-name-internal and file-name-completion.
  43.  
  44. Shouldn't there be a corresponding function read-directory-name?  (If
  45. so, I'll suggest it to the gnu-emacs-bug list.)  Or should I just call
  46. read-file-name without requiring a match?
  47.