Skip to content

Commit

Permalink
Remove --no-poll option.
Browse files Browse the repository at this point in the history
The --no-poll option was added to allow disabling of polling
when viewing a short file with -F (in
4e516a1, supporting #557).
Now that polling is automatically disabled when a short file
is viewed (in 52b2d92, supporting
  • Loading branch information
gwsw committed Jan 18, 2025
1 parent 52b2d92 commit 59452b6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 33 deletions.
2 changes: 0 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

* Add --form-feed option (github #496).

* Add --no-poll option (github #557).

* Make TAB complete option name in -- command (github #531).

* Make -R able to pass through any OSC escape sequences,
Expand Down
8 changes: 5 additions & 3 deletions forwback.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public int forw_prompt;
public lbool first_time = TRUE; /* We're printing the first screen of output */
public int shell_lines = 1;
public lbool no_eof_bell = FALSE;
extern int no_poll;

extern int sigs;
extern int top_scroll;
Expand All @@ -39,6 +38,7 @@ extern int header_cols;
extern int full_screen;
extern int stop_on_form_feed;
extern POSITION header_start_pos;
extern lbool no_poll;
#if HILITE_SEARCH
extern size_t size_linebuf;
extern int hilite_search;
Expand Down Expand Up @@ -545,8 +545,10 @@ public lbool get_one_screen(void)
int nlines;
POSITION pos = ch_zero();
lbool ret = FALSE;
lbool save_no_poll = no_poll;

no_poll = 1;
/* Disable polling until we know whether we will exit early due to -F. */
no_poll = TRUE;
for (nlines = 0; nlines + shell_lines <= sc_height; nlines++)
{
pos = forw_line(pos);
Expand All @@ -556,6 +558,6 @@ public lbool get_one_screen(void)
break;
}
}
no_poll = 0;
no_poll = save_no_poll;
return ret;
}
16 changes: 0 additions & 16 deletions less.nro.VER
Original file line number Diff line number Diff line change
Expand Up @@ -1476,22 +1476,6 @@ is ignored, except that one line of text may be pasted into the command line
at the bottom of the screen (search strings, file names, etc).
That is, the first newline of text pasted into the command line
and any text that follows it is ignored.
.IP "\-\-no-poll"
Disables polling for \(haX (or the character specified by the
.nh
\-\-intr
.hy
option)
while reading file input.
Only the interrupt character (usually \(haC) can be used to regain
control when the "Waiting for data" message is displayed,
such as in the F command.
This can sometimes be useful if it is expected that
.B less
will exit immediately due to the \-F or \-E option;
in such a case \-\-no-poll will prevent
.B less
from consuming typed-ahead characters from the terminal.
.IP "\-\-no-search-header-lines"
Searches do not include header lines, but still include header columns.
.IP "\-\-no-search-header-columns"
Expand Down
10 changes: 0 additions & 10 deletions opttbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public int match_shift; /* Extra horizontal shift on search match */
public int no_paste; /* Don't accept pasted input */
public int no_edit_warn; /* Don't warn when editing a LESSOPENed file */
public int stop_on_form_feed; /* Stop scrolling on a line starting with form feed */
public int no_poll; /* Don't poll tty for ^X */
public long match_shift_fraction = NUM_FRAC_DENOM/2; /* 1/2 of screen width */
public char intr_char = CONTROL('X'); /* Char to interrupt reads */
#if HILITE_SEARCH
Expand Down Expand Up @@ -185,7 +184,6 @@ static struct optname proc_backspace_optname = { "proc-backspace", NULL };
static struct optname proc_tab_optname = { "proc-tab", NULL };
static struct optname proc_return_optname = { "proc-return", NULL };
static struct optname match_shift_optname = { "match-shift", NULL };
static struct optname no_poll_optname = { "no-poll", NULL };
#if LESSTEST
static struct optname ttyin_name_optname = { "tty", NULL };
#endif /*LESSTEST*/
Expand Down Expand Up @@ -758,14 +756,6 @@ static struct loption option[] =
NULL
}
},
{ OLETTER_NONE, &no_poll_optname,
O_BOOL, OPT_OFF, &no_poll, NULL,
{
"Poll for ^X when reading data",
"Don't poll for ^X when reading data",
NULL
}
},
#if LESSTEST
{ OLETTER_NONE, &ttyin_name_optname,
O_STRING|O_NO_TOGGLE, 0, NULL, opt_ttyin_name,
Expand Down
2 changes: 1 addition & 1 deletion os.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ static lbool reading;
static lbool opening;
public lbool waiting_for_data;
public int consecutive_nulls = 0;
public lbool no_poll = FALSE;

/* Milliseconds to wait for data before displaying "waiting for data" message. */
static int waiting_for_data_delay = 4000;
Expand All @@ -86,7 +87,6 @@ extern int follow_mode;
extern int scanning_eof;
extern char intr_char;
extern int is_tty;
extern int no_poll;
extern int quit_if_one_screen;
extern int one_screen;
#if !MSDOS_COMPILER
Expand Down
2 changes: 1 addition & 1 deletion version.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ v669 11/6/24 Add --no-paste; add --no-edit-warn; add TAB for -- command;
fix "configure --with-secure=no".
v670 11/16/24 Fix SIGWINCH handling; add iopen.
v671 12/6/24 Fix multibyte command chars; fix Windows auto_wrap.
v672
v672 Remove --no-poll.
*/

char version[] = "672x";

0 comments on commit 59452b6

Please sign in to comment.