(Frecenter): Don't trigger point-motion hooks.
authorKarl Heuer <kwzh@gnu.org>
Mon, 3 Oct 1994 00:25:59 +0000 (00:25 +0000)
committerKarl Heuer <kwzh@gnu.org>
Mon, 3 Oct 1994 00:25:59 +0000 (00:25 +0000)
src/window.c

index b34f8a8..bad4815 100644 (file)
@@ -2629,7 +2629,7 @@ redraws with point in the center of the current window.")
 {
   register struct window *w = XWINDOW (selected_window);
   register int ht = window_internal_height (w);
-  register int opoint = PT;
+  struct position pos;
   Lisp_Object window;
 
   if (NILP (n))
@@ -2652,14 +2652,14 @@ redraws with point in the center of the current window.")
   if (XINT (n) < 0)
     XSETINT (n, XINT (n) + ht);
 
-  XSETINT (n, - XINT (n));
-
   XSET (window, Lisp_Window, w);
-  Fvertical_motion (n, window);
-  Fset_marker (w->start, make_number (PT), w->buffer);
-  w->start_at_line_beg = Fbolp ();
+  pos = *vmotion (point, - XINT (n), window_internal_width (w) - 1,
+                 XINT (w->hscroll), window);
 
-  SET_PT (opoint);
+  Fset_marker (w->start, make_number (pos.bufpos), w->buffer);
+  w->start_at_line_beg = ((pos.bufpos == BEGV
+                          || FETCH_CHAR (pos.bufpos - 1) == '\n')
+                         ? Qt : Qnil);
   w->force_start = Qt;
 
   return Qnil;