diff options
author | Kim F. Storm <storm@cua.dk> | 2005-07-13 13:45:30 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2005-07-13 13:45:30 +0000 |
commit | 3e43ae87c41dd34b2bb883b0e947efaa1fd4cda8 (patch) | |
tree | 2b95e5c274b0a654b0e2516be608b6e74c3bc345 | |
parent | a937cb3957967e735eb7a1caadc781a8fa404a98 (diff) | |
download | emacs-3e43ae87c41dd34b2bb883b0e947efaa1fd4cda8.tar.gz emacs-3e43ae87c41dd34b2bb883b0e947efaa1fd4cda8.tar.bz2 emacs-3e43ae87c41dd34b2bb883b0e947efaa1fd4cda8.zip |
(line-move-1): Undo rest of 2005-06-23 change.
-rw-r--r-- | lisp/simple.el | 66 |
1 files changed, 29 insertions, 37 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 7c6a1e5ccf4..e0622aed690 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3440,49 +3440,41 @@ Outline mode sets this." ;; Now move a line. (end-of-line) ;; If there's no invisibility here, move over the newline. - (let ((pos-before (point)) - line-done) - (if (eobp) - (if (not noerror) - (signal 'end-of-buffer nil) - (setq done t))) - (when (and (not done) - (> arg 1) ;; Use vertical-motion for last move - (not (integerp selective-display)) - (not (line-move-invisible-p (point)))) - ;; We avoid vertical-motion when possible - ;; because that has to fontify. - (forward-line 1) - (setq line-done t)) - (and (not done) (not line-done) - ;; Otherwise move a more sophisticated way. - (zerop (vertical-motion 1)) - (if (not noerror) - (signal 'end-of-buffer nil) - (setq done t)))) + (cond + ((eobp) + (if (not noerror) + (signal 'end-of-buffer nil) + (setq done t))) + ((and (> arg 1) ;; Use vertical-motion for last move + (not (integerp selective-display)) + (not (line-move-invisible-p (point)))) + ;; We avoid vertical-motion when possible + ;; because that has to fontify. + (forward-line 1)) + ;; Otherwise move a more sophisticated way. + ((zerop (vertical-motion 1)) + (if (not noerror) + (signal 'end-of-buffer nil) + (setq done t)))) (unless done (setq arg (1- arg)))) ;; The logic of this is the same as the loop above, ;; it just goes in the other direction. (while (and (< arg 0) (not done)) (beginning-of-line) - (let ((pos-before (point)) - line-done) - (if (bobp) - (if (not noerror) - (signal 'beginning-of-buffer nil) - (setq done t))) - (when (and (not done) - (< arg -1) ;; Use vertical-motion for last move - (not (integerp selective-display)) - (not (line-move-invisible-p (1- (point))))) - (forward-line -1) - (setq line-done t)) - (and (not done) (not line-done) - (zerop (vertical-motion -1)) - (if (not noerror) - (signal 'beginning-of-buffer nil) - (setq done t)))) + (cond + ((bobp) + (if (not noerror) + (signal 'beginning-of-buffer nil) + (setq done t))) + ((and (< arg -1) ;; Use vertical-motion for last move + (not (integerp selective-display)) + (not (line-move-invisible-p (1- (point))))) + (forward-line -1)) + ((zerop (vertical-motion -1)) + (if (not noerror) + (signal 'beginning-of-buffer nil) + (setq done t)))) (unless done (setq arg (1+ arg)) (while (and ;; Don't move over previous invis lines |