Function: hyrolo-map-kotl
hyrolo-map-kotl is a byte-compiled function defined in
hyrolo-logic.el.
Signature
(hyrolo-map-kotl SEXP HYROLO-BUF DISPLAY-BUF HDR-POS &optional COUNT-ONLY INCLUDE-SUB-ENTRIES)
Documentation
Apply logical SEXP to each entry in HYROLO-BUF.
Write out matching entries to DISPLAY-BUF. HDR-POS is a cons of
(start . end) positions of HYROLO-BUF's file header, if any;
otherwise, nil.
If optional COUNT-ONLY is non-nil, don't display entries, return count of matching entries only. If optional INCLUDE-SUB-ENTRIES flag is non-nil, apply SEXP across all sub-entries at once. Default is to apply SEXP to each entry and sub-entry separately. Entries are displayed with all of their sub-entries unless INCLUDE-SUB-ENTRIES is nil.
SEXP should utilize the free variables start and end as the
region on which to operate.
Return the number of evaluations of SEXP that match entries.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hyrolo-logic.el
(defun hyrolo-map-kotl (sexp hyrolo-buf display-buf hdr-pos &optional count-only include-sub-entries)
"Apply logical SEXP to each entry in HYROLO-BUF.
Write out matching entries to DISPLAY-BUF. HDR-POS is a cons of
\(start . end) positions of HYROLO-BUF's file header, if any;
otherwise, nil.
If optional COUNT-ONLY is non-nil, don't display entries, return
count of matching entries only. If optional INCLUDE-SUB-ENTRIES
flag is non-nil, apply SEXP across all sub-entries at once.
Default is to apply SEXP to each entry and sub-entry separately.
Entries are displayed with all of their sub-entries unless
INCLUDE-SUB-ENTRIES is nil.
SEXP should utilize the free variables `start' and `end' as the
region on which to operate.
Return the number of evaluations of SEXP that match entries."
(let* ((start)
(end)
(end-entry-hdr)
(num-found 0)
result)
(mapc (lambda (cell-ref)
(when (setq result (kotl-mode:goto-cell cell-ref))
(setq end-entry-hdr (point)
start (line-beginning-position)
end (hyrolo-to-entry-end include-sub-entries))
(unless count-only
(and result (= num-found 0)
(let* ((src (or (hypb:buffer-file-name hyrolo-buf)
hyrolo-buf))
(src-line
(format
(concat (if (boundp 'hbut:source-prefix)
hbut:source-prefix
"@loc> ")
"%s")
(prin1-to-string src))))
(set-buffer display-buf)
(goto-char (point-max))
(if hdr-pos
(progn
(insert-buffer-substring
hyrolo-buf (car hdr-pos) (cdr hdr-pos))
(insert src-line "\n\n"))
(insert (format hyrolo-hdr-format src-line)))
(set-buffer hyrolo-buf))))
(if result
(progn (goto-char end)
(setq num-found (1+ num-found))
(unless count-only
(append-to-buffer display-buf start end)
(hyrolo--cache-major-mode (current-buffer))))
(goto-char end-entry-hdr))))
sexp)
num-found))