1
0
mirror of https://github.com/rfivet/uemacs.git synced 2025-09-26 15:04:04 -04:00

Harmonize usage of mlreply, mlreplyt and nextarg based on actual needs (input always terminated either on meta or newline characters).

This commit is contained in:
2015-08-25 09:17:41 +08:00
parent 1ab601071e
commit 51967939b8
6 changed files with 15 additions and 25 deletions

24
input.c
View File

@@ -52,6 +52,8 @@ int ctlxc = CONTROL | 'X' ; /* current control X prefix char */
int reptc = CONTROL | 'U' ; /* current universal repeat char */
int abortc = CONTROL | 'G' ; /* current abort command char */
const int nlc = CONTROL | 'J' ; /* end of input char */
static const int quotec = 0x11 ; /* quote char during mlreply() */
static void outstring( char *s) ;
@@ -91,14 +93,12 @@ int mlyesno( const char *prompt)
* return. Handle erase, kill, and abort keys.
*/
int mlreply( const char *prompt, char *buf, int nbuf)
{
return nextarg(prompt, buf, nbuf, ctoec('\n'));
int mlreply( const char *prompt, char *buf, int nbuf) {
return nextarg( prompt, buf, nbuf, nlc) ;
}
int mlreplyt(const char *prompt, char *buf, int nbuf, int eolchar)
{
return nextarg(prompt, buf, nbuf, eolchar);
int mlreplyt( const char *prompt, char *buf, int nbuf) {
return nextarg( prompt, buf, nbuf, metac) ;
}
/*
@@ -115,18 +115,6 @@ int ectoc(int c)
return c;
}
/*
* ctoec:
* character to extended character
* pull out the CONTROL and SPEC prefixes (if possible)
*/
int ctoec(int c)
{
if (c >= 0x00 && c <= 0x1F)
c = CONTROL | (c + '@');
return c;
}
/*
* get a command name from the command line. Command completion means
* that pressing a <SPACE> will attempt to complete an unfinished command