Function: hsys-org-thing-at-p

hsys-org-thing-at-p is a byte-compiled function defined in hsys-org.el.

Signature

(hsys-org-thing-at-p)

Documentation

Return a plist of properties for Org thing at point or nil if none.

This must work on Org links outside of Org mode.

The plist form is: (:type <type> :value <value> :context <context>). The thing can be a link, citation, timestamp, footnote, src-block or tags.

On top of syntactically correct links, this function also works on links and timestamps in comments, node properties, and keywords if point is on something looking like a timestamp or a link.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hsys-org.el
;; Derived from `org-open-at-point' in "org.el".
(defun hsys-org-thing-at-p ()
  "Return a plist of properties for Org thing at point or nil if none.
This must work on Org links outside of Org mode.

The plist form is: (:type <type> :value <value> :context <context>).
The thing can be a link, citation, timestamp, footnote, src-block or
tags.

On top of syntactically correct links, this function also works
on links and timestamps in comments, node properties, and
keywords if point is on something looking like a timestamp or a
link."
  (ignore-errors
    (org-load-modules-maybe)
    ;; Org regex matching can fail in non-thing contexts, so we ignore
    ;; these errors and return nil then.  Org-element will also warn to
    ;; not use it outside of Org mode although it works, so we suppress
    ;; those warnings as well.
    (let* ((warning-minimum-level :error)
	   (warning-suppress-types '(org-element rx))
	   (warning-suppress-log-types '(org-element rx))
	   (context
	    ;; Only consider supported types, even if they are not the
	    ;; closest one.
	    (org-element-lineage
	     (org-element-context)
	     '(citation citation-reference clock comment comment-block
			footnote-definition footnote-reference headline
			inline-src-block inlinetask keyword link node-property
			planning src-block timestamp)
	     t))
	   (type (org-element-type context))
	   (value (org-element-property :value context)))
      (when type
	(list :type type :value value :context context)))))