changeset 70619:f5917c21d187

* intervals.c (set_point_both): Fix mixup before before and after in variable names. * editfns.c (Fline_beginning_position): Inhibit point-motion hooks while setting point temporarily.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 12 May 2006 17:39:39 +0000
parents 29e84c94807d
children b23be18ae943
files src/ChangeLog src/editfns.c src/intervals.c
diffstat 3 files changed, 32 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri May 12 16:18:37 2006 +0000
+++ b/src/ChangeLog	Fri May 12 17:39:39 2006 +0000
@@ -1,3 +1,11 @@
+2006-05-12  Chong Yidong  <cyd@stupidchicken.com>
+
+	* intervals.c (set_point_both): Fix mixup before before and after
+	in variable names.
+
+	* editfns.c (Fline_beginning_position): Inhibit point-motion hooks
+	while setting point temporarily.
+
 2006-05-11  Richard Stallman  <rms@gnu.org>
 
 	* lread.c (readevalloop): Abort if START non-nil for non-buffer input.
--- a/src/editfns.c	Fri May 12 16:18:37 2006 +0000
+++ b/src/editfns.c	Fri May 12 17:39:39 2006 +0000
@@ -823,6 +823,8 @@
      Lisp_Object n;
 {
   int orig, orig_byte, end;
+  int count = SPECPDL_INDEX ();
+  specbind (Qinhibit_point_motion_hooks, Qt);
 
   if (NILP (n))
     XSETFASTINT (n, 1);
@@ -836,6 +838,8 @@
 
   SET_PT_BOTH (orig, orig_byte);
 
+  unbind_to (count, Qnil);
+
   /* Return END constrained to the current input field.  */
   return Fconstrain_to_field (make_number (end), make_number (orig),
 			      XINT (n) != 1 ? Qt : Qnil,
--- a/src/intervals.c	Fri May 12 16:18:37 2006 +0000
+++ b/src/intervals.c	Fri May 12 17:39:39 2006 +0000
@@ -2196,36 +2196,38 @@
       Lisp_Object leave_after, leave_before, enter_after, enter_before;
 
       if (fromprev)
-	leave_after = textget (fromprev->plist, Qpoint_left);
+	leave_before = textget (fromprev->plist, Qpoint_left);
+      else
+	leave_before = Qnil;
+
+      if (from)
+	leave_after = textget (from->plist, Qpoint_left);
       else
 	leave_after = Qnil;
-      if (from)
-	leave_before = textget (from->plist, Qpoint_left);
-      else
-	leave_before = Qnil;
 
       if (toprev)
-	enter_after = textget (toprev->plist, Qpoint_entered);
+	enter_before = textget (toprev->plist, Qpoint_entered);
+      else
+	enter_before = Qnil;
+
+      if (to)
+	enter_after = textget (to->plist, Qpoint_entered);
       else
 	enter_after = Qnil;
-      if (to)
-	enter_before = textget (to->plist, Qpoint_entered);
-      else
-	enter_before = Qnil;
 
       if (! EQ (leave_before, enter_before) && !NILP (leave_before))
-	call2 (leave_before, make_number (old_position),
-	       make_number (charpos));
+      	call2 (leave_before, make_number (old_position),
+      	       make_number (charpos));
       if (! EQ (leave_after, enter_after) && !NILP (leave_after))
-	call2 (leave_after, make_number (old_position),
-	       make_number (charpos));
+      	call2 (leave_after, make_number (old_position),
+      	       make_number (charpos));
 
       if (! EQ (enter_before, leave_before) && !NILP (enter_before))
-	call2 (enter_before, make_number (old_position),
-	       make_number (charpos));
+      	call2 (enter_before, make_number (old_position),
+      	       make_number (charpos));
       if (! EQ (enter_after, leave_after) && !NILP (enter_after))
-	call2 (enter_after, make_number (old_position),
-	       make_number (charpos));
+      	call2 (enter_after, make_number (old_position),
+      	       make_number (charpos));
     }
 }