home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / pine / pico / basic.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-06  |  16.4 KB  |  678 lines

  1. #if    !defined(lint) && !defined(DOS)
  2. static char rcsid[] = "$Id: basic.c,v 4.5 1993/09/29 16:45:07 mikes Exp $";
  3. #endif
  4. /*
  5.  * Program:    Cursor manipulation functions
  6.  *
  7.  *
  8.  * Michael Seibel
  9.  * Networks and Distributed Computing
  10.  * Computing and Communications
  11.  * University of Washington
  12.  * Administration Builiding, AG-44
  13.  * Seattle, Washington, 98195, USA
  14.  * Internet: mikes@cac.washington.edu
  15.  *
  16.  * Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  17.  *
  18.  * Copyright 1991-1993  University of Washington
  19.  *
  20.  *  Permission to use, copy, modify, and distribute this software and its
  21.  * documentation for any purpose and without fee to the University of
  22.  * Washington is hereby granted, provided that the above copyright notice
  23.  * appears in all copies and that both the above copyright notice and this
  24.  * permission notice appear in supporting documentation, and that the name
  25.  * of the University of Washington not be used in advertising or publicity
  26.  * pertaining to distribution of the software without specific, written
  27.  * prior permission.  This software is made available "as is", and
  28.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  29.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  30.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  31.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  32.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  33.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  34.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  35.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  36.  *
  37.  * Pine and Pico are trademarks of the University of Washington.
  38.  * No commercial use of these trademarks may be made without prior
  39.  * written permission of the University of Washington.
  40.  *
  41.  */
  42. /*
  43.  * The routines in this file move the cursor around on the screen. They
  44.  * compute a new value for the cursor, then adjust ".". The display code
  45.  * always updates the cursor location, so only moves between lines, or
  46.  * functions that adjust the top line in the window and invalidate the
  47.  * framing, are hard.
  48.  */
  49. #include        <stdio.h>
  50. #include    "estruct.h"
  51. #include        "edef.h"
  52. #include        "pico.h"
  53. #ifdef HEBREW
  54. #include "hebrew.h"
  55. #endif
  56.  
  57. #ifdef    ANSI
  58.     int getgoal(struct LINE *);
  59. #else
  60.     int getgoal();
  61. #endif
  62.  
  63.  
  64. /*
  65.  * Move the cursor to the
  66.  * beginning of the current line.
  67.  * Trivial.
  68.  */
  69. gotobol(f, n)
  70. int f, n;
  71. {
  72.     curwp->w_doto  = 0;
  73.     return (TRUE);
  74. }
  75.  
  76. call_backchar(f, n)
  77. register int    n;
  78. {
  79. #ifdef HEBREW
  80. if(compose_heb && hebmain)forwchar(f,n);
  81. else backchar(f,n);
  82. #else
  83. backchar(f,n);
  84. #endif
  85. }
  86.  
  87.  
  88. call_forwchar(f, n)
  89. register int    n;
  90. {
  91. #ifdef HEBREW
  92. if(compose_heb && hebmain)backchar(f,n);
  93. else forwchar(f,n);
  94. #else
  95. forwchar(f,n);
  96. #endif
  97.  
  98. }
  99.  
  100. /*
  101.  * Move the cursor backwards by "n" characters. If "n" is less than zero call
  102.  * "forwchar" to actually do the move. Otherwise compute the new cursor
  103.  * location. Error if you try and move out of the buffer. Set the flag if the
  104.  * line pointer for dot changes.
  105.  */
  106. backchar(f, n)
  107. int             f;
  108. register int    n;
  109. {
  110.     register LINE   *lp;
  111.     register int    status;
  112.  
  113.     if (n < 0)
  114.       return (forwchar(f, -n));
  115.  
  116.     while (n--) {
  117.     if (curwp->w_doto == 0) {
  118.         if ((lp=lback(curwp->w_dotp)) == curbp->b_linep)
  119.           if(Pmaster){
  120.           /*
  121.            * go up into editing the mail header if on 
  122.            * the top line and the user hits the left arrow!!!
  123.            *
  124.            * if the editor returns anything except -1, the 
  125.            * user requested something special, so let 
  126.            * pico know...
  127.            */
  128.           if((status = HeaderEditor(2, 1)) != -1){
  129.               return(META|status);
  130.           }
  131.           else
  132.             return (FALSE);
  133.           }
  134.           else
  135.         return (FALSE);
  136.  
  137.         curwp->w_dotp  = lp;
  138.         curwp->w_doto  = llength(lp);
  139.         curwp->w_flag |= WFMOVE;
  140.     } else
  141.       curwp->w_doto--;
  142.     }
  143.  
  144.     return (TRUE);
  145. }
  146.  
  147.  
  148. /*
  149.  * Move the cursor to the end of the current line. Trivial. No errors.
  150.  */
  151. gotoeol(f, n)
  152. int f, n;
  153. {
  154.     curwp->w_doto  = llength(curwp->w_dotp);
  155.     return (TRUE);
  156. }
  157.  
  158.  
  159. /*
  160.  * Move the cursor forwwards by "n" characters. If "n" is less than zero call
  161.  * "backchar" to actually do the move. Otherwise compute the new cursor
  162.  * location, and move ".". Error if you try and move off the end of the
  163.  * buffer. Set the flag if the line pointer for dot changes.
  164.  */
  165. forwchar(f, n)
  166. int             f;
  167. register int    n;
  168. {
  169.     if (n < 0)
  170.       return (backchar(f, -n));
  171.  
  172.     while (n--) {
  173.     if (curwp->w_doto == llength(curwp->w_dotp)) {
  174.         if (curwp->w_dotp == curbp->b_linep)
  175.           return (FALSE);
  176.  
  177.         curwp->w_dotp  = lforw(curwp->w_dotp);
  178.         curwp->w_doto  = 0;
  179.         curwp->w_flag |= WFMOVE;
  180.     }
  181.     else
  182.       curwp->w_doto++;
  183.     }
  184.     
  185.     return (TRUE);
  186. }
  187.  
  188.  
  189. /*
  190.  * move to a particular line.
  191.  * argument (n) must be a positive integer for
  192.  * this to actually do anything
  193.  */
  194. gotoline(f, n)
  195. int f, n;
  196. {
  197.     if (n < 1)        /* if a bogus argument...then leave */
  198.       return(FALSE);
  199.  
  200.     /* first, we go to the start of the buffer */
  201.     curwp->w_dotp  = lforw(curbp->b_linep);
  202.     curwp->w_doto  = 0;
  203.     return(forwline(f, n-1));
  204. }
  205.  
  206.  
  207. /*
  208.  * Goto the beginning of the buffer. Massive adjustment of dot. This is
  209.  * considered to be hard motion; it really isn't if the original value of dot
  210.  * is the same as the new value of dot. Normally bound to "M-<".
  211.  */
  212. gotobob(f, n)
  213. int f, n;
  214. {
  215.     curwp->w_dotp  = lforw(curbp->b_linep);
  216.     curwp->w_doto  = 0;
  217.     curwp->w_flag |= WFHARD;
  218. #ifdef HEBREW
  219.     if(compose_heb && (hebmain!=curwp->w_dotp->l_type))ltoggle();
  220. #endif
  221.     return (TRUE);
  222. }
  223.  
  224.  
  225. /*
  226.  * Move to the end of the buffer. Dot is always put at the end of the file
  227.  * (ZJ). The standard screen code does most of the hard parts of update.
  228.  * Bound to "M->".
  229.  */
  230. gotoeob(f, n)
  231. int f, n;
  232. {
  233.     curwp->w_dotp  = curbp->b_linep;
  234.     curwp->w_doto  = 0;
  235.     curwp->w_flag |= WFHARD;
  236. #ifdef HEBREW
  237.     if(compose_heb && (hebmain!=curwp->w_dotp->l_type))ltoggle();
  238. #endif
  239.     return (TRUE);
  240. }
  241.  
  242.  
  243. /*
  244.  * Move forward by full lines. If the number of lines to move is less than
  245.  * zero, call the backward line function to actually do it. The last command
  246.  * controls how the goal column is set. Bound to "C-N". No errors are
  247.  * possible.
  248.  */
  249. forwline(f, n)
  250. int f, n;
  251. {
  252.     register LINE   *dlp;
  253.  
  254.     if (n < 0)
  255.       return (backline(f, -n));
  256.  
  257.     if ((lastflag&CFCPCN) == 0)             /* Reset goal if last   */
  258.       curgoal = getccol(FALSE);       /* not C-P or C-N       */
  259.  
  260.     thisflag |= CFCPCN;
  261.     dlp = curwp->w_dotp;
  262.     while (n-- && dlp!=curbp->b_linep)
  263.       dlp = lforw(dlp);
  264.  
  265.     curwp->w_dotp  = dlp;
  266.     curwp->w_doto  = getgoal(dlp);
  267.     curwp->w_flag |= WFMOVE;
  268. #ifdef HEBREW
  269.     if(compose_heb && (dlp->l_type != hebmain))ltoggle();
  270. #endif
  271.     return (TRUE);
  272. }
  273.  
  274.  
  275. /*
  276.  * This function is like "forwline", but goes backwards. The scheme is exactly
  277.  * the same. Check for arguments that are less than zero and call your
  278.  * alternate. Figure out the new line and call "movedot" to perform the
  279.  * motion. No errors are possible. Bound to "C-P".
  280.  */
  281. backline(f, n)
  282. int f, n;
  283. {
  284.     register LINE   *dlp;
  285.     register int    status;
  286.  
  287.     if (n < 0)
  288.       return (forwline(f, -n));
  289.  
  290.     if(Pmaster){
  291.     /*
  292.      * go up into editing the mail header if on the top line
  293.      * and the user hits the up arrow!!!
  294.      */
  295.     if (lback(curwp->w_dotp) == curbp->b_linep){
  296.         /*
  297.          * if the editor returns anything except -1 then the user
  298.          * has requested something special, so let pico know...
  299.          */
  300.         if((status = HeaderEditor(1, 1)) != -1){
  301.         return(META|status);
  302.         }
  303.     }
  304.     }
  305.  
  306.     if ((lastflag&CFCPCN) == 0)             /* Reset goal if the    */
  307.       curgoal = getccol(FALSE);       /* last isn't C-P, C-N  */
  308.  
  309.     thisflag |= CFCPCN;
  310.     dlp = curwp->w_dotp;
  311.     while (n-- && lback(dlp)!=curbp->b_linep)
  312.       dlp = lback(dlp);
  313.  
  314.     curwp->w_dotp  = dlp;
  315.     curwp->w_doto  = getgoal(dlp);
  316.     curwp->w_flag |= WFMOVE;
  317. #ifdef HEBREW
  318.     if(compose_heb && (hebmain!=dlp->l_type))ltoggle();
  319. #endif
  320.     return (TRUE);
  321. }
  322.  
  323.  
  324. /*
  325.  * go back to the begining of the current paragraph
  326.  * here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
  327.  * combination to delimit the begining of a paragraph    
  328.  */
  329. gotobop(f, n)
  330. int f, n;    /* default Flag & Numeric argument */
  331. {
  332.     if (n < 0)    /* the other way...*/
  333.       return(gotoeop(f, -n));
  334.  
  335.     while (n-- > 0) {    /* for each one asked for */
  336.  
  337.     /* first scan back until we are in a word */
  338.     while(!inword())
  339.       if(lback(curwp->w_dotp) == curbp->b_linep 
  340.          && curwp->w_doto == 0)
  341.         /* top line and nowhere else to go */
  342.         return(FALSE);
  343.       else if(backchar(FALSE, 1) == FALSE)
  344.         break;
  345.  
  346.     curwp->w_doto = 0;    /* and go to the B-O-Line */
  347.  
  348.     /* and scan back until we hit a <NL><NL> or <NL><TAB>
  349.        or a <NL><SPACE>                    */
  350.     while (lback(curwp->w_dotp) != curbp->b_linep)
  351.       if (llength(curwp->w_dotp) != 0 &&
  352.           lgetc(curwp->w_dotp, curwp->w_doto).c != TAB &&
  353.           lgetc(curwp->w_dotp, curwp->w_doto).c != ' ')
  354.         curwp->w_dotp = lback(curwp->w_dotp);
  355.       else
  356.         break;
  357.  
  358.     /* and then forward until we are in a word */
  359.     while(!inword())
  360.       if(forwchar(FALSE,1) == FALSE)
  361.         break;
  362.     }
  363.  
  364.     curwp->w_flag |= WFMOVE;    /* force screen update */
  365. #ifdef HEBREW
  366.     if(compose_heb && (hebmain!=curwp->w_dotp->l_type))ltoggle();
  367. #endif
  368. }
  369.  
  370.  
  371. /* 
  372.  * go forword to the end of the current paragraph
  373.  * here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
  374.  * combination to delimit the begining of a paragraph
  375.  */
  376. gotoeop(f, n)
  377. int f, n;    /* default Flag & Numeric argument */
  378.  
  379. {
  380.     register int suc;    /* success of last backchar */
  381.  
  382.     if (n < 0)    /* the other way...*/
  383.       return(gotobop(f, -n));
  384.  
  385.     while (n-- > 0) {    /* for each one asked for */
  386.     
  387.     /* first scan forward until we are in a word */
  388.     if(curwp->w_dotp != curbp->b_linep){
  389.         curwp->w_doto = 0;        /* go to the B-O-Line */
  390.         curwp->w_dotp = lforw(curwp->w_dotp);
  391.     }
  392.  
  393.     /* and scan forword until we hit a <NL><NL> or <NL><TAB>
  394.        or a <NL><SPACE>                    */
  395.     while (curwp->w_dotp != curbp->b_linep) {
  396.         if (llength(curwp->w_dotp) != 0 &&
  397.         lgetc(curwp->w_dotp, curwp->w_doto).c != TAB &&
  398.         lgetc(curwp->w_dotp, curwp->w_doto).c != ' ')
  399.           curwp->w_dotp = lforw(curwp->w_dotp);
  400.         else
  401.           break;
  402.     }
  403.     
  404.     /* and then backward until we are in a word */
  405.     suc = TRUE;
  406.     while (suc && !inword()) {
  407.         if(lback(curwp->w_dotp) == curbp->b_linep 
  408.            && curwp->w_doto == 0)
  409.           break;
  410.         suc = backchar(FALSE, 1);
  411.     }
  412.     curwp->w_doto = llength(curwp->w_dotp);    /* and to the EOL */
  413.     }
  414.  
  415.     curwp->w_flag |= WFMOVE;    /* force screen update */
  416. #ifdef HEBREW
  417.     if(compose_heb && (hebmain!=curwp->w_dotp->l_type))ltoggle();
  418. #endif
  419.     return(TRUE);
  420. }
  421.  
  422. /*
  423.  * This routine, given a pointer to a LINE, and the current cursor goal
  424.  * column, return the best choice for the offset. The offset is returned.
  425.  * Used by "C-N" and "C-P".
  426.  */
  427. getgoal(dlp)
  428. register LINE   *dlp;
  429. {
  430.     register int    c;
  431.     register int    col;
  432.     register int    newcol;
  433.     register int    dbo;
  434.  
  435.     col = 0;
  436.     dbo = 0;
  437.     while (dbo != llength(dlp)) {
  438.     c = lgetc(dlp, dbo).c;
  439.     newcol = col;
  440.     if (c == '\t')
  441.       newcol |= 0x07;
  442.     else if (c<0x20 || c==0x7F)
  443.       ++newcol;
  444.  
  445.     ++newcol;
  446.     if (newcol > curgoal)
  447.       break;
  448.  
  449.     col = newcol;
  450.     ++dbo;
  451.     }
  452.  
  453.     return (dbo);
  454. }
  455.  
  456. /*
  457.  * Scroll forward by a specified number of lines, or by a full page if no
  458.  * argument. Bound to "C-V". The "2" in the arithmetic on the window size is
  459.  * the overlap; this value is the default overlap value in ITS EMACS. Because
  460.  * this zaps the top line in the display window, we have to do a hard update.
  461.  */
  462. forwpage(f, n)
  463. int             f;
  464. register int    n;
  465. {
  466.     register LINE   *lp;
  467.     register int    nl;
  468.  
  469.     if (f == FALSE) {
  470.     n = curwp->w_ntrows - 2;        /* Default scroll.      */
  471.     if (n <= 0)                     /* Forget the overlap   */
  472.       n = 1;                  /* if tiny window.      */
  473.     } else if (n < 0)
  474.       return (backpage(f, -n));
  475. #if     CVMVAS
  476.     else                                    /* Convert from pages   */
  477.       n *= curwp->w_ntrows;           /* to lines.            */
  478. #endif
  479.     nl = n;
  480.     lp = curwp->w_linep;
  481.     while (n-- && lp!=curbp->b_linep)
  482.       lp = lforw(lp);
  483.  
  484.     curwp->w_dotp  = lp;
  485.     curwp->w_doto  = 0;
  486.     curwp->w_flag |= WFHARD;
  487.     if(lp == curbp->b_linep)
  488.       return(TRUE);
  489.     else
  490.       curwp->w_linep = lp;
  491.  
  492.     /*
  493.      * if the header is open, close it ...
  494.      */
  495.     if(Pmaster && ComposerTopLine != COMPOSER_TOP_LINE){
  496.     n -= ComposerTopLine - COMPOSER_TOP_LINE;
  497.     ToggleHeader(0);
  498.     }
  499.  
  500.     /*
  501.      * scroll down from the top the same number of lines we've moved 
  502.      * forward
  503.      */
  504.     if(optimize)
  505.       scrollup(curwp, -1, nl-n-1);
  506. #ifdef HEBREW
  507.     if(compose_heb && (hebmain!=curwp->w_dotp->l_type))ltoggle();
  508. #endif
  509.  
  510.     return (TRUE);
  511. }
  512.  
  513.  
  514. /*
  515.  * This command is like "forwpage", but it goes backwards. The "2", like
  516.  * above, is the overlap between the two windows. The value is from the ITS
  517.  * EMACS manual. Bound to "M-V". We do a hard update for exactly the same
  518.  * reason.
  519.  */
  520. backpage(f, n)
  521. int             f;
  522. register int    n;
  523. {
  524.     register LINE   *lp;
  525.     register int    nl;
  526.  
  527.     if (f == FALSE) {
  528.     n = curwp->w_ntrows - 2;        /* Default scroll.      */
  529.     if (n <= 0)                     /* Don't blow up if the */
  530.       n = 1;                  /* window is tiny.      */
  531.     } else if (n < 0)
  532.       return (forwpage(f, -n));
  533. #if     CVMVAS
  534.     else                                    /* Convert from pages   */
  535.       n *= curwp->w_ntrows;           /* to lines.            */
  536. #endif
  537.     nl = n;
  538.     lp = curwp->w_linep;
  539.     while (n-- && lback(lp)!=curbp->b_linep)
  540.       lp = lback(lp);
  541.  
  542.     curwp->w_linep = lp;
  543.     curwp->w_dotp  = lp;
  544.     curwp->w_doto  = 0;
  545.     curwp->w_flag |= WFHARD;
  546.  
  547.     /*
  548.      * scroll down from the top the same number of lines we've moved 
  549.      * forward
  550.      *
  551.      * This isn't too cool, but it has to be this way so we can 
  552.      * gracefully scroll in the message header
  553.      */
  554.     if(Pmaster){
  555.     if((lback(lp)==curbp->b_linep) && (ComposerTopLine==COMPOSER_TOP_LINE))
  556.       n -= entry_line(LASTHDR, TRUE);
  557.     if(nl-n-1 < curwp->w_ntrows)
  558.       if(optimize)
  559.         scrolldown(curwp, -1, nl-n-1);
  560.     }
  561.     else
  562.       if(optimize)
  563.     scrolldown(curwp, -1, nl-n-1);
  564.  
  565.     if(Pmaster){
  566.     /*
  567.      * if we're at the top of the page, and the header is closed, 
  568.      * open it ...
  569.      */
  570.     if((lback(lp) == curbp->b_linep) 
  571.        && (ComposerTopLine == COMPOSER_TOP_LINE)){
  572.         ToggleHeader(1);
  573.         movecursor(ComposerTopLine, 0);
  574.     }
  575.     }
  576. #ifdef HEBREW
  577.     if(compose_heb && (hebmain!=curwp->w_dotp->l_type))ltoggle();
  578. #endif
  579.  
  580.     return (TRUE);
  581. }
  582.  
  583.  
  584. /*
  585.  * Set the mark in the current window to the value of "." in the window. No
  586.  * errors are possible. Bound to "M-.".  If told to set an already set mark
  587.  * unset it.
  588.  */
  589. setmark(f, n)
  590. int f, n;
  591. {
  592.     if(!curwp->w_markp){
  593.         curwp->w_markp = curwp->w_dotp;
  594.         curwp->w_marko = curwp->w_doto;
  595.     emlwrite("Mark Set", NULL);
  596.     }
  597.     else{
  598.     /* clear inverse chars between here and dot */
  599.     markregion(0);
  600.     curwp->w_markp = NULL;
  601.     emlwrite("Mark UNset", NULL);
  602.     }
  603.  
  604.     return (TRUE);
  605. }
  606.  
  607.  
  608. /*
  609.  * Swap the values of "." and "mark" in the current window. This is pretty
  610.  * easy, bacause all of the hard work gets done by the standard routine
  611.  * that moves the mark about. The only possible error is "no mark". Bound to
  612.  * "C-X C-X".
  613.  */
  614. swapmark(f, n)
  615. int f, n;
  616. {
  617.     register LINE   *odotp;
  618.     register int    odoto;
  619.  
  620.     if (curwp->w_markp == NULL) {
  621.     if(Pmaster == NULL)
  622.       mlwrite("No mark in this window");
  623.     return (FALSE);
  624.     }
  625.  
  626.     odotp = curwp->w_dotp;
  627.     odoto = curwp->w_doto;
  628.     curwp->w_dotp  = curwp->w_markp;
  629.     curwp->w_doto  = curwp->w_marko;
  630.     curwp->w_markp = odotp;
  631.     curwp->w_marko = odoto;
  632.     curwp->w_flag |= WFMOVE;
  633.     return (TRUE);
  634. }
  635.  
  636.  
  637. /*
  638.  * Set the mark in the current window to the value of "." in the window. No
  639.  * errors are possible. Bound to "M-.".  If told to set an already set mark
  640.  * unset it.
  641.  */
  642. setimark(f, n)
  643. int f, n;
  644. {
  645.     curwp->w_imarkp = curwp->w_dotp;
  646.     curwp->w_imarko = curwp->w_doto;
  647.     return(TRUE);
  648. }
  649.  
  650.  
  651. /*
  652.  * Swap the values of "." and "mark" in the current window. This is pretty
  653.  * easy, bacause all of the hard work gets done by the standard routine
  654.  * that moves the mark about. The only possible error is "no mark". Bound to
  655.  * "C-X C-X".
  656.  */
  657. swapimark(f, n)
  658. int f, n;
  659. {
  660.     register LINE   *odotp;
  661.     register int    odoto;
  662.  
  663.     if (curwp->w_imarkp == NULL) {
  664.     if(Pmaster == NULL)
  665.       emlwrite("Programmer botch! No mark in this window");
  666.     return (FALSE);
  667.     }
  668.  
  669.     odotp = curwp->w_dotp;
  670.     odoto = curwp->w_doto;
  671.     curwp->w_dotp  = curwp->w_imarkp;
  672.     curwp->w_doto  = curwp->w_imarko;
  673.     curwp->w_imarkp = odotp;
  674.     curwp->w_imarko = odoto;
  675.     curwp->w_flag |= WFMOVE;
  676.     return (TRUE);
  677. }
  678.