kaushalmodi / .emacs.d

My emacs configuration
MIT License
262 stars 49 forks source link

Error modi/temporary-file-directory #30

Closed yuravg closed 6 years ago

yuravg commented 6 years ago

Hi, I don't have variable 'USER':

(defvar modi/temporary-file-directory (let* ((dir (file-name-as-directory (expand-file-name (getenv "USER") temporary-file-directory)))) (make-directory dir :parents) dir) "User-specific temporary directory name.")

probably on this emacs start ends with error(Windows OS):

Debugger entered--Lisp error: (wrong-type-argument stringp nil) expand-file-name(nil "c:/Users/MYNAME~1/AppData/Local/Temp/")Debugger entered--Lisp error: (wrong-type-argument stringp nil) expand-file-name(nil "c:/Users/MYNAME~1/AppData/Local/Temp/")

kaushalmodi commented 6 years ago

Hmm, I don't see this issue. May be you just need to set the USER environment variable in Windows. I'm not a Windows expert, but here are instructions I found online for setting PATH variable: https://www.java.com/en/download/help/path.xml. Follow the same for setting USER.

kaushalmodi commented 6 years ago

Can you tell me what you get on doing C-h v user-login-name (without setting the USER environment variable)?

yuravg commented 6 years ago

Can you tell me what you get on doing C-h v user-login-name (without setting the USER environment variable)?

Оf course, but I can't do it until Monday. (now there is only Debian)

...Follow the same for setting USER.

Ok, I will tray it(when I get to Windows OS), for a while I did so

(defvar modi/temporary-file-directory (let* ((dir (file-name-as-directory (expand-file-name "tmp" (getenv "HOME"))))) (make-directory dir :parents) dir) "User-specific temporary directory name.")

kaushalmodi commented 6 years ago

@yuravg If you update to the latest master branch of this repo, this issue should be resolved now. I am now using user-login-name which is auto-derived from the USERNAME env var for windows (but from USER env var on GNU/Linux and other systems).

yuravg commented 6 years ago

Thank you, when I try in the Windows OS, I'll immediately write about the result

yuravg commented 6 years ago

Can you tell me what you get on doing C-h v user-login-name (without setting the USER environment variable)?

My login name.

If you update to the latest master branch of this repo, ...

It works from Window/Run and minGW (without additional env). Thank you for your help, and excellent .emacs.d

kaushalmodi commented 6 years ago

That's great! Thanks for the kind words :)