* lisp/org-capture.el (org-capture-fill-template): Expand %(sexp) after
%:keywords, per documentation about capture templates expansion.
When a template is expanded first the simple %-escapes, %:keywords and
after that the %(sexp).
TINYCHANGE
lisp/org-capture.el (org-capture-place-item): When starting a new list
use org-indent-line to establish the correct indentation rather than
just using 0.
Creating an entry in org-capture-templates of type item adds entries
into a list, however, currently, if the list is empty then the first
list item will always be indented to depth 0 (so hard on the left),
which looks like this:
* Top Level
** Second Level
- item #1
- item #2
- item #3
This is fine if org-adapt-indentation is nil, however, with the
default value of t lists should be indented more like this:
* Top Level
** Second Level
- item #1
- item #2
- item #3
The patch below changes org-capture-place-item so that, when starting
a new list, the items are indented as above.
Care is taken to preserve two features of the existing behaviour,
first, when adding to an existing list, new items are indented to
match the items already in the list. And secondly, when there is some
introductory text before the list new items are inserted after the
text, like this:
* Top Level
** Second Level
This is some introductory text:
- item #1
- item #2
- item #3
TINYCHANGE
* org-capture.el (org-capture-steal-local-variables): Don't
steal `mark-active', which should be nil in the target buffer.
Thanks to Alex Kosorukoff for raising this issue.
* org-capture.el (org-capture-fill-template): Deactivate
region while trying to align tags on the current headline.
Thanks to Alex Kosorukoff for reporting this.
* lisp/org-capture.el (org-capture-place-table-line): If the value of
`:table-line-pos' is a function name, used its return value to set the
position inside the table. The return value must be a string like
"II-3". Else `:table-line-pos' is 'eval'ed.
TINYCHANGE
* org-capture.el (org-capture-finalize): Ensure to widen the
buffer when the target buffer is not initially narrowed.
Thanks to Adam Spiers and Thomas Proschinger for reporting this bug.
* org-capture.el (org-capture-finalize): Ensure to widen the
buffer when the target buffer is not initially narrowed.
Thanks to Adam Spiers and Thomas Proschinger for reporting this bug.
* lisp/org-capture.el (org-capture-goto-last-stored): Use
`org-bookmark-names-plist'.
* lisp/org.el (org-refile-goto-last-stored): Use
`org-bookmark-names-plist'.
* lisp/org-capture.el (org-capture-place-entry): Set :exact-position
before doing other stuff, to allow function with other target settings
TINYCHANGE
Assuming file "test.org" has a single headline "* Level 1" (ended with
newline character), when trying to use function type capture target in
an org-capture template, as shown in the example:
(setq org-capture-templates
`(("t"
"Test function type target"
entry
(function
(lambda ()
(set-buffer (org-capture-target-buffer "test.org"))
(goto-char (point-max))))
"* Level 2")))
When this template gets filled, file "test.org" becomes:
* Level 1
* Level 2
Instead of:
* Level 1
** Level 2
This is because when using function type target, `:exact-position' is
used to store buffer position returned by user's function (the lambda
function here), and function `org-capture-place-entry' will never
insert template as a child of current entry when `:exact-position' is
used.
The problem is addressed by not special casing for `:exact-position'
in function `org-capture-place-entry'.
York
* org-capture.el (org-capture): Store :return-to-wconf
earlier.
(org-capture-place-template): Don't store :return-to-wconf
when called from a capture template using `function', rely on
the early :return-to-wconf value store from `org-capture'.
Thanks to Brett Viren for raising this issue.
* org.el (org-directory, org-default-notes-file)
(org-reverse-note-order): Don't use the `org-remember'
customization group.
(org-require-autoloaded-modules): Don't require
`org-remember'.
* org-capture.el: Update commentary section to reflect the
fact that org-remember.el is not used anymore.
* lisp/org-capture.el (org-capture-expand-embedded-elisp): Throw error if
result is not a string and not nil. If the result is nil, treat it as
if it was the empty string.
* lisp/org.el (org-bookmark-names-plist): New user option.
(org-set-regexps-and-options-for-tags): Use `org-bookmark-names-plist'.
(org-refile): Use `org-bookmark-names-plist'.
* lisp/org-capture.el (org-capture-bookmark-last-stored-position): Use
`org-bookmark-names-plist'.
Patch modified from a proposal by Oleh.
* org-capture.el (org-capture-set-target-location): Don't
throw an error when `org-time-was-given' is not bound.
Thanks to Eric S Fraga for reporting this.
* org-capture.el (org-mks): Fix bug: let-bind
`case-fold-search' to nil while matching the first letter of a
multi-letters template.
Thanks to Robert Goldman for reporting this bug and providing the fix.
* org-capture.el (org-capture-templates): Document new option
:jump-to-captured in the docstring. Offer the complete list
of options when customizing.
(org-capture-finalize): Handle :jump-to-captured.
This emulates the behavior triggered by %& in remember templates.
Thanks to Adam Spiers for reporting this.
* lisp/org-macs.el (org-if-unprotected, org-if-unprotected-1,
org-if-unprotected-at): Removed macros.
(org-re-search-forward-unprotected): Removed function.
* lisp/org.el (org-format-latex): Remove reference to `org-protected'.
* lisp/org-list.el (org-list-struct): Remove reference to
`org-example' and `org-protected'.
* lisp/org-footnote.el (org-footnote-at-reference-p): Remove reference
to `org-protected'.
* lisp/org-capture.el (org-capture-fill-template): Remove reference to
`org-protected'.
* contrib/lisp/org-wikinodes.el (org-wikinodes-process-links-for-export):
Remove reference to `org-protected' value.
These text properties were used by the old export framework. They are
not needed anymore.
* org.el (org-contextualize-validate-key): Check against two
new context predicates [not-]in-buffer.
* org-capture.el (org-capture-templates-contexts):
* org-agenda.el (org-agenda-custom-commands-contexts):
Document the new [not-]in-buffer context predicates.
Thanks to Paul Sexton for triggering this and for proposing a patch.