[emacs-berlin] Changed user name - emacs can't find .emacs.d

Christos Vagias chris.actondev at gmail.com
Tue Jan 24 18:11:09 UTC 2023


Take a look into -d

> -d, --home HOME_DIR
> The user's new login directory.
> If the -m option is given, the contents of the current home directory will be moved to the new home directory, which is created if it does not already exist.
> 

Also, seeing in https://unix.stackexchange.com/a/259797 

> You need to edit the /etc/passwd file to change home directory of users that are currently logged in.
> 
> Edit the /etc/passwd with sudo vipw and change home directory of the user.
> 
AFAIK emacs read from the HOME env variable to guess its .emacs.d location, so I’m assuming there’s something fishy there. If you start emacs graphically from a desktop environment, it won’t read any `export HOME=` you might have in any .bashrc or similar file. Btw if you’re using, launching emacs from a DE you can use `~/.xprofile` to alters env variables, similarly to ~/.bashrc

> On 24. Jan 2023, at 16:30, Asalle <asalle.kim at gmail.com> wrote:
> 
> Hi all!
> 
> I changed my username via `usermod -l newname oldname` and I also changed my home folder name accordingly. However, now when I start emacs, it says `/home/oldname/.emacs.d does not exist. Create it?`. I removed the whole `/home/newname/.emacs.d/.cache` folder. And I tried to find any env vars that contain `/home/oldname` via `apropos-value` - couldn't find anything that stands out.
> 
> How do I make it work with my new username without removing the whole `/home/newname/.emacs.d`?
> 
> -- 
> Best regards,
> Asa
> _______________________________________________
> emacs-berlin mailing list
> emacs-berlin at emacs-berlin.org
> https://mailb.org/mailman/listinfo/emacs-berlin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailb.org/pipermail/emacs-berlin/attachments/20230124/6bf31350/attachment.htm>


More information about the emacs-berlin mailing list