[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/04: edit: Honor $VISUAL.
From: |
Ludovic Courtès |
Subject: |
01/04: edit: Honor $VISUAL. |
Date: |
Wed, 11 Nov 2015 22:46:05 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 6237b9fa39c6ab3283c50b96520b990c8612abc1
Author: Ludovic Courtès <address@hidden>
Date: Wed Nov 11 22:59:35 2015 +0100
edit: Honor $VISUAL.
Suggested by Andreas Enge <address@hidden>.
* guix/scripts/edit.scm (%editor): Honor 'VISUAL' before 'EDITOR'.
(show-help): Adjust accordingly.
* doc/guix.texi (Invoking guix edit): Likewise.
---
doc/guix.texi | 5 +++--
guix/scripts/edit.scm | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 09a860a..3b6955c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3929,8 +3929,9 @@ guix edit gcc-4.8 vim
@end example
@noindent
-launches the program specified in the @code{EDITOR} environment variable
-to edit the recipe of address@hidden and that of Vim.
+launches the program specified in the @code{VISUAL} or in the
address@hidden environment variable to edit the recipe of address@hidden
+and that of Vim.
If you are using Emacs, note that the Emacs user interface provides
similar functionality in the ``package info'' and ``package list''
diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm
index 0509148..73a5bb7 100644
--- a/guix/scripts/edit.scm
+++ b/guix/scripts/edit.scm
@@ -38,7 +38,7 @@
(define (show-help)
(display (_ "Usage: guix edit PACKAGE...
-Start $EDITOR to edit the definitions of PACKAGE...\n"))
+Start $VISUAL or $EDITOR to edit the definitions of PACKAGE...\n"))
(newline)
(display (_ "
-h, --help display this help and exit"))
@@ -48,7 +48,8 @@ Start $EDITOR to edit the definitions of PACKAGE...\n"))
(show-bug-report-information))
(define %editor
- (make-parameter (or (getenv "EDITOR") "emacsclient")))
+ (make-parameter (or (getenv "VISUAL") (getenv "EDITOR")
+ "emacsclient")))
(define (search-path* path file)
"Like 'search-path' but exit if FILE is not found."