Function: hyrolo-add-match

hyrolo-add-match is a byte-compiled function defined in hyrolo.el.

Signature

(hyrolo-add-match REGEXP START END HEADLINE-ONLY)

Documentation

Add a REGEXP match entry from START to END in curr buffer to display buffer.

Then highlight the matches within the entry. Point moves to the end of the inserted entry in the match display buffer, hyrolo-display-buffer.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hyrolo.el
;;; ************************************************************************
;;; Private functions
;;; ************************************************************************

(defun hyrolo-add-match (regexp start end headline-only)
  "Add a REGEXP match entry from START to END in curr buffer to display buffer.
Then highlight the matches within the entry.  Point moves to the end of the
inserted entry in the match display buffer, `hyrolo-display-buffer'."
  (let* ((display-buf (get-buffer-create hyrolo-display-buffer))
	 (start-point (with-current-buffer display-buf (point)))
         end-point)
    (insert-into-buffer display-buf start end)
    (with-current-buffer display-buf
      (setq end-point (point))
      (funcall hyrolo-display-format-function start-point (point))
      (save-excursion
        (goto-char start-point)
        ;; If entries have starting level delimiters, add the :hyrolo-level
        ;; text property to each level delimiter char; do this for all
        ;; sub-levels in the entry as well.  If an entry does not have a
        ;; starting delimiter, then it must be a single line entry; add the
        ;; text property to the first character of the line in this case.
        (if (looking-at hyrolo-hdr-regexp)
            (add-text-properties (point) (1+ (point)) '(:hyrolo-level t))
          (while (re-search-forward hyrolo-entry-regexp end-point t)
            (add-text-properties (match-beginning hyrolo-entry-group-number)
                                 (match-end hyrolo-entry-group-number)
                                 '(:hyrolo-level t)))))
      (unless (hyperb:stack-frame '(hyrolo-yank))
        (hyrolo-highlight-matches regexp start-point
				  (if headline-only
				      (save-excursion (goto-char start-point)
                                                      (line-end-position))
				    (point)))))))