From 086c389b1d7c7deec674120aec6a12163402656e Mon Sep 17 00:00:00 2001 From: Karl Erik Holter Date: Sun, 2 Oct 2016 07:19:01 +0200 Subject: [PATCH] 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. --- utils/installer.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/installer.sh b/utils/installer.sh index d5a351e..392ebd9 100755 --- a/utils/installer.sh +++ b/utils/installer.sh @@ -179,6 +179,13 @@ then printf "$YELLOW WARNING:$RESET Prelude depends on emacs $RED 24$RESET !\n" 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" ] then # Existing file/directory found -> backup