diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-11-05 12:01:26 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-11-05 12:01:26 +0100 |
commit | 67c920fa5d9a77543e0e950fdf26e2f502b656d8 (patch) | |
tree | 9dce00f816f10d8651c0074e23a1aeaa0faf5f3e | |
parent | 5453de3dd88f28d5b3e7cff96df2c583e57bb23b (diff) | |
download | guix-67c920fa5d9a77543e0e950fdf26e2f502b656d8.tar guix-67c920fa5d9a77543e0e950fdf26e2f502b656d8.tar.gz |
edit: Lift helper procedure.
* guix/scripts/edit.scm (package->location-specification): New
procedure, with code formerly...
(guix-edit): ... here. Use it.
-rw-r--r-- | guix/scripts/edit.scm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm index 30146af10b..fa10a16f31 100644 --- a/guix/scripts/edit.scm +++ b/guix/scripts/edit.scm @@ -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))))) |