Function: org-link-open-from-string

org-link-open-from-string is an interactive and byte-compiled function defined in ol.el.gz.

Signature

(org-link-open-from-string S &optional ARG)

Documentation

Open a link in the string S, as if it was in Org mode.

Optional argument is passed to org-open-file when S is a "file" link.

Key Bindings

Aliases

org-open-link-from-string (obsolete since 9.3)

Source Code

;; Defined in /usr/src/emacs/lisp/org/ol.el.gz
(defun org-link-open-from-string (s &optional arg)
  "Open a link in the string S, as if it was in Org mode.
Optional argument is passed to `org-open-file' when S is
a \"file\" link."
  (interactive "sLink: \nP")
  (pcase (with-temp-buffer
	   (let ((org-inhibit-startup nil))
	     (insert s)
	     (org-mode)
	     (goto-char (point-min))
	     (org-element-link-parser)))
    (`nil (user-error "No valid link in %S" s))
    (link (org-link-open link arg))))