* org-capture.el (org-capture-place-template): Widen to remove
possible restrictions in target buffer.
Jules Bean wrote:
>If I run org-capture with the template:
>("t" "Todo" entry (file+headline
>"/Users/jules/work/TODO.org" "Tasks") "* TODO %?
> (Captured at %u)
> %i
> %a
>")
>whilst I have narrowed (using, e.g., org-narrow-to-subtree) the buffer
>that contains TODO.org, a new "* Tasks" headline is inserted at the
>end of my narrowing and the new entry is added there, which messes up
>the hierarchy of the file.
* lisp/org-capture.el (org-capture): Remove read-only text properties
from capture text.
(org-capture-set-target-location): Throw an error if file+headline
target does not point into a file which is in Org mode.
Richard Riley writes:
> If I select a region in, in this case, an erc (emacs irc client)
> buffer in the read only section and then use my global keys to create
> a new item using the following "j" template while the text is still
> selected
>
> ("j" "Journal" entry
> (file+datetree "journal.org")
> "* %T %?\n %i\n %a")
>
> then I get the following backtrace :-
>
> Debugger entered--Lisp error: (error "Capture abort: (text-read-only)")
> signal(error ("Capture abort: (text-read-only)"))
> error("Capture abort: %s" (text-read-only))
> byte-code("\301\302!\203\n
* org-capture.el (org-capture-place-item): use `org-search-forward-unenclosed'
and `org-search-backward-unenclosed' and new variable `org-item-beginning-re'.
* org-list.el (org-item-beginning-re): regexp matching beginning of an item.
Jambunathan K <kjambunathan@gmail.com> writes:
> It would be convenient if I could do a
>
> M-x customize-group org-capture and/or
> M-x customize-variable org-capture-templates
>
> without having triggered a prior org-capture.
>
> For now, I trigger a capture, abort it and then proceed ahead with
> customizing these.
Here is a patch that adds an "autoload cookie" for
org-capture-templates. After recompiling, org-install.el should contain
an autoload declaration for org-capture-templates.
Let's see if the patch tracker likes me :)
Magnus
* 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.
* lisp/org-capture.el (org-capture-finalize): Fix clock in of interrupted
task during capture finalize
Calling org-capture-get inside the org-with-point-at macro does not
work when the current clocking task and the capture target buffer are
the same. In this case the captured task would continue clocking
instead of switching back to the previously clocking task.
* lisp/org-capture.el (org-capture-target-buffer): Throw an error
if we have no target file.
(org-capture-select-template): Use a default template if the user has
not specified any.
* lisp/org-macs.el (org-string-nw-p): New function.
* lisp/org-capture.el (org-capture-import-remember-templates): Interpret
an empty string as request to use `org-default-notes-file'.
(org-capture-target-buffer): If the FILE is not a (non-empty) string,
use `org-default-notes-file'.
* lisp/org-capture.el (org-capture-fill-template): Do inserting file
contents and expanding sexp escapes first, so that further escape
processing can happen in the inserted text.
This was a request by Sebastian Rose.
This patch makes some straightforward corrections to a number of
docstrings. Each change is normally to:
- correct a typo, or
- fix up hyperlinks to function or variable names, or
- ensure slightly better conformance with the documentation guidelines
and tips given in the Elisp manual
No attempt is made to provide missing docstrings or document arguments.
Cheers,
Phil
* lisp/org-capture.el (org-capture-set-plist): Make sure txt is a string
before calling `string-match'.
(org-capture-templates): Fix customization type.
Modified from a patch proposal by Johan Friis.
TINYCHANGE
* org-capture.el (org-capture): Check if
`org-capture-link-is-already-stored' is bound before evaluating.
If `org-protocol-capture' is the first function that calls
`org-capture', this variable is locally bound while it is globally
unbound. I.e. org-capture.el was not loaded before, the defvar not
evaluated. If `org-protocol-capture' exits, Emacs restores the global
value, which is void.
* lisp/org-capture.el (org-capture-templates): Allow the template
to come from a file or function call.
(org-capture-place-entry): Get the template from file or function.
* lisp/org-capture.el (org-capture-set-target-location): Store
exact positions for file+regexp and file+function targets.
(org-capture-place-entry, org-capture-place-item)
(org-capture-place-table-line, org-capture-place-plain-text): Respect
exact positions.
(org-capture-finalize): Make sure we are at the beginning of a line
when fixing the empty lines after the entry.
* lisp/org-capture.el (org-capture-fill-template): Respect
time-of-day preference in template prompt.
In an interactive time prompt in a capture template, the users
preference of getting a stamp with time was not respected.
Reported by Markus Heller