* lisp/org-timer.el (org-timer-set-timer): The user can always set the
timer with a numeric prefix argument.
Before, when the effort property has been set, the user lost control to
explicitly set the timer to a different time.
* lisp/org-timer.el (org-timer-pause-or-continue):
(org-timer-mode-line-string):
(org-timer-set-mode-line): Use `paused' rather than `pause'.
(org-timer-countdown-timer): Quote `paused' as symbol.
Add changes from Emacs repo that should have been backported with
bb77dd2.
Update copyright year to 2015
7e09ef09a479731d01b1ca46e94ddadd73ac98e3
Paul Eggert
Thu Jan 1 14:26:41 2015 -0800
* lisp/org.el (org-read-date-analyze):
* lisp/org-timer.el (org-timer-seconds): Explicitly pass current-time as
optional time argument and explain reason in comment.
This reverts some changes from 91ab6c4 ("Backport commit 123ddec from
Emacs master branch", 2014-10-28).
* doc/org.texi (Dynamic blocks):
* lisp/org-archive.el (org-archive-subtree)
(org-archive-to-archive-sibling):
* lisp/org-clock.el (org-resolve-clocks, org-clock-get-sum-start)
(org-clock-special-range):
* lisp/org-timer.el (org-timer-seconds):
* lisp/org.el (org-read-date-analyze, org-get-cursor-date):
* lisp/ox-html.el (org-html-format-spec):
* lisp/ox-icalendar.el (org-icalendar--vtodo):
Omit unnecessary call to current-time.
* lisp/org.el (org-get-cursor-date):
Don't call current-time twice to get the current time stamp,
as this can lead to inconsistent results.
* lisp/org-compat.el (org-float-time):
Simplify to an alias because time-to-seconds now behaves like float-time
with respect to nil arg.
* lisp/org-clock.el (org-clock-get-table-data): Omit unnecessary, lossy
conversion from floating point to Emacs time and back.
(org-resolve-clocks): Prefer two-argument floor.
Simplify use of current-time and friends.
123ddec7f807f4bd7400bbbe08219afb02269c00
Paul Eggert
Tue Oct 28 18:42:51 2014 -0700
* lisp/org-timer.el (org-timer-set-timer): Add support for hh:mm:ss
format.
(org-timer-default-timer): Type changed from number to string.
* testing/lisp/test-org-timer.el (test-org-timer/set-timer): Add
hh:mm:ss format in the test.
* lisp/org-timer.el (org-timer-stop): Support countdown timers in addition
to relative timers.
* lisp/org-timer.el (org-timer-cancel-timer): Remove function.
* lisp/org-timer.el (org-timer-pause-or-continue): Support countdown
timers in addition to relative timers.
* testing/lisp/test-org-timer.el: New file.
* doc/org.texi: Merge relative and countdown timer nodes.
Several previous issues are fixed with these changes.
- org-timer-set-timer and org-timer-cancel-timer did not reset
org-timer-start-time after countdown completed.
- Because org-timer-start did not return org-timer-pause-time to nil,
the modeline remained stuck at the paused time.
- When org-timer-start was called with a countdown timer, the modeline
was updated for the new relative timer, but the countdown timer
remained scheduled.
- When org-timer-pause-or-continue was called with a countdown timer
running, the modeline was put in a paused state, but the countdown
timer remained scheduled.
- When org-timer-stop was called with a countdown timer running, the
timer was removed from the modeline, but the countdown timer remained
scheduled.
- When org-timer-set-timer was called with a paused relative timer, the
relative timer was not reset properly (org-timer-pause-time was still
non-nil) and the modeline remained in the paused state of the relative
timer, even though the countdown timer was scheduled with
run-with-timer.
- Running org-timer-set-timer at the beginning of an empty buffer
resulted in an args-out-of-range error (due to the org-get-at-eol
call).
* lisp/org-timer.el (org-timer-stop): Do not look after
`org-timer-current-timer', which is a variable related to countdown
timer, whereas the function is related to relative timer.
Reported-by: Randy Smith <perlstalker@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93081>
* org.el (org-refresh-property): New function.
(org-refresh-properties, org-set-effort)
(org-property-next-allowed-value): Use it.
* org-timer.el (org-timer-set-timer): Get the correct number
of minutes from text properties, both in an `org-mode' and
`org-agenda-mode' buffer.
* org-timer.el (org-timer-cancel-timer, org-timer-stop):
Enhance message.
(org-timer-set-timer): Use the number of minutes in the Effort
property as the default timer value. Three prefix arguments
will ignore the Effort value property.
* lisp/org-timer.el (org-timer-set-timer): Use the variable
`org-clock-sound' when calling `org-notify'.
When org-notify second parameter is t we only get the standard beep.
Evaluating with coma we can use different sounds for differents
running timers, as `org-clock-sound' was set when
`org-timer-set-timer' get execute
Patch proposal by Roberto Huelga Díaz.
TINYCHANGE
* lisp/org-timer.el (org-timer-set-mode-line): Check
`org-timer-display' when value is 'off.
This solves the error of (org-timer-set-mode-line 'off) when
`org-timer-display' is 'mode-line. In this case `frame-title-format'
may not be a list.
TINYCHANGE
* org-clock.el: New option `org-clock-clocked-in-display' to control
whether the current clock is displayed in the mode line and/or frame
title.
* org-timer.el: New option `org-timer-display' to control whether
the current timer is displayed in the mode line and/or frame title.
This allows the clock and timer to be displayed in the frame title instead of,
or as well as, the mode line. This is useful for people with limited space in
the mode line but with ample space in the frame title.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.
This commit also bumps the version number to 7.8.06.
The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
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.
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
* 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.