As per the Emacs docs, every time you open a file, Emacs changes default-directory
to the directory containing that file.
Then, if the cursor is in that buffer and you (for example) start SLIME, it uses default-directory
as the current working directory for SLIME. If you try to open a new file, it opens the file with default-directory
as your starting point.
I want to be able to M-x cd
or otherwise cd
to a directory, and then never have Emacs change my current working directory to anything but that directory until I tell it otherwise. I want this to be global across all buffers, so that any time I'm doing something involving the current working directory, I know what it's set to regardless of where my cursor is at the moment. Is there a way to do this?