;; We avoid vertical-motion when possible
;; because that has to fontify.
(if (eobp)
- (setq done t)
+ (if (not noerror)
+ (signal 'end-of-buffer nil)
+ (setq done t))
(forward-line 1))
;; Otherwise move a more sophisticated way.
;; (What's the logic behind this code?)
;; it just goes in the other direction.
(while (and (< arg 0) (not done))
(beginning-of-line)
- (if (not (line-move-invisible-p (1- (point))))
+ (if (or (bobp) (not (line-move-invisible-p (1- (point)))))
(if (bobp)
- (setq done t)
+ (if (not noerror)
+ (signal 'beginning-of-buffer nil)
+ (setq done t))
(forward-line -1))
(if (zerop (vertical-motion -1))
(if (not noerror)