branch: externals/org commit fca80139eebf704d523de559ee9bfa6498565483 Author: Ihor Radchenko <yanta...@gmail.com> Commit: Ihor Radchenko <yanta...@gmail.com>
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. --- lisp/org-persist.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/org-persist.el b/lisp/org-persist.el index 4552dd4f2e..f80a8e2c18 100644 --- a/lisp/org-persist.el +++ b/lisp/org-persist.el @@ -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)))