org-element.el: Fix regression from d3836c1a1

* lisp/org-element.el: Do not require `backtrace'.  It is not
available in Emacs 26.
(org-element--cache-sync, org-element-at-point): Do not try to show
backtrace in warning when `backtrace' library is not available.

Reported in https://list.orgmode.org/d20a8753-8d0a-b4bf-c3fc-bce2f0a22392@gmail.com/T/#u
This commit is contained in:
Ihor Radchenko 2021-11-09 08:39:20 +08:00
parent d3836c1a13
commit ded97b7672
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 6 additions and 3 deletions

View File

@ -60,7 +60,6 @@
(require 'avl-tree)
(require 'ring)
(require 'backtrace)
(require 'cl-lib)
(require 'ol)
(require 'org)
@ -5844,7 +5843,9 @@ If this warning appears regularly, please report it to Org mode mailing list (M-
The buffer is: %s\n Current command: %S\n Backtrace:\n%S"
(buffer-name (current-buffer))
this-command
(backtrace-to-string (backtrace-get-frames 'backtrace)))
(when (and (fboundp 'backtrace-get-frames)
(fboundp 'backtrace-to-string))
(backtrace-to-string (backtrace-get-frames 'backtrace))))
(org-element-cache-reset))
(let ((inhibit-quit t) request next)
(setq org-element--cache-interrupt-C-g-count 0)
@ -7491,7 +7492,9 @@ element ending there."
(org-element--cache-warn "Cache corruption detected in %s. Resetting.\n The error was: %S\n Backtrace:\n%S\n Please report this to Org mode mailing list (M-x org-submit-bug-report)."
(buffer-name (current-buffer))
err
(backtrace-to-string (backtrace-get-frames 'backtrace)))
(when (and (fboundp 'backtrace-get-frames)
(fboundp 'backtrace-to-string))
(backtrace-to-string (backtrace-get-frames 'backtrace))))
(org-element-cache-reset)
(org-element--parse-to pom)))))
(when (and (org-element--cache-active-p)