Function: hyrolo-get-entry

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

Signature

(hyrolo-get-entry NAME &optional REGEXP-FLAG)

Documentation

Return the first rolo entry string with a headline containing NAME.

Return nil if no match is found.

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

With optional prefix arg, REGEXP-FLAG, treat NAME as a regular expression instead of a string.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260822.1645/hyrolo.el
;;;###autoload
(defun hyrolo-get-entry (name &optional regexp-flag)
  "Return the first rolo entry string with a headline containing NAME.
Return nil if no match is found.

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

With optional prefix arg, REGEXP-FLAG, treat NAME as a regular expression
instead of a string."
  (interactive (list
		(hsys-consult-grep-headlines-read-regexp
		 #'hyrolo-consult-grep "Yank rolo headline matching")
		current-prefix-arg))
  (when (and (stringp name) (string-empty-p name))
    (setq name nil))
  (when (or (null name) (not (stringp name)))
    (error "(hyrolo-get-entry): Invalid name: `%s'" name))

  (save-window-excursion
    (with-temp-buffer
      (let ((hyrolo-display-buffer (current-buffer))
	    found)
	(save-excursion
	  (setq found
		(if (and (hsys-consult-active-p)
                         ;; Extract search string from the results of an
                         ;; `hsys-consult' call stored in `name'
			 (string-match "\\([^ \t\n\r\"'`]*[^ \t\n\r:\"'`0-9]\\): ?\\([1-9][0-9]*\\)[ :]"
				       name))
		    (hyrolo-grep-file (match-string-no-properties 1 name)
				      (regexp-quote (substring name (match-end 0)))
				      -1 nil t)
		  (hyrolo-grep (if regexp-flag name (regexp-quote name)) -1 nil nil t))))
        (when found
          (buffer-string))))))