From: joeyh Date: Wed, 26 Jul 2006 02:46:50 +0000 (+0000) Subject: * vidir, vipe: Use /usr/bin/editor if it's present, and EDITOR and VISUAL X-Git-Tag: 0.15~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92f6884638abdda0fd8140379fcfc2ed36c37679;p=moreutils * vidir, vipe: Use /usr/bin/editor if it's present, and EDITOR and VISUAL arn't set, to comply with Debian policy. For portability, fall back to vi if there's no /usr/bin/editor. Closes: #378623 --- diff --git a/debian/changelog b/debian/changelog index db55dc9..2e639a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,9 @@ moreutils (0.15) UNRELEASED; urgency=low a file. Changed behavior to just print all lines from both files, even if this means printing dups. Not sure I like this behavior either, but it's consistent with the very useful behaviors of "and" and "not". + * vidir, vipe: Use /usr/bin/editor if it's present, and EDITOR and VISUAL + arn't set, to comply with Debian policy. For portability, fall back to vi + if there's no /usr/bin/editor. Closes: #378623 -- Joey Hess Tue, 25 Jul 2006 22:26:56 -0400 diff --git a/vidir b/vidir index f8227b1..f67f74d 100755 --- a/vidir +++ b/vidir @@ -39,7 +39,7 @@ Verbosely display the actions taken by the program. =item EDITOR -Editor to use. Defaults to vi if not set. +Editor to use. =item VISUAL @@ -104,6 +104,9 @@ foreach (@dir) { close OUT; my @editor="vi"; +if (-x "/usr/bin/editor") { + @editor="/usr/bin/editor"; +} if (exists $ENV{EDITOR}) { @editor=split(' ', $ENV{EDITOR}); } diff --git a/vipe b/vipe index 773eacf..8cee2b1 100755 --- a/vipe +++ b/vipe @@ -19,7 +19,7 @@ edit the data that is being piped between programs. =item EDITOR -Editor to use. Defaults to vi if not set. +Editor to use. =item VISUAL @@ -52,6 +52,9 @@ close STDOUT; open(STDOUT, ">/dev/tty") || die "reopen stdout: $!"; my @editor="vi"; +if (-x "/usr/bin/editor") { + @editor="/usr/bin/editor"; +} if (exists $ENV{EDITOR}) { @editor=split(' ', $ENV{EDITOR}); }