* lisp/org-clock.el (org-clock-clocktable-default-properties):
Remove :scope.
The :scope value is handled specially in `org-clock-report'. Setting
it here would override the special mechanism there.
Reported-by: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-03/msg00034.html>
* lisp/org-clock.el (org-clock-out):
* lisp/org.el (org-evaluate-time-range):
Avoid double-rounding of time-related values. Simplify.
* lisp/org-clock.el (org-resolve-clocks-if-idle):
Use time-since instead of open-coding most of it.
* lisp/org-agenda.el (org-agenda-show-clocking-issues):
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-table.el (org-table-sum):
* lisp/org.el (org-babel-load-file, org-2ft, org-time-stamp)
(org-read-date-analyze, org-time-stamp-to-now):
Simplify.
Note(km): Many of the changes from 476066e89 have been dropped for
compatibility with older Emacsen.
Avoid some double-rounding of Lisp timestamps
476066e89d6f0bb87220da690b8a476bf9655b80
Paul Eggert
Fri Feb 22 18:33:57 2019 -0800
* lisp/org-clock.el (org-clock-out-if-current): Autoload function.
* lisp/org.el (org-todo): Do not call `org-clock-out-if-current' if
`org-clock' is not loaded yet.
* lisp/org-clock.el (org-clock-out-if-current): Ignore narrowing.
* lisp/org.el (org-todo): Call directly previous function instead of
relying on a hook.
Reported-by: Leo Vivier <leo.vivier@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-02/msg00132.html>
* lisp/org-agenda.el (org-agenda-to-appt):
* lisp/org-clock.el (org-clock-resolve-clock)
(org-clock-resolve, org-resolve-clocks-if-idle):
* lisp/org-colview.el (org-columns-edit-value, org-columns)
(org-agenda-columns):
* lisp/org-element.el (org-element--cache-interrupt-p)
(org-element--cache-sync):
* lisp/org-habit.el (org-habit-get-faces)
(org-habit-insert-consistency-graphs):
* lisp/org-indent.el (org-indent-add-properties):
* lisp/org-timer.el ((org-timer-show-remaining-time):
* lisp/org.el (org-babel-load-file, org-current-time)
(org-today, org-auto-repeat-maybe)
(org-small-year-to-year, org-goto-calendar):
* lisp/ox.el (org-export-insert-default-template):
Use nil instead of (current-time) where either will do, as nil is
a bit more efficient and should have less timing error.
Prefer nil to (current-time) when either works
c75f505dea6a560b825384cf3d277690f86840bf
Paul Eggert
Fri Oct 20 19:42:23 2017 -0700
Note(km): The changes that will reverted in the next commit have been
dropped from the ChangeLog entries above.
* lisp/org-clock.el (org-clock-special-range): Use nil to represent
`untilnow'.
* lisp/org-clock.el (org-clocktable-steps): For `untilnow' block, set
set timestamp to 2003.
* doc/org-manual.org (The clock table): Document `untilnow' floor when
used with :step.
For `untilnow', org-clock-special-range sets the start to
"<-50001-11-30 Tue 00:00>", but org-parse-time-string actually assumes
a YYYY-MM-DD format and parses the year as 0001. By chance, this is
still a really old date, so no one noticed. However, with the port of
Emacs's fde99c729c (Port recent org-clock fix to POSIX time_t,
2018-03-28), test-org-clock/clocktable/ranges would fail if the system
supports the oldest date tried, "<-67715-09-22 Tue 17:51>".
But this "encode-time -> format-time-string -> org-parse-time-string"
dance is mostly unnecessary. All the current org-clock-special-range
callers except for org-clocktable-steps (1) explicitly check if the
starting time is nil, (2) don't use the starting time, or (3) pass it
directly to org-clock-sum, which handles nil values. And
org-clock-sum executes the same codepath when nil is passed instead of
"really old date".
Update org-clocktable-steps to use 2003 (the year Org was created) as
the starting point when org-clock-special-range returns nil for the
starting time. This is more efficient because we don't needlessly
calculate steps over a large chunk of time that almost certainly
doesn't have any clocked time. And it won't run into the portability
issues like Emacs's fde99c729c. 2003 _should_ be an appropriate
effective starting date, since we don't expect clocked time before the
existence of Org. If this turns out to be an issue (e.g., someone
converted reports from a pre-Org and still makes clock tables that
include those times), we can make this value configurable.
* lisp/org-clock.el (org-clock-resolve-clock): Store heading location
as marker instead of raw position to ensure that org-clock-in is
called in the correct buffer.
This fixes a regression introduced by 503ede74b (org-clock: Fix
resolving clocks, 2018-12-06).
* lisp/org.el (org-dynamic-block-insert-dblock,
org-dynamic-block-alist, org-dynamic-block-functions,
org-dynamic-block-types, org-dynamic-block-define,
org-dynamic-block-function): New variables, New functions.
* lisp/org-keys.el (org-dynamic-block-insert-dblock): Add binding for
the function.
(org-clock-report, org-columns-insert-dblock): Remove function
keybindings. Mark them as obsolete.
* doc/org-manual.org (Dynamic Blocks): : Add manual for dispatch
command `org-dynamic-block-insert-dblock'.
* testing/lisp/test-org-clock.el: New test.
* lisp/org-clock.el (org-clock-resolve-clock): Fix resolving clocks
when the entry is empty barring the clock itself and possibly the
clock drawer, and `org-clock-out-remove-zero-time-clocks' is
non-nil.
* lisp/org-clock.el (org-clocktable-steps): new fn
org-clocktable-increment-day to add/subtract days that are not
exactly 24 hours
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/step): Add
test for DST.
The default limit of 35 was hard-coded, and was especially annoying
when using an alternative way of selecting from history,
e.g. https://github.com/unhammer/org-mru-clock.
* lisp/org-clock.el (org-clock-in): Use `org-get-heading' so one can
select an empty task. Also check base buffer instead of comparing
current buffer. Small refactoring.
Reported-by: Robert Irelan <rirelan@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00116.html>
* lisp/org.el (org-effort-duration): Remove unused variable.
* lisp/org-compat.el (org-effort-durations): Make
`org-effort-duration' an alias for `org-duration-units'.
* lisp/org-clock.el (org-clock-modify-effort-estimate): Fix docstring.
* doc/org-manual.org (Footnotes): Clarify footnote.
The variable is inactive since introduction of "org-duration" library.
* lisp/org-clock.el (org-clock-jump-to-current-clock): Add a
docstring, do not use as a command and throw a user error
instead of an error when no clock is active.
* lisp/org-clock.el (org-clocktable-defaults)
(org-clocktable-write-default, org-clock-get-table-data):
Rename :tags to :match and use :tags to insert a column with
the headline's tags.
Thanks to Raymond Zeitler for suggesting this.
* lisp/org-clock.el (org-clock--mode-line-heading): Strip
links from the heading.
This restores the previous behavior before commit 66554298.
Thanks to Matt Lundin for reporting this.
* lisp/org-capture.el (org-capture-finalize): Refresh clock mode line.
* lisp/org-clock.el (org-clock--mode-line-heading): New function.
(org-clock-get-clock-string): Small refactoring.
(org-clock-update-mode-line): Add optional argument. Use new function.
(org-clock-in): Use new function.