From 5fbc709f3f13ca388af1f8a5319b6e164d659e44 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Mon, 19 Dec 2022 20:51:16 -0500 Subject: [PATCH] Update user/download-latest-init-file function --- init.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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."