Function: log-view-beginning-of-defun

log-view-beginning-of-defun is a byte-compiled function defined in log-view.el.gz.

Signature

(log-view-beginning-of-defun &optional ARG)

Documentation

Move backward to the beginning of a Log View entry.

With ARG, do it that many times. Negative ARG means move forward to the beginning of the ARGth following entry.

This is Log View mode's default beginning-of-defun-function. It assumes that a log entry starts with a line matching log-view-message-re.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/log-view.el.gz
(defun log-view-beginning-of-defun (&optional arg)
  "Move backward to the beginning of a Log View entry.
With ARG, do it that many times.  Negative ARG means move forward
to the beginning of the ARGth following entry.

This is Log View mode's default `beginning-of-defun-function'.
It assumes that a log entry starts with a line matching
`log-view-message-re'."
  (when (null arg) (setq arg 1))
  (if (minusp arg)
      ;; 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 (plusp arg)
        (decf arg)
        (let ((cur-start (log-view-current-entry)))
          (setq found (cond ((null cur-start)
                             (goto-char (point-min))
                             nil)
                            ((>= (car cur-start) (point))
                             (unless (bobp)
                               (forward-line -1)
                               (incf arg))
                             nil)
                            (t
                             (goto-char (car cur-start))
                             t)))))
      found)))