0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-25 09:02:52 +00:00

Make odd-level conversion work in outline-mode files

This commit is contained in:
Carsten Dominik 2009-09-15 07:44:53 +01:00
parent bf923fdb6f
commit c2a3a379a9
2 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2009-09-15 Carsten Dominik <carsten.dominik@gmail.com>
* 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 <carsten.dominik@gmail.com>
* org.el (org-store-link): When in agenda buffer, link to

View file

@ -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)