This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.
This commit reverts back the maint branch to its state before
merging the master branch. From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
* 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>.
Rename `org-on-heading-p' and `org-on-target-p' to
`org-at-heading-p' and `org-at-target-p' to be more
consistent with the org-at-*-p family.
Also define two aliases.
* lisp/org-capture.el (org-capture-set-target-location): Set the capture
default time also to the prompt time.
In the file+datetree+promt target type, the user is being asked for a
date, where to file an entry. In the template, there can the escape
placeholders for active and inactive time stamps. So far, these were
filled with todays date. This patch changes this behavior, so that
also at %t and %u escaped, the date entered at the prompt will be
used.
Reported by Erik Hetzner.
* org-capture.el (org-capture-before-finalize-hook): Docstring
improvement: mention that the buffer is widened when this hook
is run.
Thanks to Paul for a suggestion about this.
Robert Pluim <rpluim@gmail.com> writes:
> Hi, I'm using XEmacs 21.5 (beta29) "garbanzo" d27c1ee1943b+ [Lucid]
> (i686-pc-cygwin, Mule) of Mon Oct 18 2010 on RPluim, with the following
> org-capture-templates
>
> (("t" "Todo" entry (file+headline "~/org/notes.org" "Tasks") "* TODO %?"))
>
> The problem is that for some reason the resulting TODO heading is has 2
> extra spaces, and is placed at too deep a level, giving:
>
> * Tasks
> *** TODO a task
>
> I've tested this on a fairly recent emacs24 build, and everything works
> fine there, so this is probably something XEmacs specific. Can anyone
> suggest any way to track this down (I'd bisect, but I've yet to find a
> 'good' version)?
I finally got around to looking into this: The reason is that, in
org-capture mode, `outline-level' is bound to outline.el's function,
which is off by one compared to org-mode's. I used this patch to fix
it:
Could somebody review and maybe apply this?
Additionally, replace one
(or (org-mode-p) (derived-mode-p 'org-mode))
with
(derived-mode-p 'org-mode)
cause that is reflexive anyway (returns true, if the current mode is
org-mode).
Delete one check testing for org-mode or org derived mode
Also remove blank lines before the ";;; org*el ends here" declarations.
Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.
Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
* org-capture.el (org-capture-templates): docstring fix.
* org.texi (Template expansion): order template sequences in
the proper order.
Thanks to Philipp Möller for this fix.
* lisp/org-capture.el (org-capture): if dired isn't loaded,
`dired-buffers' isn't defined, and %F will fail.
Thanks to Puneeth Chaganti for reporting this.
* lisp/org-capture.el (org-capture): if no file is associated to
current buffer, check dired buffer and try to retreive a possibly
directory associated.
* org-capture.el (org-capture-finalize): bugfix about
inserted blank line when killing the capture buffer and
`org-blank-before-new-entry' tells to not insert anything
before a heading.
Thanks to Leo for reporting this.
* lisp/org-capture.el (org-capture-current-plist): Improve docstring.
(org-capture-put): Add docstring.
(org-capture-get): Add docstring.
(org-capture-member): Add LOCAL argument. Add docstring.
(org-capture-set-target-location): Store the time received from a date
prompt into the :prompt-time property.
When using the file+datetree+prompt target for capture, the time set
by the prompt is now stored in the :prompt-time property.
* org-capture.el (org-capture-clock-keep): New local variable.
(org-capture, org-capture-finalize): Use it and fix a bug when
:clock-keep is set to `t'.
* lisp/org.el (org-end-of-meta-data-and-drawers): New function.
* lisp/org-capture.el (org-capture-place-plain-text): Implement adding
plain text templates to Org nodes.
This is something which came out of a discussion with Philip Rooke, in
the thread
Philip tried to use a capture template with template type plain, but
using a date tree as a target. Plain templates where placed at the
end of the file, not at the end of the entry. I complained first that
mixing headlined entries and plain snippets into the same capture
target is not possible, but I realized that there is a way to make
this work OK. The headlined entries become children, and the plain
text snippets become part of the text before the first child.
(org-capture-templates): Rename :no-clock-out to :clock-keep.
(org-capture): Use :clock-keep instead of :no-clock-out.
Thanks to Bernt Hansen for the suggestion.
* org-capture.el (org-capture-templates): New option
:no-clock-out.
(org-capture): Use the new option.
* org.texi (Template elements): document the new template
option :no-clock-out.
* org-capture.el (org-capture-put-target-region-and-position):
New function to store information about the target buffer.
(org-capture-set-target-location): Use it.
(org-capture-finalize): restore the target buffer in its
possibly narrowed state. Also restore the cursor position.
* org-capture.el (org-capture-finalize): New argument
clock-out, to tell whether finalizing the capture process
should clock out the running clock.
(org-capture): Use the new argument.