Function: logview--iterate-filter-buffer-lines
logview--iterate-filter-buffer-lines is a natively compiled function
defined in logview.el.
Signature
(logview--iterate-filter-buffer-lines CALLBACK)
Documentation
Find successive filter specification in the current buffer.
Buffer must be positioned at the start of a line. Iteration continues until CALLBACK returns nil or end of buffer is reached.
CALLBACK is called with four arguments: TYPE, LINE-BEGIN, BEGIN,
and END. TYPE may be a string: "a+", "a-", "t+", "t-", "m+",
"m-", "lv" or "LV" for valid filter types, "#" for comment line
and "" for an empty line, or nil to indicate an erroneous line.
BEGIN and END determine filter text boundaries (may span several
lines for message filters. LINE-BEGIN is the beginnig of the
line where the entry starts; in case of filters this is a few
characters before BEGIN. Point is positioned at the start of
next line, which is usually one line beyond END.
Source Code
;; Defined in /nix/store/3zkn9hgpv447zb8nrg55d9x2ynmmrk40-emacs-packages-deps/share/emacs/site-lisp/elpa/logview-20260218.2013/logview.el
(defun logview--iterate-filter-buffer-lines (callback)
"Find successive filter specification in the current buffer.
Buffer must be positioned at the start of a line. Iteration
continues until CALLBACK returns nil or end of buffer is reached.
CALLBACK is called with four arguments: TYPE, LINE-BEGIN, BEGIN,
and END. TYPE may be a string: \"a+\", \"a-\", \"t+\", \"t-\", \"m+\",
\"m-\", \"lv\" or \"LV\" for valid filter types, \"#\" for comment line
and \"\" for an empty line, or nil to indicate an erroneous line.
BEGIN and END determine filter text boundaries (may span several
lines for message filters. LINE-BEGIN is the beginnig of the
line where the entry starts; in case of filters this is a few
characters before BEGIN. Point is positioned at the start of
next line, which is usually one line beyond END."
(let ((case-fold-search nil)
line-begin
begin
type)
(while (and (not (eobp))
(progn
(setq line-begin (point)
begin line-begin
type (when (looking-at "\\(lv\\|LV\\|[atm][-+]\\) \\|\\s-*\\(#\\)\\|\\s-*$")
(if (match-beginning 1)
(progn (setq begin (match-end 0))
(match-string 1))
(or (match-string 2) ""))))
(forward-line)
(when (member type '("m+" "m-"))
(while (looking-at "\\.\\. ")
(forward-line)))
(funcall callback type line-begin begin (if (bolp) (logview--character-back-checked (point)) (point))))))))