Function: hywiki-add-org-id

hywiki-add-org-id is an interactive and byte-compiled function defined in hywiki.el.

Signature

(hywiki-add-org-id WIKIWORD)

Documentation

Make WIKIWORD display an Org file or headline with an Org id.

Point must be within the entry with with the id. If no id exists, it is created. Return the referent created with the form: '(org-id
. <id-string>).

If WIKIWORD is invalid, trigger an error if called interactively or return nil if not.

After successfully adding the Org id, run hywiki-add-referent-hook.

Use hywiki-get-referent to determine whether WIKIWORD exists prior to calling this function.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260822.1645/hywiki.el
(defun hywiki-add-org-id (wikiword)
  "Make WIKIWORD display an Org file or headline with an Org id.
Point must be within the entry with with the id.  If no id exists, it is
created.  Return the referent created with the form: \\='(org-id
. <id-string>).

If WIKIWORD is invalid, trigger an error if called interactively
or return nil if not.

After successfully adding the Org id, run `hywiki-add-referent-hook'.

Use `hywiki-get-referent' to determine whether WIKIWORD exists prior to
calling this function."
  (interactive (list (or (hywiki-word-at)
			 (hywiki-word-read-new "Add/Edit HyWikiWord: "))))
  (unless (hsys-org-mode-p)
    (user-error "(hywiki-add-org-id): Referent buffer <%s> must be in org-mode, not %s"
		(buffer-name)
		major-mode))
  (let ((org-id (with-suppressed-warnings ((callargs org-id-get))
                  (if (>= (action:param-count #'org-id-get) 4)
		      (org-id-get nil nil nil t)
		    (org-id-get)))))
    (when (and (null org-id) buffer-read-only)
      (user-error "(hywiki-add-org-id): Referent buffer <%s> point has no Org ID and buffer is read-only"
		  (buffer-name)))
    (unless org-id
      (setq org-id (org-id-get-create)))
    (hywiki-add-referent wikiword (cons 'org-id org-id))))