emacs: Add 'guix-apply-manifest'.
* emacs/guix-base.el (guix-apply-manifest): New command. Bind it to "M" key. * doc/emacs.texi (Emacs General info): Document it.
This commit is contained in:
		
							parent
							
								
									578b98da43
								
							
						
					
					
						commit
						5a727cdfa9
					
				
					 2 changed files with 32 additions and 0 deletions
				
			
		|  | @ -183,6 +183,11 @@ packages/generations and redisplay it. | ||||||
| @item R | @item R | ||||||
| Redisplay current buffer (without updating information). | Redisplay current buffer (without updating information). | ||||||
| 
 | 
 | ||||||
|  | @item M | ||||||
|  | Apply manifest to the current profile or to a specified profile, if | ||||||
|  | prefix argument is used.  This has the same meaning as @code{--manifest} | ||||||
|  | option (@pxref{Invoking guix package}). | ||||||
|  | 
 | ||||||
| @item C-c C-z | @item C-c C-z | ||||||
| Go to the Guix REPL (@pxref{The REPL,,, geiser, Geiser User Manual}). | Go to the Guix REPL (@pxref{The REPL,,, geiser, Geiser User Manual}). | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -439,6 +439,7 @@ following keywords are available: | ||||||
|          (define-key map (kbd "r") 'guix-history-forward) |          (define-key map (kbd "r") 'guix-history-forward) | ||||||
|          (define-key map (kbd "g") 'revert-buffer) |          (define-key map (kbd "g") 'revert-buffer) | ||||||
|          (define-key map (kbd "R") 'guix-redisplay-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))))) |          (define-key map (kbd "C-c C-z") 'guix-switch-to-repl))))) | ||||||
| 
 | 
 | ||||||
| (put 'guix-define-buffer-type 'lisp-indent-function 'defun) | (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)) |       :dry-run? (or guix-dry-run 'f)) | ||||||
|      nil 'source-download))) |      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 | ;;; Pull | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Reference in a new issue