[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: edit: Allow command line arguments in $VISUAL and $EDITOR.
From: |
Mathieu Lirzin |
Subject: |
01/03: edit: Allow command line arguments in $VISUAL and $EDITOR. |
Date: |
Sun, 06 Dec 2015 16:24:39 +0000 |
mthl pushed a commit to branch master
in repository guix.
commit b16dbd1311c9bd1346dcf0d490f25455e12b04cf
Author: Mathieu Lirzin <address@hidden>
Date: Sat Nov 21 14:37:54 2015 +0100
edit: Allow command line arguments in $VISUAL and $EDITOR.
* guix/scripts/edit.scm (guix-edit): Fix the assumption that %editor is
a one word command.
---
guix/scripts/edit.scm | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm
index 73a5bb7..660bd57 100644
--- a/guix/scripts/edit.scm
+++ b/guix/scripts/edit.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Ludovic Courtès <address@hidden>
+;;; Copyright © 2015 Mathieu Lirzin <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -83,8 +84,11 @@ line."
(catch 'system-error
(lambda ()
- (apply execlp (%editor) (%editor)
- (append-map package->location-specification packages)))
+ (let ((file-names (append-map package->location-specification
+ packages)))
+ ;; Use `system' instead of `exec' in order to sanely handle
+ ;; possible command line arguments in %EDITOR.
+ (exit (system (string-join (cons (%editor) file-names))))))
(lambda args
(let ((errno (system-error-errno args)))
(leave (_ "failed to launch '~a': ~a~%")