How to set default directory for Emacs 27.1 app?
I just upgraded Emacs to 27.1 using brew cask
. One noticeable change is that when I launch the app and c-x c-f
the directory is /
instead of ~/
.
This really bothers me, is there a way to change it back?
I had the same issue after installing Emacs 27.1, my default directory became "/"
I could fix it by adding the following to my .emacs file.
(setq default-directory "~/")
(setq command-line-default-directory "~/")
I have worked around this issue by editing /Applications/Emacs.app/Contents/MacOS/Emacs, inserting
Dir.chdir(ENV['HOME'])
before the call to exec at line 69
exec [emacs[:exe], emacs[:exe]], *ARGV
This is obviously just a temporary workaround, but it restores the previous behaviour of Emacs 26 without modifying any of my configuration or affecting Emacs command line calls, since it only modifies the Finder launch.
I've also posted this at https://github.com/caldwell/build-emacs/issues/98#issuecomment-720609277 EDIT: “Looks like the fix will be in 27.2.” https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44446#11