Browse Source

* lisp/org-element.el (org-element--cache-active-p): Fix compiler warning

Using `defsubst' here is impractical because some code above does call
`org-element--cache-active-p'.  Moving would trigger major refactoring
for little gain.  Hence, move back to using simple `defun' until we
modularize lisp/org-element.el better.

Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
Link: https://orgmode.org/list/874jws2v87.fsf@gmail.com
Ihor Radchenko 2 years ago
parent
commit
791ea50528
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lisp/org-element.el

+ 6 - 1
lisp/org-element.el

@@ -5679,7 +5679,12 @@ This function assumes `org-element--headline-cache' is a valid AVL tree."
 
 ;;;; Tools
 
-(defsubst org-element--cache-active-p (&optional called-from-cache-change-func-p)
+;; FIXME: Ideally, this should be inlined to avoid overheads, but
+;; inlined functions should be declared before the code that uses them
+;; and some code above does use `org-element--cache-active-p'.  Moving this
+;; declaration on top would require restructuring the whole cache
+;; section.
+(defun org-element--cache-active-p (&optional called-from-cache-change-func-p)
   "Non-nil when cache is active in current buffer."
   (and org-element-use-cache
        org-element--cache