* doc/org.texi (Template elements): Document the new entry type.
* lisp/org-capture.el (org-capture-templates): Add new option to customize
type and docstring.
(org-capture-set-target-location): Interpret the file+datetree+prompt
entry.
* lisp/org-capture.el (org-capture-templates): New capture
property `:kill-buffer'. (org-capture-finalize): Kill target buffer
if that is desired.
(org-capture-target-buffer): Remember if we have to make the buffer.
Proposal by Samuel Wales.
* lisp/org-capture.el (org-capture-empty-lines-before):
(org-capture-empty-lines-after): Make sure the n=0 does not insert any
newlines.
Marcel van der Boom writes:
> I'm in the process of migrating from org-remember to org-capture.
> Pretty easy going so far, but it seems org-capture adds newlines, which
> I think it should not do.
>
> My (test) capture-template is:
>
> (("t" "Todo" entry
> (file "~/.outlet/GTD.org")
> "* TODO %?" :prepend t :empty-lines 0)
>
> with the intention of inserting the captured task on the
> first line of the file ~/.outlet/GTD.org. What happens when I capture
> an task is this:
>
> <beginning of file>
>
> * TODO Captured task
>
> <original first line of file here>
> ....
>
> Both before and after the task is a newline. Also, when capturing and
> cancelling the capture with C-c C-k the newlines remain whereas the
> task is removed.
* lisp/org-capture.el (org-capture-place-entry): If the first
line is already a headline, just stay there.
Patch by THomas Fuchs.
TINYCHANGE
> I'm trying to capture and file an entry as an top-level entry as first entry
> in an org file without config at the beginning (no "#+").
> This leads to filing the entry as _second_ headline in the org file.
> The template is:
> ("z" "test" entry (file "~/Data/z.org") "* %^{Note} %t :NOTE:\n %?"
> :prepend t)
>
> I think this is due to jumping over lines starting with "#+" at the
> beginning of the org file
> (line 715 in org-capture.el (org-capture-place-entry)).
> My file has no config header and starts with the first headline. Calling
> outline-next-heading
> in this situation leads to jumping to the second headline in the file.
* 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
* lisp/org-agenda.el (org-agenda-action): Make `c' key call org-capture.
* lisp/org-capture.el: New file.
* lisp/org-compat.el (org-get-x-clipboard): Function moved here from
remember.el.
* lisp/org-mks.el: New file
* lisp/org.el (org-set-regexps-and-options): Allow statistic cookies as
part of complex headlines.
(org-find-olp): New argument THIS-BUFFER. When set, assume that the
OLP does not contain a file name.