1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-08-03 04:41:42 +02:00

edit: Lift helper procedure.

* guix/scripts/edit.scm (package->location-specification): New
  procedure, with code formerly...
  (guix-edit): ... here.  Use it.
This commit is contained in:
Ludovic Courtès
2015-11-05 12:01:26 +01:00
parent 5453de3dd8
commit 67c920fa5d
+10 -7
View File
@@ -59,6 +59,15 @@ Start $EDITOR to edit the definitions of PACKAGE...\n"))
file path))
absolute-file-name))
(define (package->location-specification package)
"Return the location specification for PACKAGE for a typical editor command
line."
(let ((loc (package-location package)))
(list (string-append "+"
(number->string
(location-line loc)))
(search-path* %load-path (location-file loc)))))
(define (guix-edit . args)
(with-error-handling
@@ -71,10 +80,4 @@ Start $EDITOR to edit the definitions of PACKAGE...\n"))
(package-full-name package))))
packages)
(apply execlp (%editor) (%editor)
(append-map (lambda (package)
(let ((loc (package-location package)))
(list (string-append "+"
(number->string
(location-line loc)))
(search-path* %load-path (location-file loc)))))
packages)))))
(append-map package->location-specification packages)))))