From 0f44a6652360116424e3b88dcf6508e2b2472729 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 7 Sep 2010 19:06:03 +0200 Subject: [PATCH] Don't insert item when tree is folded * org-list.el (org-insert-item): check invisibility of point at a meaningful location. --- lisp/org-list.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index a5160c179..ff6b80bfe 100644 --- a/lisp/org-list.el +++ b/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))