Skip to content

Commit cc8f487

Browse files
committed
fix(org): update load, declare-function
In Emacs 31, org-element-property and org-element-type have moved to a new file: org-element-ast. Update code to handle this properly. Signed-off-by: Bruce D'Arcus <[email protected]>
1 parent 02e25f3 commit cc8f487

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

citar-org.el

+10-3
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,22 @@
2121

2222
(require 'citar)
2323
(require 'org)
24-
(require 'org-element)
24+
(if (not (require 'org-element-ast nil t))
25+
;; they moved the functions we need to this file
26+
;; if it's not present, fallback to the old one
27+
(require 'org-element))
2528
(require 'org-id)
2629
(require 'oc)
2730
(require 'oc-basic)
2831
(require 'oc-csl)
2932

3033
(declare-function org-open-at-point "org")
31-
(declare-function org-element-property "org-element")
32-
(declare-function org-element-type "org-element")
34+
;; we need to do some special handling to account for the move of these functions to a different file
35+
(declare-function org-element-property "ext:org-element")
36+
(declare-function org-element-type "ext:org-element")
37+
(declare-function org-element-property "ext:org-element-ast")
38+
(declare-function org-element-type "ext:org-element-ast")
39+
3340
(declare-function org-cite-make-insert-processor "oc")
3441
(declare-function org-cite-get-references "oc")
3542
(declare-function embark-act "ext:embark")

0 commit comments

Comments
 (0)