瀏覽代碼

Bugfix: Adding stars with C-c *

When calling C-c * before the first headline, the results where wrong.
Fixed now.
Carsten Dominik 16 年之前
父節點
當前提交
e56c7097f4
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 1 0
      lisp/ChangeLog
  2. 5 2
      lisp/org.el

+ 1 - 0
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.
 

+ 5 - 2
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