1

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?

  • If you are using the previous version of the Emacs Starter Kit by Phil Hagelberg (aka technomancy), the Github repository states that he has shifted away from providing a one size fits all approach and is now focusing on smaller targeted implementations and more document based help. If you are using a different starter kit, please provide a link to the source code so that other forum participants might be able to see the settings that you are using. – lawlist Mar 27 '14 at 15:39
  • I'm using the technomancy version, still. (The only modifications I made are a couple of extra shortcuts.) – Reinout van Rees Mar 27 '14 at 20:29
  • Thank you for verifying the starter kit that you are using. Unfortunately, that kit is no longer available: github.com/technomancy/emacs-starter-kit Therefore, it may be difficult for someone else to duplicate your exact setup as a means of finding a solution and testing it out. In the meantime, please go ahead and open up the Emacs source file .../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. – lawlist Mar 27 '14 at 20:47
  • I've already looked in 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 by customize-apropos ido. And almost the last option was ido-use-filename-at-point. Bingo! – Reinout van Rees Mar 28 '14 at 8:45
1

In the end there simply is a setting for this behaviour that I missed the previous times I looked for it. My emacs config now contains this line:

 '(ido-use-filename-at-point nil)

Note: the "emacs starter kit" settings that I use were the one that set it to guess, in starter-kit-2.0.3/starter-kit-misc.el. So this is probably no problem for the default ido.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.