* lisp/org-timer.el (org-timer-item): save-excursion prevents
`org-list-struct' to get the list structure when point isn't on the
first line of the item.
* lisp/org-list.el (org-list-insert-item-generic): change arguments.
The function now accepts structure and previous items alist. This
allow to insert an item programmatically more easily.
(org-insert-item): Apply changes to org-list-insert-item-generic. The
function now takes care about repairing structure and updating
checkboxes.
* lisp/org-timer.el (org-timer-item): Apply changes to
org-list-insert-item-generic. The function now takes care about
repairing structure.
* org-list.el (org-list-separating-blank-lines-number): use new
accessors.
(org-list-insert-item-generic): use list structures to insert a new
item.
(org-list-exchange-items): refactor and comment code. Now return new
struct instead of modifying it, as list sorting would sometimes eat
first item.
(org-move-item-down,org-move-item-up): reflect changes to
`org-list-exchange-items'.
(org-insert-item): as `org-in-item-p' also computes item beginning
when applicable, reuse the result.
* org-timer.el (org-timer-item): as `org-in-item-p' also computes item
beginning when applicable, reuse the result.
* lisp/org-timer.el (org-timer-continue-hook): Define the variable
(org-timer-pause-or-continue): Run hook after relative timer is
continued
There was a hook run when the relative timer is paused (and for most
other actions), but none for continuing afterwards.
One use for this would be to pause/continue playback in a media-player
app with the same keystroke used to pause/continue the timer.
TINYCHANGE
Patch by Christian Moe
Update org.texi with a new section: Countdown timer.
Update ORGWEBPAGE/Changes.org with a section about timer/clock.
Also fix a small typo in a org-timer.el.
Also bind `org-timer-cancel-timer' to `C-c C-x :' in org-mode.
We may want to bind this command in org-agenda-mode as well but
I don't have any good idea of a keybinding now.
* org-list.el (org-in-item-p): Handle case when point is at an
heading.
* org-list.el (org-list-make-subtree): Add protection when used
outside of list
* org-list.el (org-insert-item): Removed useless hack now
`org-in-item-p' is fixed.
* org-timer.el (org-timer-item): Removed useless hack now
`org-in-item-p' is fixed.
* org-timer.el (org-timer-item): Refactoring. Compute timer string
before inserting it in the buffer
* org-timer.el (org-timer): added an optional argument to return timer
string instead of inserting it.
* org-list.el (org-insert-item-internal): New function to handle
positionning and contents of an item being inserted at a specific
pos. It is not possible anymore to split a term in a description
list or a checkbox when inserting a new item.
* org-list.el (org-insert-item): Refactored by using the new
`org-insert-item-internal' function.
* org-timer.el (org-timer-item): Refactored by using the new
`org-insert-item-internal' function.
in a special block now move before block.
* org-list.el (org-insert-item): Move before any special block in a
list prior to add a new item.
* org-timer.el (org-timer-item): When in a timer list, insert a new
timer item like `org-insert-item'. If in another list, send an
error. Otherwise, start a new timer list.
* org-timer.el (org-timer-item): Insert description list item at the
right column.
* org-list.el (org-insert-item): Insert the right number of blank
lines before a relative timer.
Called with a numeric prefix argument, `org-timer-set-timer' uses
this numeric value as the duration of the timer.
Called with a `C-u' prefix argument, use `org-timer-default-timer'
without prompting the user for a duration.
With two `C-u' prefix arguments, use `org-timer-default-timer'
without prompting the user for a duration and automatically
replace any running timer."
This variable defaults to nil. When non-nil, this is the default
value when the user is prompted for a timer.
This patch also improves org-timer-set-timer so that the user can
replace the current timer by a new one.
Also get rid of a bug: as timers where not properly canceled,
`org-timer-show-remaining-time' was not giving the proper result.
Thanks to Frédéric Couchet for this catch.
This commit defines three new functions in org-timer.el:
- org-timer-set-timer, bound to `C-c C-x ;' in Org buffers
and to `;' in Org agenda buffers. This function sets a
timer for the headline the cursor is currently it. Up to
three timers can be set.
- org-timer-show-remaining-time: this shows the remaining
time for the last set timer.
- org-timer-reset-timers: this reset all timers.
This functionality was requested by Samuel Wales and emulates
that of tea-time.el -- see the emacswiki doc about tea-time.el:
http://www.emacswiki.org/emacs/tea-time