Function: logview--iterate-entries-forward

logview--iterate-entries-forward is a natively compiled function defined in logview.el.

Signature

(logview--iterate-entries-forward POSITION CALLBACK &optional ONLY-VISIBLE VALIDATOR SKIP-CURRENT)

Documentation

Invoke CALLBACK for successive valid log entries forward.

Iteration starts at the entry around POSITION (or the next, if SKIP-CURRENT is non-nil) and continues forward until CALLBACK returns nil or end of buffer is reached. This function does not alter the point, nor is it affected in any way by CALLBACK or VALIDATOR altering it.

CALLBACK is called with two arguments: value of the logview-entry property and the beginning of the entry.

If ONLY-VISIBLE is non-nil, hidden entries are skipped. If VALIDATOR is non-nil, entries for which the function returns nil are skipped too. VALIDATOR is called with the same parameters as CALLBACK.

Source Code

;; Defined in /nix/store/3zkn9hgpv447zb8nrg55d9x2ynmmrk40-emacs-packages-deps/share/emacs/site-lisp/elpa/logview-20260218.2013/logview.el
(defun logview--iterate-entries-forward (position callback &optional only-visible validator skip-current)
  "Invoke CALLBACK for successive valid log entries forward.

Iteration starts at the entry around POSITION (or the next, if
SKIP-CURRENT is non-nil) and continues forward until CALLBACK
returns nil or end of buffer is reached.  This function does not
alter the point, nor is it affected in any way by CALLBACK or
VALIDATOR altering it.

CALLBACK is called with two arguments: value of the
`logview-entry' property and the beginning of the entry.

If ONLY-VISIBLE is non-nil, hidden entries are skipped.  If
VALIDATOR is non-nil, entries for which the function returns nil
are skipped too.  VALIDATOR is called with the same parameters as
CALLBACK."
  (let ((entry+start (logview--do-locate-current-entry position)))
    (when entry+start
      (let ((entry    (car entry+start))
            (entry-at (cdr entry+start))
            (limit    (if only-visible (logview--point-max) (point-max))))
        (unless (and skip-current (>= (setq entry-at (logview--entry-end entry entry-at)) limit))
          (while (progn (setq entry (or (get-text-property entry-at 'logview-entry)
                                        (progn (logview--find-region-entries entry-at (+ entry-at logview--lazy-region-size))
                                               (get-text-property entry-at 'logview-entry))))
                        (and (or (and only-visible (invisible-p entry-at))
                                 (and validator (not (funcall validator entry entry-at)))
                                 (funcall callback entry entry-at))
                             (< (setq entry-at (logview--entry-end entry entry-at)) limit)))))))))