org-persist: Support old Emacs without file-attribute-inode-number

* lisp/org-persist.el (org-persist--get-index): Check is
`file-attribute-inode-number' function exists.  It was not there in
Emacs 25.

Fixes https://list.orgmode.org/CAJcAo8s21R1dRrxpaHV=h68RtWctLd6giFskw1vpt9fQh81dDw@mail.gmail.com/T/#u
This commit is contained in:
Ihor Radchenko 2021-12-20 13:46:55 +08:00
parent 344b99070f
commit 0b670aa8e8
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 3 additions and 1 deletions

View File

@ -94,7 +94,9 @@ When BUFFER is nil, return plist for global VAR."
(org-persist--read-index)
(let* ((buffer-file (when buffer (buffer-file-name (or (buffer-base-buffer buffer)
buffer))))
(inode (when buffer-file (file-attribute-inode-number (file-attributes buffer-file))))
(inode (when buffer-file
(and (fboundp 'file-attribute-inode-number)
(file-attribute-inode-number (file-attributes buffer-file)))))
(buffer-hash (when buffer (secure-hash 'md5 buffer))))
(let ((result (seq-find (lambda (plist)
(and (or (memq var (plist-get plist :variable))