Function: log-view-current-entry

log-view-current-entry is a byte-compiled function defined in log-view.el.gz.

Signature

(log-view-current-entry &optional POS MOVE)

Documentation

Return the position and revision tag of the Log View entry at POS.

This is a list (BEG TAG), where BEG is a buffer position and TAG is a string. If POS is nil or omitted, it defaults to point. If there is no entry at POS, return nil.

If optional arg MOVE is non-nil, move point to BEG if found. Otherwise, don't move point.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/log-view.el.gz
(defun log-view-current-entry (&optional pos move)
  "Return the position and revision tag of the Log View entry at POS.
This is a list (BEG TAG), where BEG is a buffer position and TAG
is a string.  If POS is nil or omitted, it defaults to point.
If there is no entry at POS, return nil.

If optional arg MOVE is non-nil, move point to BEG if found.
Otherwise, don't move point."
  (let ((looping t)
	result)
    (save-excursion
      (when pos (goto-char pos))
      (forward-line 0)
      ;; Treat "---" separator lines as part of the following revision.
      (forward-line (if (looking-at "-\\{20,\\}$") 2 1))
      (while looping
	(setq pos (re-search-backward log-view-message-re nil 'move)
	      looping (and pos (log-view-inside-comment-p (point)))))
      (when pos
	(setq result
	      (list pos (match-string-no-properties 1)))))
    (and move result (goto-char pos))
    result))