adjust_window_count (w, 1);
}
-/* Build a frequently used 4-integer (X Y W H) list. */
-
-static Lisp_Object
-list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h)
-{
- return list4 (make_number (x), make_number (y),
- make_number (w), make_number (h));
-}
-
DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0,
doc: /* Return t if OBJECT is a window and nil otherwise. */)
(Lisp_Object object)
struct window *w, *r, *s;
struct frame *f;
Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta;
- ptrdiff_t startpos IF_LINT (= 0);
+ ptrdiff_t startpos IF_LINT (= 0), startbyte IF_LINT (= 0);
int top IF_LINT (= 0), new_top, resize_failed;
w = decode_valid_window (window);
if (!NILP (w->buffer))
{
startpos = marker_position (w->start);
+ startbyte = marker_byte_position (w->start);
top = WINDOW_TOP_EDGE_LINE (w)
- FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w)));
/* Make sure WINDOW is the frame's selected window. */
Fset_buffer (w->buffer);
/* This computation used to temporarily move point, but that
can have unwanted side effects due to text properties. */
- pos = *vmotion (startpos, -top, w);
+ pos = *vmotion (startpos, startbyte, -top, w);
set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos);
w->window_end_valid = 0;
register Lisp_Object tem;
int lose;
Lisp_Object bolp;
- ptrdiff_t startpos;
+ ptrdiff_t startpos = marker_position (w->start);
+ ptrdiff_t startbyte = marker_byte_position (w->start);
Lisp_Object original_pos = Qnil;
/* If scrolling screen-fulls, compute the number of lines to
if (whole)
n *= max (1, ht - next_screen_context_lines);
- startpos = marker_position (w->start);
-
if (!NILP (Vscroll_preserve_screen_position))
{
if (window_scroll_preserve_vpos <= 0
|| NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command)))
{
struct position posit
- = *compute_motion (startpos, 0, 0, 0,
- PT, ht, 0,
- -1, w->hscroll,
- 0, w);
+ = *compute_motion (startpos, startbyte, 0, 0, 0,
+ PT, ht, 0, -1, w->hscroll, 0, w);
window_scroll_preserve_vpos = posit.vpos;
window_scroll_preserve_hpos = posit.hpos + w->hscroll;
}
{
Fvertical_motion (make_number (- (ht / 2)), window);
startpos = PT;
+ startbyte = PT_BYTE;
}
- SET_PT (startpos);
+ SET_PT_BOTH (startpos, startbyte);
lose = n < 0 && PT == BEGV;
Fvertical_motion (make_number (n), window);
pos = PT;
DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P",
doc: /* Center point in selected window and maybe redisplay frame.
-With prefix argument ARG, recenter putting point on screen line ARG
+With a numeric prefix argument ARG, recenter putting point on screen line ARG
relative to the selected window. If ARG is negative, it counts up from the
bottom of the window. (ARG should be less than the height of the window.)
iarg = max (iarg, this_scroll_margin);
- pos = *vmotion (PT, -iarg, w);
+ pos = *vmotion (PT, PT_BYTE, -iarg, w);
charpos = pos.bufpos;
bytepos = pos.bytepos;
}
iarg = clip_to_bounds (this_scroll_margin, iarg,
ht - this_scroll_margin - 1);
- pos = *vmotion (PT, - iarg, w);
+ pos = *vmotion (PT, PT_BYTE, - iarg, w);
charpos = pos.bufpos;
bytepos = pos.bytepos;
}