- (dotimes (_n (- arg))
- (log-view-end-of-defun))
- (catch 'beginning-of-buffer
- (dotimes (_n arg)
- (or (log-view-current-entry nil t)
- (throw 'beginning-of-buffer nil)))
- (point))))
-
-(defun log-view-end-of-defun ()
+ ;; In log view, the end of one defun is the beginning of the
+ ;; next, so punting to log-view-end-of-defun is safe in this
+ ;; context.
+ (log-view-end-of-defun (- arg))
+ (let ((found t))
+ (while (> arg 0)
+ (setf arg (1- arg))
+ (let ((cur-start (log-view-current-entry)))
+ (setf found
+ (cond ((null cur-start)
+ (goto-char (point-min))
+ nil)
+ ((>= (car cur-start) (point))
+ (unless (bobp)
+ (forward-line -1)
+ (setf arg (1+ arg)))
+ nil)
+ (t
+ (goto-char (car cur-start))
+ t)))))
+ found)))
+
+(defun log-view-end-of-defun-1 ()