Function: org-id-open

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

Signature

(org-id-open ID _)

Documentation

Go to the entry with id ID.

Aliases

org-roam-id-open

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-id.el.gz
(defun org-id-open (id _)
  "Go to the entry with id ID."
  (org-mark-ring-push)
  (let ((m (org-id-find id 'marker))
	cmd)
    (unless m
      (error "Cannot find entry with ID \"%s\"" id))
    ;; Use a buffer-switching command in analogy to finding files
    (setq cmd
	  (or
	   (cdr
	    (assq
	     (cdr (assq 'file org-link-frame-setup))
	     '((find-file . switch-to-buffer)
	       (find-file-other-window . switch-to-buffer-other-window)
	       (find-file-other-frame . switch-to-buffer-other-frame))))
	   'switch-to-buffer-other-window))
    (if (not (equal (current-buffer) (marker-buffer m)))
	(funcall cmd (marker-buffer m)))
    (goto-char m)
    (move-marker m nil)
    (org-fold-show-context)))