瀏覽代碼

Only write id locations if any are defined

This is to avoid an empty file when no id's have been used at all.
Carsten Dominik 16 年之前
父節點
當前提交
00179c97b7
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-id.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-12-10  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-id.el (org-id-locations-save): Only write the id locations
+	if any are defined.
+
 	* org-archive.el (org-archive-all-done): Make this work in a file
 	with org-odd-levels-only set.
 

+ 1 - 1
lisp/org-id.el

@@ -466,7 +466,7 @@ When CHECK is given, prepare detailed information about duplicate IDs."
 
 (defun org-id-locations-save ()
   "Save `org-id-locations' in `org-id-locations-file'."
-  (when org-id-track-globally
+  (when (and org-id-track-globally org-id-locations)
     (let ((out (if (hash-table-p org-id-locations)
 		   (org-id-hash-to-alist org-id-locations)
 		 org-id-locations)))