Browse Source

Don't insert item when tree is folded

* org-list.el (org-insert-item): check invisibility of point at a
  meaningful location.
Nicolas Goaziou 14 years ago
parent
commit
0f44a66523
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/org-list.el

+ 3 - 1
lisp/org-list.el

@@ -1115,7 +1115,9 @@ If CHECKBOX is non-nil, add a checkbox next to the bullet.
 Return t when things worked, nil when we are not in an item, or
 item is invisible."
   (unless (or (not (org-in-item-p))
-	      (org-invisible-p))
+	      (save-excursion
+		(goto-char (org-get-item-beginning))
+		(org-invisible-p)))
     (if (save-excursion
 	  (goto-char (org-get-item-beginning))
 	  (org-at-item-timer-p))