]> git.eshelyaron.com Git - emacs.git/commitdiff
(line-move-1): If we did not move as far as desired, ensure that
authorChong Yidong <cyd@stupidchicken.com>
Tue, 3 Jun 2008 22:56:56 +0000 (22:56 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Tue, 3 Jun 2008 22:56:56 +0000 (22:56 +0000)
point-left and point-entered hooks are called.

lisp/simple.el

index 118bb715ec89b2b5a71ac8dd8c10f1b124a02411..8367ae9ba108dadbd58a690282c810474be7cff1 100644 (file)
@@ -4059,13 +4059,20 @@ Outline mode sets this."
          (= arg 0))
 
       (cond ((> arg 0)
-            ;; If we did not move down as far as desired,
-            ;; at least go to end of line.
-            (end-of-line))
+            ;; If we did not move down as far as desired, at least go
+            ;; to end of line.  Be sure to call point-entered and
+            ;; point-left-hooks.
+            (let* ((npoint (prog1 (line-end-position)
+                             (goto-char opoint)))
+                   (inhibit-point-motion-hooks nil))
+              (goto-char npoint)))
            ((< arg 0)
             ;; If we did not move up as far as desired,
             ;; at least go to beginning of line.
-            (beginning-of-line))
+            (let* ((npoint (prog1 (line-beginning-position)
+                             (goto-char opoint)))
+                   (inhibit-point-motion-hooks nil))
+              (goto-char npoint)))
            (t
             (line-move-finish (or goal-column temporary-goal-column)
                               opoint (> orig-arg 0)))))))