diff options
author | Mark H Weaver <mhw@netris.org> | 2015-06-10 17:50:27 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-06-10 17:50:27 -0400 |
commit | 14928016556300a6763334d4279c3d117902caaf (patch) | |
tree | d0dc262b14164b82f97dd6e896ca9e93a1fabeea /emacs/guix-base.el | |
parent | 1511e0235525358abb52cf62abeb9457605b5093 (diff) | |
parent | 57cd353d87d6e9e6e882327be70b4d7b5ce863ba (diff) | |
download | patches-14928016556300a6763334d4279c3d117902caaf.tar patches-14928016556300a6763334d4279c3d117902caaf.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'emacs/guix-base.el')
-rw-r--r-- | emacs/guix-base.el | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/emacs/guix-base.el b/emacs/guix-base.el index 5129c87a5d..851ee895b9 100644 --- a/emacs/guix-base.el +++ b/emacs/guix-base.el @@ -439,6 +439,7 @@ following keywords are available: (define-key map (kbd "r") 'guix-history-forward) (define-key map (kbd "g") 'revert-buffer) (define-key map (kbd "R") 'guix-redisplay-buffer) + (define-key map (kbd "M") 'guix-apply-manifest) (define-key map (kbd "C-c C-z") 'guix-switch-to-repl))))) (put 'guix-define-buffer-type 'lisp-indent-function 'defun) @@ -1022,6 +1023,32 @@ Ask a user with PROMPT for continuing an operation." :dry-run? (or guix-dry-run 'f)) nil 'source-download))) +;;;###autoload +(defun guix-apply-manifest (profile file &optional operation-buffer) + "Apply manifest from FILE to PROFILE. +This function has the same meaning as 'guix package --manifest' command. +See Info node `(guix) Invoking guix package' for details. + +Interactively, use the current profile and prompt for manifest +FILE. With a prefix argument, also prompt for PROFILE." + (interactive + (let* ((default-profile (or guix-profile guix-current-profile)) + (profile (if current-prefix-arg + (guix-profile-prompt) + default-profile)) + (file (read-file-name "File with manifest: ")) + (buffer (and guix-profile (current-buffer)))) + (list profile file buffer))) + (when (or (not guix-operation-confirm) + (y-or-n-p (format "Apply manifest from '%s' to profile '%s'? " + file profile))) + (guix-eval-in-repl + (guix-make-guile-expression + 'guix-package + (concat "--profile=" profile) + (concat "--manifest=" file)) + operation-buffer))) + ;;; Pull |