1

I've just started using emacs recently and it's fist time i try to configure it. I have following setup under Windows 7:

"...\emacs\config\.emacs"

"...\emacs\emacs-bin-w64-25.0.94-O2\..."

"...\emecs\emacs.exe" - this is actually a shortcut to emacs located in above directory.

Shortcut target:

"...\emacs\emacs-bin-w64-25.0.94-O2\emacs\bin\runemacs.exe -q -l config.emacs"

Start in:

"...\emacs\"

Above works just fine but I would like to be able to change settings using Custom mode. So in .emacs I've added following line:

(user-init-file (concat (pwd) "config/.emacs")

But it turns out that with this setting the "1 = Save for future session" option is gone when I try to save changes done in Custom mode.

So I added next line after that:

(setq custom-file user-init-file)

Now both variables store correct path to .emacs file. At least they store path I expect which is:

"...\emacs\config\.emacs"

And "1 = Save for future session" option is available back again but the problem occur when I try to use it. The minibufer give me this:

A buffer is visiting .../emacs/emacs-bin-w64-25.0.94-O2/emacs/share/info/Directory .../emacs/config/Directory .../emacs/config/.emacs; proceed? n user-error: Aborted

Basically it adds two additional paths to the one I specified. Why is that and how to fix it?

  • Documentation says pwd return "current default directory". Why I souldn't use it? – Paweł Audionysos Aug 17 '16 at 5:14
  • My god... You were right. I missed that "Directory" word was included in there. Post answer so I can accept it :) – Paweł Audionysos Aug 17 '16 at 5:24
1

(setq foo (pwd)), then C-h v foo.

The value is not just a directory string. It's a directory string preceded by "Directory ".

Don't use pwd; use variable default-directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.