diff --git a/el-get-core.el b/el-get-core.el index f5ac308ea..024c459ea 100644 --- a/el-get-core.el +++ b/el-get-core.el @@ -240,22 +240,23 @@ entry." (when (y-or-n-p (format "Really %s `%s'? " (button-get button 'el-get-pkg-verb) package)) - (funcall (button-get button 'el-get-pkg-fun) package)))) + (apply (button-get button 'el-get-pkg-fun) package + (button-get button 'el-get-pkg-extra-args))))) (define-button-type 'el-get-pkg-op 'action #'el-get-pkg-op-button-action 'follow-link t) -(defun el-get-define-pkg-op-button-type (operation) - (let ((verb (replace-regexp-in-string "\\`el-get-" "" (symbol-name operation)))) - (define-button-type operation :supertype 'el-get-pkg-op - 'el-get-pkg-fun operation - 'el-get-pkg-verb verb - 'help-echo (format "mouse-2, RET: %s package" verb)))) +(defun el-get-define-pkg-op-button-type (operation verb) + (define-button-type operation :supertype 'el-get-pkg-op + 'el-get-pkg-fun operation + 'el-get-pkg-verb verb + 'help-echo (format "mouse-2, RET: %s package" verb))) -(el-get-define-pkg-op-button-type 'el-get-install) -(el-get-define-pkg-op-button-type 'el-get-update) -(el-get-define-pkg-op-button-type 'el-get-remove) +(el-get-define-pkg-op-button-type 'el-get-install "install") +(el-get-define-pkg-op-button-type 'el-get-reinstall "reinstall") +(el-get-define-pkg-op-button-type 'el-get-update "update") +(el-get-define-pkg-op-button-type 'el-get-remove "remove") (define-button-type 'el-get-file-jump 'action (lambda (button) (find-file (button-get button 'el-get-file))) diff --git a/el-get-status.el b/el-get-status.el index 8c9ce2104..877911487 100644 --- a/el-get-status.el +++ b/el-get-status.el @@ -336,21 +336,27 @@ a list of operations that would allow a full update." (error "Package %s is nowhere to be found in el-get status file." package)))) -(defun el-get-merge-properties-into-status (package - operation - &rest keys) +(el-get-define-pkg-op-button-type 'el-get-merge-properties-into-status + "force cached recipe update of") + +(defun el-get-merge-properties-into-status (package operation &rest keys) "Merge updatable properties for package into status file. PACKAGE is either a package source or name, in which case the source will be read using `el-get-package-def'. The named package must already be installed. -Warn about any non-whitelisted properties differing from the -cached values." +Warn about any non-whitelisted for OPERATION properties differing +from the cached values. + +Interactively, OPERATION is `update' with prefix arg, `reinstall' +with double prefix arg, or `init' otherwise." (declare (advertised-calling-convention (package operation) "Oct 2016")) (interactive (list (el-get-read-package-with-status "Update cached recipe" "installed") - 'init)) + (cond ((equal '(16) current-prefix-arg) 'reinstall) + (current-prefix-arg 'update) + (t 'init)))) (let* ((source (el-get-package-or-source package)) (package (plist-get source :name)) (cached (el-get-read-cached-recipe package source))) @@ -363,8 +369,18 @@ cached values." (lwarn '(el-get recipe-cache) :warning (concat "Must %s `%s' to modify its cached recipe\n" " adding: %s" - " removing: %s") - (mapconcat #'symbol-name required-ops " or ") package + " removing: %s" + (el-get-fmt-button + " Or %s if you know these changes are safe.\n" + "force update the cached recipe" + :type 'el-get-merge-properties-into-status + 'el-get-package package 'el-get-pkg-extra-args '(reinstall))) + (mapconcat (lambda (op) + (el-get-fmt-button + "%s" op :type (intern (concat "el-get-" op)) + 'el-get-package package)) + (mapcar #'symbol-name required-ops) " or ") + package (if no-add (pp-to-string no-add) "()\n") (if no-rem (pp-to-string no-rem) "()\n"))))))