Rename .emacs if it exists in the installer(#1037)

If user has a $HOME/.emacs file, the prelude installer script
will install just fine, but when starting emacs, nothing will
take effect because emacs doesn't load .emacs.d/init.el if .emacs
exists. Because this is confusing for new users, the installer should
default to renaming this file to make emacs actually load prelude.
This commit is contained in:
Karl Erik Holter 2016-10-02 07:19:01 +02:00 committed by Bozhidar Batsov
parent ccedc77285
commit 086c389b1d

View file

@ -179,6 +179,13 @@ then
printf "$YELLOW WARNING:$RESET Prelude depends on emacs $RED 24$RESET !\n" printf "$YELLOW WARNING:$RESET Prelude depends on emacs $RED 24$RESET !\n"
fi fi
if [ -f "$HOME/.emacs" ]
then
## If $HOME/.emacs exists, emacs ignores prelude's init.el, so remove it
printf " Backing up the existing $HOME/.emacs to $HOME/.emacs.pre-prelude\n"
mv $HOME/.emacs $HOME/.emacs.pre-prelude
fi
if [ -d "$PRELUDE_INSTALL_DIR" ] || [ -f "$PRELUDE_INSTALL_DIR" ] if [ -d "$PRELUDE_INSTALL_DIR" ] || [ -f "$PRELUDE_INSTALL_DIR" ]
then then
# Existing file/directory found -> backup # Existing file/directory found -> backup