浏览代码

Archive: Fix bug when archiving to top-level

Org erroneously filed top-level headings as level 2, because it
assumes that if should file below some heading.  However, if there is
no heading to file under, this should be turned off.

Patch by igrekster.
Carsten Dominik 16 年之前
父节点
当前提交
7c92da7ba8
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-archive.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-02-27  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-archive.el (org-archive-subtree): Do not add 1 to level if
+	pasting at top level.
+
 	* org-bbdb.el: Improve documentation.
 
 2009-02-26  Carsten Dominik  <carsten.dominik@gmail.com>

+ 1 - 1
lisp/org-archive.el

@@ -270,7 +270,7 @@ this heading."
 	    ;; No specific heading, just go to end of file.
 	    (goto-char (point-max)) (insert "\n"))
 	  ;; Paste
-	  (org-paste-subtree (org-get-valid-level level 1))
+	  (org-paste-subtree (org-get-valid-level level (and heading 1)))
 
 	  ;; Mark the entry as done
 	  (when (and org-archive-mark-done