diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 961a98776..0133eaddc 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2009-09-15 Carsten Dominik + + * org.el (org-convert-to-odd-levels) + (org-convert-to-oddeven-levels): Work also correctly if the file + is in outline-mode. + 2009-09-12 Carsten Dominik * org.el (org-store-link): When in agenda buffer, link to diff --git a/lisp/org.el b/lisp/org.el index 3f044be5c..d852177e1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6059,7 +6059,9 @@ This will leave level 1 alone, convert level 2 to level 3, level 3 to level 5 etc." (interactive) (when (yes-or-no-p "Are you sure you want to globally change levels to odd? ") - (let ((org-odd-levels-only nil) n) + (let ((outline-regexp org-outline-regexp) + (outline-level 'org-outline-level) + (org-odd-levels-only nil) n) (save-excursion (goto-char (point-min)) (while (re-search-forward "^\\*\\*+ " nil t) @@ -6068,7 +6070,6 @@ level 5 etc." (org-demote)) (end-of-line 1)))))) - (defun org-convert-to-oddeven-levels () "Convert an org-mode file with only odd levels to one with odd and even levels. This promotes level 3 to level 2, level 5 to level 3 etc. If the file contains a @@ -6081,7 +6082,9 @@ is signaled in this case." (org-show-context t) (error "Not all levels are odd in this file. Conversion not possible.")) (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ") - (let ((org-odd-levels-only nil) n) + (let ((outline-regexp org-outline-regexp) + (outline-level 'org-outline-level) + (org-odd-levels-only nil) n) (save-excursion (goto-char (point-min)) (while (re-search-forward "^\\*\\*+ " nil t)