From e56c7097f433097abb58a553a013ce0adcb0c6f6 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 15 Mar 2009 12:27:49 +0100 Subject: [PATCH] Bugfix: Adding stars with C-c * When calling C-c * before the first headline, the results where wrong. Fixed now. --- lisp/ChangeLog | 1 + lisp/org.el | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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