/[emacs]/emacs/src/window.c
ViewVC logotype

Diff of /emacs/src/window.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.480 by rms, Sat Oct 16 14:51:39 2004 UTC revision 1.481 by rms, Tue Nov 2 09:06:06 2004 UTC
# Line 4625  window_scroll_pixel_based (window, n, wh Line 4625  window_scroll_pixel_based (window, n, wh
4625        w->force_start = Qt;        w->force_start = Qt;
4626      }      }
4627    
4628      /* The rest of this function uses current_y in a nonstandard way,
4629         not including the height of the header line if any.  */
4630    it.current_y = it.vpos = 0;    it.current_y = it.vpos = 0;
4631    
4632    /* Preserve the screen position if we must.  */    /* Preserve the screen position if we should.  */
4633    if (preserve_y >= 0)    if (preserve_y >= 0)
4634      {      {
4635          /* If we have a header line, take account of it.  */
4636          if (WINDOW_WANTS_HEADER_LINE_P (w))
4637            preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w);
4638    
4639        move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);        move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);
4640        SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));        SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
4641      }      }
4642    else    else
4643      {      {
4644        /* Move PT out of scroll margins.  */        /* Move PT out of scroll margins.
4645             This code wants current_y to be zero at the window start position
4646             even if there is a header line.  */
4647        this_scroll_margin = max (0, scroll_margin);        this_scroll_margin = max (0, scroll_margin);
4648        this_scroll_margin = min (this_scroll_margin, XFASTINT (w->total_lines) / 4);        this_scroll_margin = min (this_scroll_margin, XFASTINT (w->total_lines) / 4);
4649        this_scroll_margin *= FRAME_LINE_HEIGHT (it.f);        this_scroll_margin *= FRAME_LINE_HEIGHT (it.f);
# Line 4990  specifies the window to scroll.  This ta Line 4998  specifies the window to scroll.  This ta
4998    return Qnil;    return Qnil;
4999  }  }
5000    
5001  DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 0, 1, "P",  DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 0, 2, "P\np",
5002         doc: /* Scroll selected window display ARG columns left.         doc: /* Scroll selected window display ARG columns left.
5003  Default for ARG is window width minus 2.  Default for ARG is window width minus 2.
5004  Value is the total amount of leftward horizontal scrolling in  Value is the total amount of leftward horizontal scrolling in
5005  effect after the change.  effect after the change.
5006  If `automatic-hscrolling' is non-nil, the argument ARG modifies  If SET_MINIMUM is non-nil, the new scroll amount becomes the
5007  a lower bound for automatic scrolling, i.e. automatic scrolling  lower bound for automatic scrolling, i.e. automatic scrolling
5008  will not scroll a window to a column less than the value returned  will not scroll a window to a column less than the value returned
5009  by this function.  */)  by this function.  This happens in an interactive call.  */)
5010       (arg)       (arg, set_minimum)
5011       register Lisp_Object arg;       register Lisp_Object arg, set_minimum;
5012  {  {
5013    Lisp_Object result;    Lisp_Object result;
5014    int hscroll;    int hscroll;
# Line 5014  by this function.  */) Line 5022  by this function.  */)
5022    hscroll = XINT (w->hscroll) + XINT (arg);    hscroll = XINT (w->hscroll) + XINT (arg);
5023    result = Fset_window_hscroll (selected_window, make_number (hscroll));    result = Fset_window_hscroll (selected_window, make_number (hscroll));
5024    
5025    if (interactive_p (0))    if (!NILP (set_minimum))
5026      w->min_hscroll = w->hscroll;      w->min_hscroll = w->hscroll;
5027    
5028    return result;    return result;
5029  }  }
5030    
5031  DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 0, 1, "P",  DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 0, 2, "P\np",
5032         doc: /* Scroll selected window display ARG columns right.         doc: /* Scroll selected window display ARG columns right.
5033  Default for ARG is window width minus 2.  Default for ARG is window width minus 2.
5034  Value is the total amount of leftward horizontal scrolling in  Value is the total amount of leftward horizontal scrolling in
5035  effect after the change.  effect after the change.
5036  If `automatic-hscrolling' is non-nil, the argument ARG modifies  If SET_MINIMUM is non-nil, the new scroll amount becomes the
5037  a lower bound for automatic scrolling, i.e. automatic scrolling  lower bound for automatic scrolling, i.e. automatic scrolling
5038  will not scroll a window to a column less than the value returned  will not scroll a window to a column less than the value returned
5039  by this function.  */)  by this function.  This happens in an interactive call.  */)
5040       (arg)       (arg, set_minimum)
5041       register Lisp_Object arg;       register Lisp_Object arg;
5042  {  {
5043    Lisp_Object result;    Lisp_Object result;
# Line 5044  by this function.  */) Line 5052  by this function.  */)
5052    hscroll = XINT (w->hscroll) - XINT (arg);    hscroll = XINT (w->hscroll) - XINT (arg);
5053    result = Fset_window_hscroll (selected_window, make_number (hscroll));    result = Fset_window_hscroll (selected_window, make_number (hscroll));
5054    
5055    if (interactive_p (0))    if (!NILP (set_minimum))
5056      w->min_hscroll = w->hscroll;      w->min_hscroll = w->hscroll;
5057    
5058    return result;    return result;

Legend:
Removed from v.1.480  
changed lines
  Added in v.1.481

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26