Function: org-convert-to-odd-levels

org-convert-to-odd-levels is an interactive and byte-compiled function defined in org.el.gz.

Signature

(org-convert-to-odd-levels)

Documentation

Convert an Org file with all levels allowed to one with odd levels.

This will leave level 1 alone, convert level 2 to level 3, level 3 to level 5 etc.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-convert-to-odd-levels ()
  "Convert an Org file with all levels allowed to one with odd levels.
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 ((outline-level 'org-outline-level)
	  (org-odd-levels-only nil) n)
      (save-excursion
	(goto-char (point-min))
	(while (re-search-forward "^\\*\\*+ " nil t)
	  (setq n (- (length (match-string 0)) 2))
	  (while (>= (setq n (1- n)) 0)
	    (org-demote))
	  (end-of-line 1))))))