Created
December 1, 2013 17:29
-
-
Save skeptomai/7737484 to your computer and use it in GitHub Desktop.
Switch emacs working directory when file is loaded with emacsclient
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (add-hook 'server-switch-hook | |
| (lambda nil | |
| (let ((server-buf (current-buffer))) | |
| (setq default-directory "/tmp")))) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This sets the buffer-local working directory. If you evaluate this, then open a file with emacsclient, then M-x eval-expression default-directory, you'll see the directory printed in the status line is what you expect and is not the same as the default-directory if you evaluate this from any other buffer.