mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-24 03:29:40 -05:00
emacs: Add code to pipe guix output to external program.
* emacs/guix-main.scm: Use (ice-9 popen) module. (pipe-guix-output): New procedure.
This commit is contained in:
parent
cdd383e9f3
commit
8b9ceb8d03
1 changed files with 10 additions and 0 deletions
|
@ -45,6 +45,7 @@
|
|||
(use-modules
|
||||
(ice-9 vlist)
|
||||
(ice-9 match)
|
||||
(ice-9 popen)
|
||||
(srfi srfi-1)
|
||||
(srfi srfi-2)
|
||||
(srfi srfi-11)
|
||||
|
@ -949,6 +950,15 @@ (define (help-string . commands)
|
|||
"Return string with 'guix COMMANDS ... --help' output."
|
||||
(apply guix-command-output `(,@commands "--help")))
|
||||
|
||||
(define (pipe-guix-output guix-args command-args)
|
||||
"Run 'guix GUIX-ARGS ...' command and pipe its output to a shell command
|
||||
defined by COMMAND-ARGS.
|
||||
Return #t if the shell command was executed successfully."
|
||||
(let ((pipe (apply open-pipe* OPEN_WRITE command-args)))
|
||||
(with-output-to-port pipe
|
||||
(lambda () (apply guix-command guix-args)))
|
||||
(zero? (status:exit-val (close-pipe pipe)))))
|
||||
|
||||
|
||||
;;; Lists of packages, lint checkers, etc.
|
||||
|
||||
|
|
Loading…
Reference in a new issue