Function: org-id-complete

org-id-complete is a byte-compiled function defined in org-id.el.gz.

Signature

(org-id-complete &optional ARG)

Documentation

Complete IDs for org-insert-link.

If a headline without an ID is selected, one will automatically be created.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-id.el.gz
(defun org-id-complete (&optional _arg)
  "Complete IDs for `org-insert-link'.

If a headline without an ID is selected, one will automatically be
created."
  (unless org-id-locations (org-id-locations-load))
  (or (ignore-errors ; Catch the error if we have no refile targets.
        (when-let* ((id (org-id-get-with-outline-path-completion
                         (if (buffer-file-name) org-id-completion-targets
                           ;; If the current buffer isn't associated
                           ;; with a file, we can't include it so we
                           ;; exclude all "targets" where the car is
                           ;; nil.
                           (seq-filter #'car org-id-completion-targets)))))
          (concat "id:" id)))
      (read-string "Link: " "id:")))