diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-09-24 22:18:07 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-09-24 22:18:07 +0200 |
commit | 1007b6bf0bef3f662f65ffdd0d4383179dd07355 (patch) | |
tree | 4a9b2a4baa2d82434e12fe4aacc8f28e3266793e /emacs/guix-command.el | |
parent | 12cd4dd3a9052491e3912ffeecbe8854ea9b971a (diff) | |
parent | a7a4fd9a7cd02e4897e7b2156bd9ecc7e72e9818 (diff) | |
download | patches-1007b6bf0bef3f662f65ffdd0d4383179dd07355.tar patches-1007b6bf0bef3f662f65ffdd0d4383179dd07355.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'emacs/guix-command.el')
-rw-r--r-- | emacs/guix-command.el | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/emacs/guix-command.el b/emacs/guix-command.el index 504d5f7ca0..b679ad9b1e 100644 --- a/emacs/guix-command.el +++ b/emacs/guix-command.el @@ -503,7 +503,10 @@ to be modified." :name "log" :char ?l :doc "View build log")) (("graph") ,(guix-command-make-argument - :name "view" :char ?v :doc "View graph"))) + :name "view" :char ?v :doc "View graph")) + (("size") + ,(guix-command-make-argument + :name "view" :char ?v :doc "View map"))) "Alist of guix commands and additional 'execute' action arguments.") (defun guix-command-execute-arguments (commands) @@ -525,7 +528,9 @@ to be modified." (("build") ("log" . guix-run-view-build-log)) (("graph") - ("view" . guix-run-view-graph))) + ("view" . guix-run-view-graph)) + (("size") + ("view" . guix-run-view-size-map))) "Alist of guix commands and alists of special executers for them. See also `guix-command-default-executors'.") @@ -583,6 +588,23 @@ open the log file(s)." (guix-find-file graph-file) (error "Couldn't create a graph")))) +(defun guix-run-view-size-map (args) + "Run 'guix ARGS ...' size command, and open the map file." + (let* ((wished-map-file + (cl-some (lambda (arg) + (and (string-match "--map-file=\\(.+\\)" arg) + (match-string 1 arg))) + args)) + (map-file (or wished-map-file (guix-png-file-name))) + (args (if wished-map-file + args + (apply #'list + (car args) + (concat "--map-file=" map-file) + (cdr args))))) + (guix-command-output args) + (guix-find-file map-file))) + ;;; Generating popups, actions, etc. |