Sfoglia il codice sorgente

org-element-cache-map: Improve compiled function check

* lisp/org-element.el (org-element-cache-map): Do not try to
byte-compile subroutines and natively compiled functions.
Ihor Radchenko 3 anni fa
parent
commit
244bc7d174
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      lisp/org-element.el

+ 6 - 0
lisp/org-element.el

@@ -7102,6 +7102,12 @@ of FUNC.  Changes to elements made in FUNC will also alter the cache."
                  ;; Byte-compile FUNC making sure that it is as performant
                  ;; as it could be.
                  (func (if (or (byte-code-function-p func)
+                               (and (symbolp func)
+                                    (subrp (symbol-function func)))
+                               (and (symbolp func)
+                                    (native-comp-available-p)
+                                    (fboundp 'subr-native-elisp-p)
+                                    (subr-native-elisp-p (symbol-function func)))
                                ;; FIXME: Working around bug
                                ;; https://list.orgmode.org/87tuha62rq.fsf@localhost/T/#t
                                ;; Byte-compilation in