Reputation: 2101
I use the emacs .
command to navigate a directory tree when I am not sure exactly where a file is. My problem is: When I close a given file, I am back at the top of the directory.
Does anyone know a way to close a file and go back to the current branch in the directory tree?
Upvotes: 0
Views: 2118
Reputation: 7586
Simply stop closing files it's not worth the effort. If you shut down emacs at the end of the day then the files will be closed anyway. Othewise you can use midnight mode to regularly clean up unused buffers.
Upvotes: 0
Reputation: 5526
I use the ido
package to open files. When I have a file open and hit C-x C-f C-d
(open file then C-d) it will open up dired in that file's directory. Will that solve your problem?
Upvotes: 0
Reputation: 10032
C-x C-v
will prompt you for a file, starting in the same directory as the file in the active buffer. After you pick a new file, it will close the old file and replace it with the new one. Does that do what you want?
Upvotes: 0
Reputation: 33177
That would require emacs to be able to change the current working directory of your shell, which isn't directly possible.
As a workaround, you can use the shell built into emacs (there are several variants).
Upvotes: 2