/* ARGSUSED */ int gotoeop(int f, int n) { int i; return(do_gotoeop(f, n, &i)); }
/* ARGSUSED */ int transposepara(int f, int n) { int i = 0, status; char flg; if (n == 0) return (TRUE); undo_boundary_enable(FFRAND, 0); /* find a paragraph, set mark, then goto the end */ gotobop(FFRAND, 1); curwp->w_markp = curwp->w_dotp; curwp->w_marko = curwp->w_doto; (void)gotoeop(FFRAND, 1); /* take a note of buffer flags - we may need them */ flg = curbp->b_flag; /* clean out kill buffer then kill region */ kdelete(); if ((status = killregion(FFRAND, 1)) != TRUE) return (status); /* * Now step through n paragraphs. If we reach the end of buffer, * stop and paste the killed region back, then display a message. */ if (do_gotoeop(FFRAND, n, &i) == FALSE) { ewprintf("Cannot transpose paragraph, end of buffer reached."); (void)gotobop(FFRAND, i); (void)yank(FFRAND, 1); curbp->b_flag = flg; return (FALSE); } (void)yank(FFRAND, 1); undo_boundary_enable(FFRAND, 1); return (TRUE); }
/* ARGSUSED */ int markpara(int f, int n) { int i = 0; if (n == 0) return (TRUE); clearmark(FFARG, 0); if (findpara() == FALSE) return (TRUE); (void)do_gotoeop(FFRAND, n, &i); /* set the mark here */ curwp->w_markp = curwp->w_dotp; curwp->w_marko = curwp->w_doto; (void)gotobop(FFRAND, i); return (TRUE); }