summaryrefslogtreecommitdiff
path: root/lisp/org-archive.el
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2008-10-21 22:29:03 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2008-10-21 22:29:03 +0200
commit69bf8ef2b4f5f24d068a5ad0cbf294ac714130be (patch)
tree9226a721be9ec65d84de7af633233b12da0d54d1 /lisp/org-archive.el
parent5f432e324cf61c0541d01beccd02e701e64505a6 (diff)
Fix bug with sibling archiving on top level.
Diffstat (limited to 'lisp/org-archive.el')
-rw-r--r--lisp/org-archive.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/org-archive.el b/lisp/org-archive.el
index 91705775e..144087238 100644
--- a/lisp/org-archive.el
+++ b/lisp/org-archive.el
@@ -322,12 +322,13 @@ sibling does not exist, it will be created at the end of the subtree."
(setq pos (point))
(condition-case nil
(outline-up-heading 1 t)
- (error (goto-char (point-min))))
+ (error (setq e (point-max)) (goto-char (point-min))))
(setq b (point))
- (condition-case nil
- (org-end-of-subtree t t)
- (error (goto-char (point-max))))
- (setq e (point))
+ (unless e
+ (condition-case nil
+ (org-end-of-subtree t t)
+ (error (goto-char (point-max))))
+ (setq e (point)))
(goto-char b)
(unless (re-search-forward
(concat "^" (regexp-quote leader)