Function: hyrolo-logic

hyrolo-logic is a byte-compiled function defined in hyrolo-logic.el.

Signature

(hyrolo-logic SEXP &optional IN-BUFS COUNT-ONLY INCLUDE-SUB-ENTRIES NO-SUB-ENTRIES-OUT KOUTLINE-FLAG)

Documentation

Apply SEXP to all entries in optional buffer list, IN-BUFS.

Display entries where SEXP is non-nil. If IN-BUFS is nil, hyrolo-file-list is used. 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 and optional NO-SUB-ENTRIES-OUT flag is non-nil. With optional KOUTLINE-FLAG, map entries with hyrolo-map-kotl rather than hyrolo-map-entries.

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-logic (sexp &optional in-bufs count-only include-sub-entries no-sub-entries-out
			  koutline-flag)
  "Apply SEXP to all entries in optional buffer list, IN-BUFS.
Display entries where SEXP is non-nil.
If IN-BUFS is nil, `hyrolo-file-list' is used.  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 and optional NO-SUB-ENTRIES-OUT flag is non-nil.  With optional
KOUTLINE-FLAG, map entries with `hyrolo-map-kotl' rather than
`hyrolo-map-entries'.

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* ((display-buf (unless count-only
			(prog1 (hyrolo-set-display-buffer)
			  (erase-buffer)
			  (hyrolo--cache-initialize))))
	 ;; Temporarily disable magit-auto-revert-mode-enable-in-buffers for hyrolo
	 ;; buffers; not needed and can slow/hang file loading
	 (after-change-major-mode-hook
	  (remove 'magit-auto-revert-mode-enable-in-buffers after-change-major-mode-hook))
	 (result
	  (mapcar
	   (lambda (buf-or-file)
	     (setq buf-or-file (or (get-buffer buf-or-file)
				   (hyrolo-find-file-noselect buf-or-file)))
	     (hyrolo-map-logic sexp buf-or-file count-only include-sub-entries
			       no-sub-entries-out koutline-flag))
	   (cond ((null in-bufs) (hyrolo-get-file-list))
		 ((listp in-bufs) in-bufs)
		 ((list in-bufs)))))
	 (total-matches (apply '+ result)))
    (unless (or count-only (= total-matches 0))
      (hyrolo--post-display-buffer)
      (hyrolo-display-matches display-buf))
  total-matches))