org-persist-write:elisp: Do not use `buffer-local-boundp'

* lisp/org-persist.el (org-persist-write:elisp): Use manual
implementation of `buffer-local-boundp' to make things work in Emacs
<28.

Reported in https://list.orgmode.org/87k0dyqy3d.fsf@kyleam.com/T/#u
This commit is contained in:
Ihor Radchenko 2022-02-14 12:41:37 +08:00
parent fe4a60dffa
commit 0cb0760206
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

@ -614,8 +614,11 @@ COLLECTION is the plist holding data collectin."
(if (and (plist-get (plist-get collection :associated) :file)
(get-file-buffer (plist-get (plist-get collection :associated) :file)))
(let ((buf (get-file-buffer (plist-get (plist-get collection :associated) :file))))
(when (buffer-local-boundp (cadr container) buf)
(buffer-local-value (cadr container) buf)))
;; FIXME: There is `buffer-local-boundp' introduced in Emacs 28.
;; Not using it yet to keep backward compatibility.
(condition-case nil
(buffer-local-value (cadr container) buf)
(void-variable nil)))
(when (boundp (cadr container))
(symbol-value (cadr container)))))