Don't search for position in existing list if :exact-position

* org-capture.el (org-capture-place-item): Don't search for
position in existing list if :exact-position was supplied.

This fixes a bug reported by François Pinard in
<http://thread.gmane.org/gmane.emacs.orgmode/49995>.
This commit is contained in:
David Maus 2012-01-24 06:41:49 +01:00
parent fce92180d1
commit cda38d182a
1 changed files with 23 additions and 23 deletions

View File

@ -911,9 +911,9 @@ it. When it is a variable, retrieve the value. Return whatever we get."
(target-entry-p (org-capture-get :target-entry-p)) (target-entry-p (org-capture-get :target-entry-p))
(ind 0) (ind 0)
beg end) beg end)
(if (org-capture-get :exact-position)
(goto-char (org-capture-get :exact-position))
(cond (cond
((org-capture-get :exact-position)
(goto-char (org-capture-get :exact-position)))
((not target-entry-p) ((not target-entry-p)
;; Insert as top-level entry, either at beginning or at end of file ;; Insert as top-level entry, either at beginning or at end of file
(setq beg (point-min) end (point-max))) (setq beg (point-min) end (point-max)))
@ -934,7 +934,7 @@ it. When it is a variable, retrieve the value. Return whatever we get."
(progn (progn
(setq ind (org-get-indentation)) (setq ind (org-get-indentation))
(org-end-of-item)) (org-end-of-item))
(setq ind 0))) (setq ind 0))))
;; Remove common indentation ;; Remove common indentation
(setq txt (org-remove-indentation txt)) (setq txt (org-remove-indentation txt))
;; Make sure this is indeed an item ;; Make sure this is indeed an item