コード例 #1
0
ファイル: msgs.c プロジェクト: ricksladkey/vile
void
popup_msgs(void)
{
    BUFFER *savebp = curbp;
    WINDOW *savewp = curwp;
    MARK savemk;
    register BUFFER *bp;
    WINDOW *wp;

    if ((bp = create_msgs()) == 0)
	return;

    savemk = DOT;
    if (!is_empty_buf(bp)) {
	if ((curwp == 0) || sgarbf || global_g_val(GMDPOPUP_MSGS) == -TRUE) {
	    return;		/* CAN'T popup yet */
	}
	if (popupbuff(bp) == FALSE) {
	    (void) zotbuf(bp);
	    return;
	}

	if ((wp = bp2any_wp(bp)) != NULL) {
	    make_local_w_val(wp, WMDNUMBER);
	    set_w_val(wp, WMDNUMBER, FALSE);
	}
	set_rdonly(bp, non_filename(), MDVIEW);
	curbp = savebp;
	curwp = savewp;
	if (savewp)
	    DOT = savemk;
    }
}
コード例 #2
0
/* ARGSUSED */
int
pipecmd(int f, int n)
{
	register BUFFER *bp;	/* pointer to buffer to zot */
	register int	s;
	char line[NLINE];	/* command line send to shell */

	/* get the command to pipe in */
	hst_init('!');
	s = ShellPrompt(&save_shell[!global_g_val(GMDSAMEBANGS)], line, -TRUE);
	hst_flush();

	/* prompt ok? */
	if (s != TRUE)
		return s;

	/* take care of autowrite */
	if (writeall(f,n,FALSE,FALSE,TRUE) != TRUE)
		return FALSE;


#if BEFORE
	if (((s = ((bp = bfind(OUTPUT_BufName, 0)) != NULL)) == TRUE)
	 && ((s = popupbuff(bp)) == TRUE)
	 && ((s = swbuffer(bp)) == TRUE)
	 && ((s = readin(line, FALSE, bp, TRUE)) == TRUE))
		set_rdonly(bp, line, MDVIEW);

#else
	if ((s = ((bp = bfind(OUTPUT_BufName, 0)) != NULL)) != TRUE)
		return s;
	if ((s = popupbuff(bp)) != TRUE)
		return s;
	ch_fname(bp,line);
	bp->b_active = FALSE; /* force a re-read */
	if ((s = swbuffer_lfl(bp,FALSE)) != TRUE)
		return s;
	set_rdonly(bp, line, MDVIEW);
#endif

	return (s);
}