home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / emacs / 2935 next >
Encoding:
Text File  |  1992-08-23  |  2.4 KB  |  56 lines

  1. Newsgroups: comp.emacs
  2. Path: sparky!uunet!boulder!khonshu!ejh
  3. From: ejh@khonshu.colorado.edu (Edward J. Hartnett)
  4. Subject: Re: small question about going into directories with find-file
  5. Message-ID: <1992Aug23.165129.10498@colorado.edu>
  6. Sender: news@colorado.edu (The Daily Planet)
  7. Nntp-Posting-Host: khonshu.colorado.edu
  8. Organization: Cooperative Institute for Research in the Environmental Sciences
  9. References: <1992Aug21.153958.3937@colorado.edu> <173nldINNmrv@early-bird.think.com>
  10. Date: Sun, 23 Aug 1992 16:51:29 GMT
  11. Lines: 43
  12.  
  13. In article <173nldINNmrv@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
  14. >In article <1992Aug21.153958.3937@colorado.edu> ejh@khonshu.colorado.edu (Edward J. Hartnett) writes:
  15. >>This is somethng I've been curious about for some time. If I do a
  16. >>C-x C-f (find file) right after I start emacs, I get Find File: ~/
  17. >>in the minibuffer, and if I hit return, I get into dired with my
  18. >>home directory listed. If I then open a file in that directory,
  19. >>then do a C-x C-f again, I get the same Find File: ~/ in the
  20. >>minibuffer, but if I hit return, I don't go back into dired, I get
  21. >>nowhere. I have to edit the minibuffer and remove the / before it
  22. >>will let me open that directory in dired again. 
  23. >
  24. >Despite what the prompt implies, the default that's used when you don't
  25. >type anything (actually, if your response is identical to the initial
  26. >value) is the current buffer's pathname.
  27.  
  28. Yes, I understand this, I think. 
  29.  
  30. >
  31. >When you use find-file right after starting Emacs, the current buffer
  32. >doesn't have a pathname, so your response is used as is.  But when you're
  33. >in a buffer with a file it defaults to the buffer pathname.
  34. >
  35.  
  36. Right, but that's really my question: why doesn't it take the current
  37. buffer's pathname as the file that I want to open, and thus go into
  38. dired in that directory?
  39.  
  40. >This behavior is implemented in the C routine that implements the
  41. >read-file-name function.  It occurs whenever the third argument (the
  42. >default value) is nil, as it is when it's called from call-interactively's
  43. >processing of the interactive "F" argument type.  To fix it from Lisp you
  44. >can change find-file so that it calls read-file-name explicitly to get its
  45. >argument, and passes an explicit third argument of the current
  46. directory.
  47.  
  48. This last paragraph sailed about 4 inches above my head! What are the
  49. first two arguments?
  50.  
  51.  
  52.  
  53. -- 
  54. Edward Hartnett            ejh@khonshu.colorado.edu
  55.  
  56.