[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to not change the working directory when opening a file
From: |
Francis Moreau |
Subject: |
Re: how to not change the working directory when opening a file |
Date: |
Tue, 15 Jan 2008 18:16:04 +0100 |
On Jan 15, 2008 5:25 PM, Sebastian Tennant <sebyte@smolny.plus.com> wrote:
> Quoth "Francis Moreau" <francis.moro@gmail.com>:
> > (add-hook 'post-mode-hook '(lambda () (setq default-directory
> > emacs-startup-directory)))
>
> If it works go with it. It's also a more focussed solution than:
>
> (cd (getenv "PWD"))
>
> in that it only applies to post-mode, although my 'getenv' solution is
> perhaps more flexible in that Emacs' default directory at startup will
> always be the directory you launched Emacs from, rather than the value
> of emacs-startup-directory.
>
> Just for your information, you shouldn't really quote lambda functions,
> i.e., you should remove the single quote before (lambda ...).
>
> Quoting lambda functions happens to work in Emacs Lisp but won't work in
> other Lisp dialects, so it's not a good habit to get into.
>
For for this information. I actually don't know elisp at all...
--
Francis