1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-06-09 21:40:42 +00:00

Restrict scope of mlputs to display.

This commit is contained in:
Renaud 2015-01-21 17:16:43 +08:00
parent b101f703c0
commit 891f4c3238
3 changed files with 13 additions and 14 deletions

View File

@ -87,6 +87,7 @@ static void modeline(struct window *wp);
static void mlputi(int i, int r); static void mlputi(int i, int r);
static void mlputli(long l, int r); static void mlputli(long l, int r);
static void mlputf(int s); static void mlputf(int s);
static void mlputs( char *s) ;
#if SIGWINCH #if SIGWINCH
static int newscreensize(int h, int w); static int newscreensize(int h, int w);
#endif #endif
@ -1436,8 +1437,7 @@ void mlforce( char *s) {
* the characters in the string all have width "1"; if this is not the case * the characters in the string all have width "1"; if this is not the case
* things will get screwed up a little. * things will get screwed up a little.
*/ */
void mlputs(char *s) static void mlputs( char *s) {
{
int c; int c;
while ((c = *s++) != 0) { while ((c = *s++) != 0) {

View File

@ -24,7 +24,6 @@ void movecursor( int row, int col) ;
void mlerase( void) ; void mlerase( void) ;
void mlwrite( const char *fmt, ...) ; void mlwrite( const char *fmt, ...) ;
void mlforce( char *s) ; void mlforce( char *s) ;
void mlputs( char *s) ;
void getscreensize( int *widthp, int *heightp) ; void getscreensize( int *widthp, int *heightp) ;
#if UNIX #if UNIX

22
spawn.c
View File

@ -68,12 +68,12 @@ int spawncli(int f, int n)
#if VMS #if VMS
movecursor(term.t_nrow, 0); /* In last line. */ movecursor(term.t_nrow, 0); /* In last line. */
mlputs("(Starting DCL)\r\n"); mlwrite("(Starting DCL)\r\n");
TTflush(); /* Ignore "ttcol". */ TTflush(); /* Ignore "ttcol". */
sgarbf = TRUE; sgarbf = TRUE;
sys(NULL); sys(NULL);
sleep(1); sleep(1);
mlputs("\r\n(Returning from DCL)\r\n"); mlwrite("\r\n(Returning from DCL)\r\n");
TTflush(); TTflush();
sleep(1); sleep(1);
return TRUE; return TRUE;
@ -162,7 +162,7 @@ int spawn(int f, int n)
TTflush(); TTflush();
s = sys(line); /* Run the command. */ s = sys(line); /* Run the command. */
if (clexec == FALSE) { if (clexec == FALSE) {
mlputs("\r\n\n(End)"); /* Pause. */ mlwrite("\r\n\n(End)"); /* Pause. */
TTflush(); TTflush();
tgetc(); tgetc();
} }
@ -178,7 +178,7 @@ int spawn(int f, int n)
TTkopen(); TTkopen();
/* if we are interactive, pause here */ /* if we are interactive, pause here */
if (clexec == FALSE) { if (clexec == FALSE) {
mlputs("\r\n(End)"); mlwrite("\r\n(End)");
tgetc(); tgetc();
} }
sgarbf = TRUE; sgarbf = TRUE;
@ -195,10 +195,10 @@ int spawn(int f, int n)
TTopen(); TTopen();
if (clexec == FALSE) { if (clexec == FALSE) {
mlputs("(End)"); /* Pause. */ mlwrite( "(End)") ; /* Pause. */
TTflush(); TTflush();
while ((s = tgetc()) != '\r' && s != ' '); while ((s = tgetc()) != '\r' && s != ' ');
mlputs("\r\n"); mlwrite( "\r\n") ;
} }
TTkopen(); TTkopen();
sgarbf = TRUE; sgarbf = TRUE;
@ -226,7 +226,7 @@ int execprg(int f, int n)
return s; return s;
TTflush(); TTflush();
s = sys(line); /* Run the command. */ s = sys(line); /* Run the command. */
mlputs("\r\n\n(End)"); /* Pause. */ mlwrite("\r\n\n(End)"); /* Pause. */
TTflush(); TTflush();
tgetc(); tgetc();
sgarbf = TRUE; sgarbf = TRUE;
@ -242,7 +242,7 @@ int execprg(int f, int n)
TTkopen(); TTkopen();
/* if we are interactive, pause here */ /* if we are interactive, pause here */
if (clexec == FALSE) { if (clexec == FALSE) {
mlputs("\r\n(End)"); mlwrite("\r\n(End)");
tgetc(); tgetc();
} }
sgarbf = TRUE; sgarbf = TRUE;
@ -259,7 +259,7 @@ int execprg(int f, int n)
ue_system( line) ; ue_system( line) ;
fflush(stdout); /* to be sure P.K. */ fflush(stdout); /* to be sure P.K. */
TTopen(); TTopen();
mlputs("(End)"); /* Pause. */ mlwrite( "(End)") ; /* Pause. */
TTflush(); TTflush();
while ((s = tgetc()) != '\r' && s != ' '); while ((s = tgetc()) != '\r' && s != ' ');
sgarbf = TRUE; sgarbf = TRUE;
@ -429,7 +429,7 @@ int filter_buffer(int f, int n)
/* write it out, checking for errors */ /* write it out, checking for errors */
if (writeout(filnam1) != TRUE) { if (writeout(filnam1) != TRUE) {
mlwrite("(Cannot write filter file)"); mlwrite( "(Cannot write filter file)") ;
strcpy(bp->b_fname, tmpnam); strcpy(bp->b_fname, tmpnam);
return FALSE; return FALSE;
} }
@ -459,7 +459,7 @@ int filter_buffer(int f, int n)
/* on failure, escape gracefully */ /* on failure, escape gracefully */
if (s != TRUE || (readin(filnam2, FALSE) == FALSE)) { if (s != TRUE || (readin(filnam2, FALSE) == FALSE)) {
mlwrite("(Execution failed)"); mlwrite( "(Execution failed)") ;
strcpy(bp->b_fname, tmpnam); strcpy(bp->b_fname, tmpnam);
unlink(filnam1); unlink(filnam1);
unlink(filnam2); unlink(filnam2);