Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok, this is probably simple to do, but I just can't find how.

When opening a file in emacs, I use: C-x C-f. Which then drops me down into the command buffer with the current path already filled out.

In previous setups (other companies), I could just hit / and it would eliminate the current path, replacing it with the root directory /. Or, I could hit ~, and it would similarly clear out the path, going to my home directory ~.

In my current setup, I do not have that feature. I would like to turn that on.

share|improve this question
up vote 3 down vote accepted

You can still start by typing / or ~, and any input before that will be ignored. E.g. if the minibuffer contains /home/foo//tmp/bar.txt, then /tmp/bar.txt will be opened.

There should be visual feedback for this, showing the part that will be ignored in a dimmer colour. Check that file-name-shadow-mode is t (it is by default), and that the shadow face is considerably different from the default face. I found that I had activated a colour theme that didn't really distinguish the two, so I typed M-x customize-face RET shadow and made it darker.

I seem to remember that there is a mode that actually deletes the part of input that will be ignored, but I can't find it now...

share|improve this answer
I didn't know about shadow mode -- that's very helpful to know. But I would prefer the mode that deletes the ignored input (I can't find it either). – Tim Jun 10 '13 at 22:27

It won't provide exactly the same functionality as you describe, but ido can come very close to the desired behavior. As the bonus you get better navigation through the directories and files.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .