mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 22:38:07 -05: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:
parent
5453de3dd8
commit
67c920fa5d
1 changed files with 10 additions and 7 deletions
|
@ -59,6 +59,15 @@ (define (search-path* path file)
|
|||
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 @@ (define (guix-edit . args)
|
|||
(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)))))
|
||||
|
|
Loading…
Reference in a new issue