Function: denote-link--ol-resolve-link-to-target

denote-link--ol-resolve-link-to-target is a byte-compiled function defined in denote.el.

Signature

(denote-link--ol-resolve-link-to-target LINK &optional FULL-DATA)

Documentation

Resolve LINK to target file, with or without additioanl file-search terms.

With optional FULL-DATA return a list in the form of (path query file-search).

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
(defun denote-link--ol-resolve-link-to-target (link &optional full-data)
  "Resolve LINK to target file, with or without additioanl file-search terms.
With optional FULL-DATA return a list in the form of (path query file-search)."
  (let* ((file-search (and (string-match "::\\(.*\\)\\'" link)
                           (match-string 1 link)))
         (query (if (and file-search (not (string-empty-p file-search)))
                    (substring link 0 (match-beginning 0))
                  link))
         (path (denote-get-path-by-id query)))
    (cond
     (full-data
      (list path query file-search))
     ((and file-search (not (string-empty-p file-search)))
      (concat path "::" file-search))
     (t (or path query)))))