diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7f95ddbb6..8b5079f6f 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * org.el (org-read-date-history): New variable. (org-read-date): Use new history variable. + (org-toggle-heading): Fix bug when used before first headline. * org-exp.el (org-export-as-ascii): Improve export of plain lists. diff --git a/lisp/org.el b/lisp/org.el index eb5511654..ccf692399 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14210,8 +14210,11 @@ a prefix argument is given, its value determines the number of stars to add." ?*) (save-excursion (re-search-backward org-complex-heading-regexp nil t) - (or (match-string 1) "*")))) - (add-stars (if nstars "" (if org-odd-levels-only "**" "*"))) + (or (match-string 1) "")))) + (add-stars (cond (nstars "") + ((equal stars "") "*") + (org-odd-levels-only "**") + (t "*"))) (rpl (concat stars add-stars " "))) (while (< (setq l (1+ l)) l2) (if itemp