Browse Source

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 years ago
parent
commit
7c92da7ba8
2 changed files with 4 additions and 1 deletions
  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