>From 9252f698348db42431264441a5e97fd5a414c001 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Sat, 21 Nov 2015 14:37:54 +0100 Subject: [PATCH 1/2] 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 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm index 73a5bb7..f894953 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 +;;; Copyright © 2015 Mathieu Lirzin ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +23,7 @@ #:use-module (guix utils) #:use-module (guix packages) #:use-module (gnu packages) + #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-37) #:export (%editor @@ -83,8 +85,13 @@ line." (catch 'system-error (lambda () - (apply execlp (%editor) (%editor) - (append-map package->location-specification packages))) + (let ((editor-args (string-split (%editor) #\space)) + (file-names (append-map package->location-specification + packages))) + (match editor-args + ((editor . args) + (apply execlp editor (append editor-args file-names))) + (_ #f)))) (lambda args (let ((errno (system-error-errno args))) (leave (_ "failed to launch '~a': ~a~%") -- 2.6.2