* 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-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.
* lisp/org-clock.el: When the org-mode is called for the very first time
any functionality that requires the org-clock-sum-today used to fail.
(e.g. a column that calculates CLOCKSUM_T)
TINYCHANGE
* org-clock.el (org-clock-special-range): Set `untilnow' to use the
year -50000, rather than the earliest representable date.
(org-clock--oldest-date): Remove.
The `untilnow' range relied on the constant `org-clock--oldest-date`
to find the earliest representable date, which caused delays when
loading `org-clock' on systems where `most-negative-fixnum' is large.
This change removes that constant in favor of a simpler hack to
produce a range between the current time and before the dawn of human
civilization. If this breaks your workflow, please report to the Time
Police.
TINYCHANGE
* lisp/org-clock.el (org-clock-find-position): Use a faster call to hide
clock drawer.
* lisp/org.el (org-log-beginning): Make sure logbook drawer is folded as
soon as inserted.
(org-store-log-note): Remove unnecessary call to
`org-cycle-hide-drawers'.
* lisp/org.el (org-mode): Add special invisibility spec for drawers.
(org-show-set-visibility): Handle new invisibility spec.
(org-clean-visibility-after-subtree-move): Fix argument for
`org-cycle-hide-drawers'. `overview' is a no-op.
(org-cycle-hook):
(org-cycle-internal-local):
(org-flag-drawer):
(org-move-subtree-down):
(org-show-entry):
* lisp/org-agenda.el (org-agenda-clock-in):
* lisp/org-clock.el (org-clock-goto):
* lisp/org-feed.el (org-feed-update):
* lisp/org-inlinetask.el (org-inlinetask-toggle-visibility): Do not hide
drawers when expanding a headline.
Drawers and headlines visibility are now unrelated. As a consequence,
there is no need to hide drawers every time a headline is expanded.
* org-clock.el (org-clock-in): Abort after calling `org-clock-in'
recursively with `org-clock-continuously' set.
Without the change the recursive call to `org-clock-in' would
insert a clock of last clock-out, but then the original call
would continue by inserting another clock at
current-time. As a result of that, clocking out uses the latter
of the two clocks and leaves the other one dangling.
TINYCHANGE
* lisp/org-clock.el (org-clock--oldest-date): Fix an issue when
compiling on macOS 10.6 with a western time zone (a continuation of
Bug#27736).
Further workaround for faulty localtime() under macOS 10.6
98288ecaffbc0947ec3193088172ea85ad5e42a5
Charles A. Roelli
Wed Nov 8 20:51:48 2017 +0100
* lisp/org-clock (org-clocktable-steps): Fix weekly-step clock report
ignoring hours between start of period and start of week, when start
of period is on a day of week numerically less than start of week.
Clock report now always inserts a "week" starting at the start of
the period, if necessary; all following weeks start on the start of
the week as expected.
TINYCHANGE