Function: hyrolo-yank

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

Signature

(hyrolo-yank NAME &optional REGEXP-FLAG EXCLUDE-SUB-ENTRIES)

Documentation

Insert at point the first HyRolo entry with a headline containing NAME.

If the consult package is installed, interactively select and complete the entry to be inserted.

With optional REGEXP-FLAG (any prefix arg other than C-u, the univeral-argument), treat NAME as a regular expression instead of a string.

With optional EXCLUDE-SUB-ENTRIES non-nil, exclude all sub-entry records below the yanked one (default when called interactively).

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20261030.2317/hyrolo.el
;;;###autoload
(defun hyrolo-yank (name &optional regexp-flag exclude-sub-entries)
  "Insert at point the first HyRolo entry with a headline containing NAME.
If the `consult' package is installed, interactively select and complete
the entry to be inserted.

With optional REGEXP-FLAG (any prefix arg other than C-u, the
`univeral-argument'), treat NAME as a regular expression instead of a
string.

With optional EXCLUDE-SUB-ENTRIES non-nil, exclude all sub-entry records
below the yanked one (default when called interactively)."
  (interactive
   ;; Exclude-sub-entries if no prefix arg or any prefix arg
   ;; other than the universal argument
   (let ((exclude-sub-entries (or (null current-prefix-arg) (not (equal '(4) current-prefix-arg)))))
     (list (hsys-consult-grep-headlines-read-regexp
            #'hyrolo-consult-grep
            (format "Yank HyRolo %s matching regexp"
                    (if exclude-sub-entries "entry" "tree")))
           ;; Enable `regexp-flag' if any prefix arg other the universal argument
           (and current-prefix-arg (not (equal '(4) current-prefix-arg)))
           exclude-sub-entries)))
  (push-mark)
  (let ((entry (hyrolo-get-entry name regexp-flag exclude-sub-entries)))
    (when entry
      (insert entry)
      ;; Let user reformat the region just yanked.
      (funcall hyrolo-yank-reformat-function (mark) (point))
      (exchange-point-and-mark))))