Fix problem with moving trees in XEmacs.

Moving trees up or down with XEmacs caused a problem when the tree is
at the beginning if the buffer or narrowed region.  This patch
protects the relevant calls to outline-flag-region so that they are
only executed if the range is valid.
This commit is contained in:
Carsten Dominik 2008-12-05 09:39:37 +01:00
parent 4298df987b
commit 520ff98609
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,8 @@
2008-12-05 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-target-link-regexp): Make buffer-local.
(org-move-subtree-down): Fix bug with trees at beginning of
buffer.
2008-12-04 Carsten Dominik <carsten.dominik@gmail.com>

View File

@ -5107,8 +5107,8 @@ is signaled in this case."
(setq txt (buffer-substring beg end))
(org-save-markers-in-region beg end)
(delete-region beg end)
(outline-flag-region (1- beg) beg nil)
(outline-flag-region (1- (point)) (point) nil)
(or (= beg (point-min)) (outline-flag-region (1- beg) beg nil))
(or (bobp) (outline-flag-region (1- (point)) (point) nil))
(let ((bbb (point)))
(insert-before-markers txt)
(org-reinstall-markers-in-region bbb)