I use ido-find-file in emacs (through the "emacs starter kit"). There is one drawback I've found, namely that it uses the location in the file I'm currently editing as an extra hint. In some cases, this is handy, like when my point is somewhere on an actual filename:
open('README.txt').readlines()
^ point is here
If I press ctrl-x ctrl-f
, it'll suggest README.txt
for opening.
The problem occurs for instance when editing html:
</tbody>
</table>
^ point is here
It'll think that /table
means a directory name and the "find file" minibuffer is ready for all my data entry pleasure and suggests tmp/ | Applications/ | ...
and so on: directories in my root.
This means that when opening a file from within an html file, I have to make sure I'm outside a closing tag as otherwise the completion trips me up.
Is there a setting to switch off this behaviour?
.../lisp/ido.el
and familiarize yourself with the source code. The variables begin with(defcustom ...)
and(defvar ....)
. Changing the value of a variable is usually done by placing(setq ...)
in your.emacs
file.ido.el
and couldn't find it. Common problem in my case as I somehow find it hard (despite 15+ years of emacs usage :-) ) to guess emacs' variable names. It did however prompt me to re-read through the list produced bycustomize-apropos ido
. And almost the last option wasido-use-filename-at-point
. Bingo!