views:

85

answers:

1

In emacs, the following will define a function that, when called interactively, will ask the user for a filename:

(defun do-something (filename )
  (interactive "FFilename: ")
  ...
  )

When the user is entering a filename, they can use tab-completion, etc. Does anyone know if there are any hooks in that file-entry code? In particular, I would like to modify my find-file command so that windows symlinks (which show up as "foo.lnk") are automatically followed to their target if you hit tab.

I'm currently using w32-symlinks, which means that at least if I hit enter on the link, then it will open up the target in diredit. But I'd prefer to be able to just tab-complete through it to the file I'm looking at, rather than opening diredit and then doing a second find-file command.

+1  A: 

Before reinventing the wheel, perhaps put (ido-mode t) in your .emacs file and see if it does what you are wanting.

I dont use windows, but I use ido and it is much nicer than default.

AlexCombas
Interesting mode; I'll have to play with it. Unfortunately, after playing with it for a while, it does not appear to me to solve the problem in question -- i.e., it doesn't understand windows syminks.
Edward Loper
Actually, it may be possible to do something with Ido-Make-Dir-List-Hook or Ido-Make-File_List-Hook. I'll let you know if I get anything working.
Edward Loper