summaryrefslogtreecommitdiff
path: root/lisp/org/org-archive.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/org-archive.el')
-rw-r--r--lisp/org/org-archive.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index 91705775e00..75acc8e89ec 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.09a
+;; Version: 6.10c
;;
;; This file is part of GNU Emacs.
;;
@@ -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)