diff --git a/init.el b/init.el index d097068..e00aff2 100644 --- a/init.el +++ b/init.el @@ -212,12 +212,16 @@ init file, which initializes the package manager during compile time." (defun user/download-latest-init-file () "Download the latest user init file from jessieh.net/emacs. -The user init file will be automatically recompiled after downloading." +The user init file will be automatically recompiled after downloading. + +If `user/init-file' points to a symlink, nothing will be downloaded." (interactive) - (when (yes-or-no-p "Download latest init file from jessieh.net/emacs? ") - (message "Updating init file...") - (url-copy-file "https://jessieh.net/emacs" user/init-file :ok-if-already-exists) - (user/byte-compile-init-files))) + (if (file-symlink-p user/init-file) + (message "%s is a symlink, operation aborted. Please update the init file manually." user/init-file) + (when (yes-or-no-p "Download latest init file from jessieh.net/emacs? ") + (message "Updating init file...") + (url-copy-file "https://jessieh.net/emacs" user/init-file :ok-if-already-exists) + (user/byte-compile-init-files)))) (defun user/select-minibuffer-window () "Select the minibuffer window if it is active."