1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-24 07:20:29 +00:00

org-persist: Fix compatibility with Emacs 27

* lisp/org-persist.el (org-persist--normalize-associated): Do not
expect that we can bind new vars in pacse forms.
(org-persist-read:elisp):
(org-persist-read:version):
(org-persist-read:file):
(org-persist-read:url): Avoid multiple `_' placeholders.
This commit is contained in:
Ihor Radchenko 2022-01-23 15:04:59 +08:00
parent dc52c0fe99
commit fca80139ee
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -443,7 +443,8 @@ MISC, if non-nil will be appended to the collection."
"Normalize ASSOCIATED representation into (:type value)."
(pcase associated
((or (pred stringp) `(:file ,associated2))
(when associated2 (setq associated associated2))
(unless (stringp associated)
(setq associated (cadr associated)))
(let* ((rtn `(:file ,associated))
(inode (and (fboundp 'file-attribute-inode-number)
(file-attribute-inode-number
@ -451,7 +452,8 @@ MISC, if non-nil will be appended to the collection."
(when inode (plist-put rtn :inode inode))
rtn))
((or (pred bufferp) `(:buffer ,associated2))
(when associated2 (setq associated associated2))
(unless (bufferp associated)
(setq associated (cadr associated)))
(let ((cached (gethash associated org-persist--associated-buffer-cache))
file inode hash)
(if (and cached (eq (buffer-modified-tick associated)
@ -493,20 +495,20 @@ COLLECTION is the plist holding data collectin."
read-func-symbol))
(funcall read-func-symbol c ,reference-data ,collection)))
(defun org-persist-read:elisp (_ lisp-value _)
(defun org-persist-read:elisp (_ lisp-value __)
"Read elisp container and return LISP-VALUE."
lisp-value)
(defun org-persist-read:version (container _ _)
(defun org-persist-read:version (container _ __)
"Read version CONTAINER."
(cadr container))
(defun org-persist-read:file (_ path _)
(defun org-persist-read:file (_ path __)
"Read file container from PATH."
(when (and path (file-exists-p (concat org-persist-directory path)))
(concat org-persist-directory path)))
(defun org-persist-read:url (_ path _)
(defun org-persist-read:url (_ path __)
"Read file container from PATH."
(when (and path (file-exists-p (concat org-persist-directory path)))
(concat org-persist-directory path)))