]> git.eshelyaron.com Git - emacs.git/commitdiff
* simple.el (beginning-of-visual-line): Constrain to field
authorChong Yidong <cyd@stupidchicken.com>
Sun, 6 Dec 2009 18:48:48 +0000 (18:48 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 6 Dec 2009 18:48:48 +0000 (18:48 +0000)
boundaries (Bug#5106).

lisp/ChangeLog
lisp/simple.el

index 57d5b213bb914e5ad433275ad4861b172e36ba4c..c8b11dd1deb528dfeb8dd9dbc2105b6d0a3de5cf 100644 (file)
@@ -1,3 +1,8 @@
+2009-12-06  Chong Yidong  <cyd@stupidchicken.com>
+
+       * simple.el (beginning-of-visual-line): Constrain to field
+       boundaries (Bug#5106).
+
 2009-12-06  Ulf Jasper  <ulf.jasper@web.de>
 
        * xml.el (xml-substitute-numeric-entities): Moved
index 65086dbfdfc6afda4c66139ac1275e2757ff06fa..d1656b64919fe290219171d1c29e09380361e82f 100644 (file)
@@ -4576,6 +4576,8 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
   (if (/= n 1)
       (let ((line-move-visual t))
        (line-move (1- n) t)))
+  ;; Unlike `move-beginning-of-line', `move-end-of-line' doesn't
+  ;; constrain to field boundaries, so we don't either.
   (vertical-motion (cons (window-width) 0)))
 
 (defun beginning-of-visual-line (&optional n)
@@ -4585,10 +4587,13 @@ If point reaches the beginning or end of buffer, it stops there.
 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
   (interactive "^p")
   (or n (setq n 1))
-  (if (/= n 1)
-      (let ((line-move-visual t))
-       (line-move (1- n) t)))
-  (vertical-motion 0))
+  (let ((opoint (point)))
+    (if (/= n 1)
+       (let ((line-move-visual t))
+         (line-move (1- n) t)))
+    (vertical-motion 0)
+    ;; Constrain to field boundaries, like `move-beginning-of-line'.
+    (goto-char (constrain-to-field (point) opoint (/= n 1)))))
 
 (defun kill-visual-line (&optional arg)
   "Kill the rest of the visual line.