Function: hyrolo-fgrep

hyrolo-fgrep is an autoloaded, interactive and byte-compiled function defined in hyrolo.el.

Signature

(hyrolo-fgrep STRING &optional MAX-MATCHES HYROLO-FILES-OR-BUFS COUNT-ONLY HEADLINE-ONLY NO-DISPLAY)

Documentation

Display rolo entries matching STRING or a logical match expression.

Return count of matches.

To a maximum of optional prefix arg MAX-MATCHES, in file(s) from optional HYROLO-FILES-OR-BUFS or hyrolo-file-list. Default is to find all matching entries. Each entry is displayed with all of its sub-entries. Optional COUNT-ONLY non-nil skips retrieval of matching entries. Optional HEADLINE-ONLY searches only the first line of entries, not the full text. Optional NO-DISPLAY non-nil retrieves entries but does not display them.

Nil value of MAX-MATCHES means find all entries that match, t value means find all matching entries but omit file headers, negative values mean find up to the inverse of that number of matching entries and omit file headers.

Return number of entries matched. See also documentation for the variable hyrolo-file-list and the function hyrolo-fgrep-logical for documentation on the logical sexpression matching.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hyrolo.el
;;;###autoload
(defun hyrolo-fgrep (string &optional max-matches hyrolo-files-or-bufs count-only headline-only no-display)
  "Display rolo entries matching STRING or a logical match expression.
Return count of matches.

To a maximum of optional prefix arg MAX-MATCHES, in file(s) from optional
HYROLO-FILES-OR-BUFS or `hyrolo-file-list'.  Default is to find all matching
entries.  Each entry is displayed with all of its sub-entries.  Optional
COUNT-ONLY non-nil skips retrieval of matching entries.  Optional HEADLINE-ONLY
searches only the first line of entries, not the full text.  Optional
NO-DISPLAY non-nil retrieves entries but does not display them.

Nil value of MAX-MATCHES means find all entries that match, t value means find
all matching entries but omit file headers, negative values mean find up to the
inverse of that number of matching entries and omit file headers.

Return number of entries matched.  See also documentation for the variable
`hyrolo-file-list' and the function `hyrolo-fgrep-logical' for documentation
on the logical sexpression matching."
  (interactive (let ((input-and-matching-files
		      (hyrolo-grep-input #'read-string "Find rolo string")))
		 (list (car input-and-matching-files)
		       current-prefix-arg
		       (mapcar #'expand-file-name
			       (cadr input-and-matching-files)))))
  (setq string (string-trim string "\"" "\""))
  (let ((total-matches 0))
    (if (string-match-p hyrolo-logical-regexp string)
	(progn
	  ;; Search string contains embedded logic operators.
	  ;; First try to match logical sexpression within a single
	  ;; subentry to minimize entries displayed.  If no match,
	  ;; then match across ancestors and descendants.
	  (when (zerop (setq total-matches (hyrolo-fgrep-logical string count-only nil t)))
	    (hyrolo-fgrep-logical string count-only t t)))
      (setq total-matches (hyrolo-grep (regexp-quote string)
				       max-matches hyrolo-files-or-bufs
				       count-only headline-only no-display)))
    (if (called-interactively-p 'interactive)
	(message "%s matching entr%s found in HyRolo."
		 (if (= total-matches 0) "No" total-matches)
		 (if (= total-matches 1) "y" "ies")))
    total-matches))