diff lisp/simple.el @ 73167:1b3313de1c4c

* simple.el (line-move-finish): Ignore field boundaries if the initial and final points have the same `field' property.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 29 Sep 2006 18:18:42 +0000
parents 4a02fd618570
children 181f8fa16272
line wrap: on
line diff
--- a/lisp/simple.el	Fri Sep 29 12:25:35 2006 +0000
+++ b/lisp/simple.el	Fri Sep 29 18:18:42 2006 +0000
@@ -3735,8 +3735,15 @@
 	(goto-char opoint)
 	(let ((inhibit-point-motion-hooks nil))
 	  (goto-char
-	   (constrain-to-field new opoint t t
-			       'inhibit-line-move-field-capture)))
+	   ;; Ignore field boundaries if the initial and final
+	   ;; positions have the same `field' property, even if the
+	   ;; fields are non-contiguous.  This seems to be "nicer"
+	   ;; behavior in many situations.
+	   (if (eq (get-char-property new 'field)
+	   	   (get-char-property opoint 'field))
+	       new
+	     (constrain-to-field new opoint t t
+				 'inhibit-line-move-field-capture))))
 
 	;; If all this moved us to a different line,
 	;; retry everything within that new line.