浏览代码

org-persist-write: Update buffer hash on save

Ihor Radchenko 3 年之前
父节点
当前提交
aca62116da
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      lisp/org-persist.el

+ 5 - 0
lisp/org-persist.el

@@ -702,6 +702,11 @@ ASSOCIATED can be a plist, a buffer, or a string.
 A buffer is treated as (:buffer ASSOCIATED).
 A string is treated as (:file ASSOCIATED)."
   (setq associated (org-persist--normalize-associated associated))
+  ;; Update hash
+  (when (and (plist-get associated :file)
+             (plist-get associated :hash)
+             (get-file-buffer (plist-get associated :file)))
+    (setq associated (org-persist--normalize-associated (get-file-buffer (plist-get associated :file)))))
   (let ((collection (org-persist--get-collection container associated)))
     (setf collection (plist-put collection :associated associated))
     (unless (seq-find (lambda (v)