mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
emacs: Add "View map" action to 'size' popup.
* emacs/guix-command.el (guix-run-view-size-map): New function. (guix-command-additional-execute-arguments, guix-command-special-executors): Add entries for "View map" action.
This commit is contained in:
parent
99d7460d78
commit
6f05a24df3
1 changed files with 24 additions and 2 deletions
|
@ -503,7 +503,10 @@ to be modified."
|
||||||
:name "log" :char ?l :doc "View build log"))
|
:name "log" :char ?l :doc "View build log"))
|
||||||
(("graph")
|
(("graph")
|
||||||
,(guix-command-make-argument
|
,(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.")
|
"Alist of guix commands and additional 'execute' action arguments.")
|
||||||
|
|
||||||
(defun guix-command-execute-arguments (commands)
|
(defun guix-command-execute-arguments (commands)
|
||||||
|
@ -525,7 +528,9 @@ to be modified."
|
||||||
(("build")
|
(("build")
|
||||||
("log" . guix-run-view-build-log))
|
("log" . guix-run-view-build-log))
|
||||||
(("graph")
|
(("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.
|
"Alist of guix commands and alists of special executers for them.
|
||||||
See also `guix-command-default-executors'.")
|
See also `guix-command-default-executors'.")
|
||||||
|
|
||||||
|
@ -583,6 +588,23 @@ open the log file(s)."
|
||||||
(guix-find-file graph-file)
|
(guix-find-file graph-file)
|
||||||
(error "Couldn't create a graph"))))
|
(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.
|
;;; Generating popups, actions, etc.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue