Gentoo Archives: gentoo-user

From: Willie Wong <wwong@×××××××××.EDU>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] less and colourisation
Date: Sun, 26 Nov 2006 02:12:30
Message-Id: 20061126020822.GA21140@princeton.edu
In Reply to: Re: [gentoo-user] less and colourisation by Benno Schulenberg
1 On Sat, Nov 25, 2006 at 08:18:27PM +0100, Penguin Lover Benno Schulenberg squawked:
2 > Willie Wong wrote:
3 > > LESS (should be -R -M --shift 5 by default)
4 >
5 > When doing
6 >
7 > export LESS="-R -M --shift 5"
8 >
9 > a C-file viewed with 'less' is coloured. But when doing
10 >
11 > export LESS="-RM --shift 5"
12 >
13 > not. What is being tripped up where here?
14 >
15 Interesting, that is probably because of the following snip from
16 lesspipe.sh (the gentoo less filter)
17
18 # Only colorize if we know less will handle raw codes
19 for opt in ${LESS} ; do
20 if [[ ${opt} == "-r" || ${opt} == "-R" ]] ; then
21 ${LESSCOLORIZER} "$1"
22 break
23 fi
24 done
25
26 I would probably consider that a bug worth filing on b.g.o. That
27 snipplet assumes that options would be specified 1 per dash with no
28 ganging, which does not fit in the old unix-style paradigm; but it
29 also completely ignores the gnu-style options given in the man page
30 (--raw-control-chars and --RAW-CONTROL-CHARS for -r and -R
31 respectively)
32
33 W
34 --
35 You should approach relationships like chess. And preferably as Deep Blue plays
36 it, or at least as Kasparov.
37 Sortir en Pantoufles: up 92 days, 19:33
38 --
39 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] less and colourisation Benno Schulenberg <benno.schulenberg@×××××.com>