Fix checkitem and item placement bugs in org-capture

* lisp/org-capture.el (org-capture-place-template): Handle the checkitem
case.
(org-capture-place-item): Provide boundaries for the search to make
sure we do not get a match in a different tree.
This commit is contained in:
Carsten Dominik 2010-08-16 10:23:29 +02:00
parent a4c9d361f0
commit 6da5c4525a
1 changed files with 4 additions and 3 deletions

View File

@ -680,7 +680,8 @@ already gone."
((nil entry) (org-capture-place-entry))
(table-line (org-capture-place-table-line))
(plain (org-capture-place-plain-text))
(item (org-capture-place-item))))
(item (org-capture-place-item))
(checkitem (org-capture-place-item))))
(org-capture-mode 1)
(org-set-local 'org-capture-current-plist org-capture-plist))
@ -742,14 +743,14 @@ already gone."
(if (org-capture-get :prepend)
(progn
(goto-char beg)
(if (re-search-forward (concat "^" (org-item-re)) nil t)
(if (re-search-forward (concat "^" (org-item-re)) end t)
(progn
(goto-char (match-beginning 0))
(setq ind (org-get-indentation)))
(goto-char end)
(setq ind 0)))
(goto-char end)
(if (re-search-backward (concat "^" (org-item-re)) nil t)
(if (re-search-backward (concat "^" (org-item-re)) beg t)
(progn
(setq ind (org-get-indentation))
(org-end-of-item))