When I start working on a project in emacs, I use M-x cd to get into the project root directory. But every time I use C-x C-f to open a file in one of the subdirectories (like app/model/Store.rb) emacs changes current directory to that of the file. Is there a way to make emacs stay at the root?
Share
How about this? It replaces the regular find-file command with your own which always starts in some “root” directory (customize the
find-file-root-dirvariable):