home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.emacs
- Path: sparky!uunet!boulder!khonshu!ejh
- From: ejh@khonshu.colorado.edu (Edward J. Hartnett)
- Subject: Re: small question about going into directories with find-file
- Message-ID: <1992Aug23.165129.10498@colorado.edu>
- Sender: news@colorado.edu (The Daily Planet)
- Nntp-Posting-Host: khonshu.colorado.edu
- Organization: Cooperative Institute for Research in the Environmental Sciences
- References: <1992Aug21.153958.3937@colorado.edu> <173nldINNmrv@early-bird.think.com>
- Date: Sun, 23 Aug 1992 16:51:29 GMT
- Lines: 43
-
- In article <173nldINNmrv@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
- >In article <1992Aug21.153958.3937@colorado.edu> ejh@khonshu.colorado.edu (Edward J. Hartnett) writes:
- >>This is somethng I've been curious about for some time. If I do a
- >>C-x C-f (find file) right after I start emacs, I get Find File: ~/
- >>in the minibuffer, and if I hit return, I get into dired with my
- >>home directory listed. If I then open a file in that directory,
- >>then do a C-x C-f again, I get the same Find File: ~/ in the
- >>minibuffer, but if I hit return, I don't go back into dired, I get
- >>nowhere. I have to edit the minibuffer and remove the / before it
- >>will let me open that directory in dired again.
- >
- >Despite what the prompt implies, the default that's used when you don't
- >type anything (actually, if your response is identical to the initial
- >value) is the current buffer's pathname.
-
- Yes, I understand this, I think.
-
- >
- >When you use find-file right after starting Emacs, the current buffer
- >doesn't have a pathname, so your response is used as is. But when you're
- >in a buffer with a file it defaults to the buffer pathname.
- >
-
- Right, but that's really my question: why doesn't it take the current
- buffer's pathname as the file that I want to open, and thus go into
- dired in that directory?
-
- >This behavior is implemented in the C routine that implements the
- >read-file-name function. It occurs whenever the third argument (the
- >default value) is nil, as it is when it's called from call-interactively's
- >processing of the interactive "F" argument type. To fix it from Lisp you
- >can change find-file so that it calls read-file-name explicitly to get its
- >argument, and passes an explicit third argument of the current
- directory.
-
- This last paragraph sailed about 4 inches above my head! What are the
- first two arguments?
-
-
-
- --
- Edward Hartnett ejh@khonshu.colorado.edu
-
-