home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.emacs.help
- 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
- From: kevin@traffic.den.mmc.com (Kevin Rodgers)
- Subject: Reading a remote directory name interactively
- Message-ID: <9211161753.AA02935@traffic>
- Sender: daemon@cis.ohio-state.edu
- Reply-To: kevin@traffic.den.mmc.com
- Organization: Martin Marietta Western Internal Systems, Technical Operations
- Date: Mon, 16 Nov 1992 17:53:28 GMT
- Lines: 35
-
-
- I'm trying to write an interactive command that prompts for and reads
- (with completion) an existing directory name, but I'm having some
- problems:
-
- There is a global variable that specifies the directory the command
- should use as the default directory, so that the user enters the
- argument relative to that place in the filesystem. (The default
- directory is on a remote machine, so the command requires the ange-ftp
- package; we've got version 4.20 installed.) Now since the default
- directory for reading this argument isn't necessarily the same as the
- default directory of the buffer from which the command is invoked, I
- can't just use the 'D' character code in a string argument descriptor to
- interactive. (If interactive did not have to appear at top level, I
- could just lambda-bind default-directory before calling interactive.)
-
- So I figure I have to write a form that can do the job, and read-file-
- name looks like a good place to start since the default directory and
- whether the name must match an existing file are controlled by optional
- arguments to it (see the 'Reading File Names' info node of the Elisp
- manual). However, while testing this solution, I discovered this
- problem: when I enter an existing (remote) directory name, it refuses to
- return. I am sure the name is valid, because I can complete it with TAB
- or SPC (which appends a trailing "/" to the name) before typing RET.
-
- I've also learned that when existing file names are entered, the
- minibuffer-local-must-match keymap is in effect, and RET is bound in
- that keymap to minibuffer-complete-and-exit. Why won't that function
- accept a directory name, and how can I get it to do so? There appears
- to be a lot of interaction between read-file-name and ange-ftp, which
- redefines read-file-name-internal and file-name-completion.
-
- Shouldn't there be a corresponding function read-directory-name? (If
- so, I'll suggest it to the gnu-emacs-bug list.) Or should I just call
- read-file-name without requiring a match?
-