Skip to content

Commit

Permalink
Add -Pw option.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Dec 5, 2001
1 parent 19c20c6 commit ed87434
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ch.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ fch_get()
* Wait a while, then try again.
*/
if (!slept)
ierror("Waiting for data", NULL_PARG);
{
PARG parg;
parg.p_string = wait_message();
ierror("%s", &parg);
}
#if !MSDOS_COMPILER
sleep(1);
#else
Expand Down
1 change: 1 addition & 0 deletions less.nro.VER
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ to that string.
-PM changes the long (-M) prompt.
-Ph changes the prompt for the help screen.
-P= changes the message printed by the = command.
-Pw changes the message printed while waiting for data (in the F command).
All prompt strings consist of a sequence of
letters and special escape sequences.
See the section on PROMPTS for more details.
Expand Down
2 changes: 2 additions & 0 deletions optfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ extern char closequote;
extern char *prproto[];
extern char *eqproto;
extern char *hproto;
extern char *wproto;
extern IFILE curr_ifile;
extern char version[];
#if LOGFILE
Expand Down Expand Up @@ -291,6 +292,7 @@ opt__P(type, s)
case 'M': proto = &prproto[PR_LONG]; s++; break;
case '=': proto = &eqproto; s++; break;
case 'h': proto = &hproto; s++; break;
case 'w': proto = &wproto; s++; break;
default: proto = &prproto[PR_SHORT]; break;
}
free(*proto);
Expand Down
13 changes: 13 additions & 0 deletions prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ static constant char e_proto[] =
"?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. .byte %bB?s/%s. ?e(END) :?pB%pB\\%..%t";
static constant char h_proto[] =
"HELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done";
static constant char w_proto[] =
"Waiting for data";

public char *prproto[3];
public char constant *eqproto = e_proto;
public char constant *hproto = h_proto;
public char constant *wproto = w_proto;

static char message[PROMPT_SIZE];
static char *mp;
Expand All @@ -69,6 +72,7 @@ init_prompt()
prproto[2] = save(M_proto);
eqproto = save(e_proto);
hproto = save(h_proto);
wproto = save(w_proto);
}

/*
Expand Down Expand Up @@ -528,3 +532,12 @@ pr_string()
return (pr_expand(hproto, sc_width-so_s_width-so_e_width-2));
return (pr_expand(prproto[pr_type], sc_width-so_s_width-so_e_width-2));
}

/*
* Return a message suitable for printing while waiting in the F command.
*/
public char *
wait_message()
{
return (pr_expand(wproto, sc_width-so_s_width-so_e_width-2));
}

0 comments on commit ed87434

Please sign in to comment.