From 559df00c495f72cdb6fa59457ebff30e9f979d07 Mon Sep 17 00:00:00 2001 From: "Tom Breton (Tehom)" Date: Fri, 24 Dec 2010 15:42:27 -0500 Subject: [PATCH] Check elinstall-proceed-p before making symlinks --- elinstall.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/elinstall.el b/elinstall.el index ae9fb31..d45f012 100644 --- a/elinstall.el +++ b/elinstall.el @@ -790,18 +790,20 @@ Other non-nil cases of FORCE are reserved for future development." (message "The target directory doesn't exist.")) ;;Target shouldn't already exist, but if force is given, let ;;user override. + ;;$$IMPROVE ME If it is a symlink pointing to the same place, - ;;do nothing even on force. - ((and - (file-exists-p target) - (or - (not force) - (not - (yes-or-no-p - (format "Really overwrite %s? " target)))) - (message "File %s already exists" target))) - - (t + ;;do nothing. + + ;;$$IMPROVE ME The condition here is not updating but + ;;bulldozing a possibly different symlink. Add another + ;;treatment symbol meaning to bulldoze what's in the way. + ((elinstall-proceed-p 'preloads-compile + (list + '( "Symlink %s? " + "Really overwrite %s? " + "File %s already exists") + target) + (file-exists-p target)) (make-symbolic-link filename target -- 2.11.4.GIT