Skip to contentSkip to conversation

pager: default to LESS=FRX not LESS=FRSX

PATCH In review Eygene Ryabinkin 5 participants 11 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pager: default to LESS=FRX not LESS=FRSX

Remove unnecessary '-S' option that enabled less to chop long lines. It used to provide some confusion at least for the 'git diff':
"Where are my long lines? Are they missed from the patch?".

---
 pager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
pager.c +1 -1
index 5f280ab..2dca00e 100644
@@ -62,7 +62,7 @@ void setup_pager(void)
 	close(fd[0]);
 	close(fd[1]);
 
-	setenv("LESS", "FRSX", 0);
+	setenv("LESS", "FRX", 0);
 	run_pager(pager);
 	die("unable to execute pager '%s'", pager);
 	exit(255);
Signature · 1 line
1.5.0.3-dirty
#1 lore raw
Quoted 3 lines · Eygene Ryabinkin

Remove unnecessary '-S' option that enabled less to chop long lines. It used to provide some confusion at least for the 'git diff':
"Where are my long lines? Are they missed from the patch?".

It is not "unnecessary", but only "what _you_ are not used to". As this breaks expectentions of people already familiar with what git does by default, I cannot take this patch.

#2 lore raw
Quoted 9 lines · Junio C Hamano
Quoted 3 lines · Eygene Ryabinkin

Remove unnecessary '-S' option that enabled less to chop long lines. It used to provide some confusion at least for the 'git diff':
"Where are my long lines? Are they missed from the patch?".

It is not "unnecessary", but only "what _you_ are not used to". As this breaks expectentions of people already familiar with what git does by default, I cannot take this patch.

Hear hear. I completely agree with Junio. I (and a number of other users that I work with) expect this behevaior by default.

Signature · 1 line
Shawn.
#3 lore raw
Quoted 7 lines · Shawn O. Pearce
Quoted 6 lines · Junio C Hamano
Quoted 3 lines · Eygene Ryabinkin

Remove unnecessary '-S' option that enabled less to chop long lines. It used to provide some confusion at least for the 'git diff':
"Where are my long lines? Are they missed from the patch?".

Quoted 6 lines
Quoted 3 lines

It is not "unnecessary", but only "what _you_ are not used to". As this breaks expectentions of people already familiar with what git does by default, I cannot take this patch.

Hear hear. I completely agree with Junio. I (and a number of other users that I work with) expect this behevaior by default.

Two tips.

(1) Learn to use left/right arrow keys under "less -S" if you have occasional lines that are too long.

(2) Do not have too many too long lines to begin with. If you cannot comfortably read your code with "less -S", your nesting is too deep to be understood with or without line folding.

#4 lore raw
Quoted 13 lines · On Monday, March 26, 2007 at 01:44:34 (-0700) Junio C Hamano writes:
Quoted 11 lines · Shawn O. Pearce
Quoted 9 lines · Junio C Hamano
Quoted 3 lines · Eygene Ryabinkin

Remove unnecessary '-S' option that enabled less to chop long lines. It used to provide some confusion at least for the 'git diff':
"Where are my long lines? Are they missed from the patch?".

It is not "unnecessary", but only "what _you_ are not used to". As this breaks expectentions of people already familiar with what git does by default, I cannot take this patch.

Quoted 7 lines
Quoted 2 lines

Hear hear. I completely agree with Junio. I (and a number of other users that I work with) expect this behevaior by default.

Two tips.

(1) Learn to use left/right arrow keys under "less -S" if you have occasional lines that are too long.

Hmm, looking at the code: why, if the environment variable LESS is already set, should this all be worth talking about? Shouldn't the user be able to set LESS to whatever they want, once, and be done with it? The current setenv() call to set up the pager does this, correct?

Bill

#5 lore raw

Bill, good day.

Quoted 7 lines · Bill Lear
Quoted 2 lines

(1) Learn to use left/right arrow keys under "less -S" if you have occasional lines that are too long.

Hmm, looking at the code: why, if the environment variable LESS is already set, should this all be worth talking about? Shouldn't the user be able to set LESS to whatever they want, once, and be done with it? The current setenv() call to set up the pager does this, correct?

If it was named GIT_LESS, then yes, I could set it to the defaults that are sane for me with Git. But I do not like the idea of setting -F, -R and -X for all less invocations. But OK, the 'l' and 'h' bindings for less movements are fine with me. I do not like scrolling very much (using 14400 modem lines sometimes, so it is a bit slow), but if 'FRSX' are good defaults that people are used to, then I should live with them. Or probably start the git-FRX toolchain ;))

OK, I feel that this thread is exhausted itself, so I am shutting up.

Signature · 1 line
Eygene
#6 lore raw
In reply to Bill Lear
Quoted 19 lines · Bill Lear
Quoted 18 lines · On Monday, March 26, 2007 at 01:44:34 (-0700) Junio C Hamano writes:
Quoted 7 lines · Shawn O. Pearce
Quoted 6 lines · Junio C Hamano
Quoted 3 lines · Eygene Ryabinkin

Remove unnecessary '-S' option that enabled less to chop long lines. It used to provide some confusion at least for the 'git diff':
"Where are my long lines? Are they missed from the patch?".

Quoted 6 lines
Quoted 3 lines

It is not "unnecessary", but only "what _you_ are not used to". As this breaks expectentions of people already familiar with what git does by default, I cannot take this patch.

Hear hear. I completely agree with Junio. I (and a number of other users that I work with) expect this behevaior by default.

Two tips.

Quoted 7 lines
Quoted 2 lines

(1) Learn to use left/right arrow keys under "less -S" if you have occasional lines that are too long.

Hmm, looking at the code: why, if the environment variable LESS is already set, should this all be worth talking about? Shouldn't the user be able to set LESS to whatever they want, once, and be done with it? The current setenv() call to set up the pager does this, correct?

Yes. That would make the third tip ;-).

#7 lore raw
In reply to Junio C Hamano

Junio,

Quoted 10 lines · Junio C Hamano
Quoted 10 lines
Quoted 9 lines · Junio C Hamano
Quoted 3 lines · Eygene Ryabinkin

Remove unnecessary '-S' option that enabled less to chop long lines. It used to provide some confusion at least for the 'git diff':
"Where are my long lines? Are they missed from the patch?".

It is not "unnecessary", but only "what _you_ are not used to". As this breaks expectentions of people already familiar with what git does by default, I cannot take this patch.

OK, no problem.

Quoted 7 lines
Quoted 2 lines

Hear hear. I completely agree with Junio. I (and a number of other users that I work with) expect this behevaior by default.

Two tips.

(1) Learn to use left/right arrow keys under "less -S" if you have occasional lines that are too long.

I do not like the left/right keys: it is wery hard to get the right typing speed if we're using the arrow keys. But it is just my habit since I learned to 10 fingers typing.

Quoted 4 lines

(2) Do not have too many too long lines to begin with. If you cannot comfortably read your code with "less -S", your nesting is too deep to be understood with or without line folding.

Yes, yes, "if you need more than 4 levels of identation then your code is probably in a bad shape". I know it. But the problem was that I noticed this behaviour when I was patching the Git sources and there were some removed lines that were long enough not to fit to the screen with the addition of the '- ' diff tags.

Signature · 1 line
Eygene
#8 lore raw
Quoted 3 lines · Eygene Ryabinkin

I do not like the left/right keys: it is wery hard to get the right typing speed if we're using the arrow keys. But it is just my habit since I learned to 10 fingers typing.

You might try:

cat >>$HOME/.lesskey <<'EOF'
h left-scroll
l right-scroll
EOF
lesskey

-Peff

#9 lore raw

Jeff, good day.

Quoted 6 lines · Jeff King
Quoted 3 lines · Eygene Ryabinkin

I do not like the left/right keys: it is wery hard to get the right typing speed if we're using the arrow keys. But it is just my habit since I learned to 10 fingers typing.

Quoted 7 lines

You might try:

cat >>$HOME/.lesskey <<'EOF'
h left-scroll
l right-scroll
EOF
lesskey

Very good, thanks!

Signature · 1 line
Eygene
#10 lore raw
In reply to Eygene Ryabinkin
Quoted 7 lines · Eygene Ryabinkin
Quoted 4 lines

Two tips.

(1) Learn to use left/right arrow keys under "less -S" if you have occasional lines that are too long.

I do not like the left/right keys: it is wery hard to get the right typing speed ...

Heh, who types 120-word a minute while perusing the source with "less"?

I do not like to move my hand from the home position on the keyboard either, so I never touch arrow keys while I am typing to produce, but I never thought of bothering to reconfigure less keybindings for the reason you stated, as I do not have infinite amount of time.