org-element-cache-map: Do not byte-compile FUNC

Byte compilation can unpredictably break agenda searches in some Emacs
builds.

See https://list.orgmode.org/PAXPR08MB6640260AFA03FCDFABE245A3A34F9@PAXPR08MB6640.eurprd08.prod.outlook.com/T/#t
This commit is contained in:
Ihor Radchenko 2022-01-10 22:30:26 +08:00
parent 071c5e4bf1
commit 1f48d2d751
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 0 additions and 30 deletions

View File

@ -7362,36 +7362,6 @@ the cache."
;; returned non-nil).
(last-match t)
continue-flag
;; 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)
(fboundp 'native-comp-available-p)
(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
;; `org-agenda-get-scheduled' call
;; somehow alters the FUNC result in
;; Emacs 26 and 27, but not in Emacs
;; >=28.
(version< emacs-version "29"))
func
(let ((warning-minimum-log-level :error)
(inhibit-message t))
(condition-case nil
(if (and (fboundp 'native-comp-available-p)
(fboundp 'native-compile)
(native-comp-available-p))
;; Use native compilation to even better
;; performance.
(native-compile func)
(byte-compile func))
(error func)))))
;; Generic regexp to search next potential match. If it
;; is a cons of (regexp . 'match-beg), we are 100% sure
;; that the match beginning is the existing element