Commit Graph

828 Commits

Author SHA1 Message Date
Marcin Borkowski d229dd9662 Lift the artificial limit on the clock history length.
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.
2018-10-03 12:50:05 +02:00
Nicolas Goaziou a2636b5286 org-clock: Fix `org-clock-in' with (4) argument.
* 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>
2018-07-17 10:54:28 +02:00
Robert Irelan fda1d27610 org-clock: Properly handle `org-extend-today-until' in clock tables
* lisp/org-clock.el (org-clock-special-range): Handle non-default
   `org-extend-today-until' when generating a clock table with the
   `:block` directive.

 Reported-by: Robert Irelan <rirelan@gmail.com>
 <http://lists.gnu.org/archive/html/emacs-orgmode/2018-04/msg00294.html>
2018-06-27 08:31:38 +02:00
Nicolas Goaziou accf99cbc0 Deprecate `org-effort-durations'
* 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.
2018-06-25 17:13:04 +02:00
Nicolas Goaziou 58b512013e org-clock: Fix `org-clock-display'
* lisp/org-clock.el (org-clock-put-overlay): Do not expand links when
  displaying clocked times.

Reported-by: Sheng Yang (杨圣) <yangsheng6810@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00024.html>
2018-06-23 23:55:01 +02:00
Nicolas Goaziou 0dda9bf1c1 Mark `org-get-indentation' as obsolete
* lisp/org-macs.el (org-get-indentation): Move function...
* lisp/org-compat: ... here.
* lisp/ob-core.el (org-babel-demarcate-block):
(org-babel-insert-result):
(org-babel-update-block-body):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/org-agenda.el (org-agenda-get-some-entry-text):
* lisp/org-capture.el (org-capture-place-item):
* lisp/org-clock.el (org-clock-in):
* lisp/org-element.el (org-element-swap-A-B):
* lisp/org-feed.el (org-feed-format-entry):
* lisp/org-indent.el (org-indent-add-properties):
* lisp/org-list.el (org-in-item-p):
(org-list-struct):
(org-list-struct-apply-struct):
(org-list-item-body-column):
(org-toggle-item):
* lisp/org-src.el (org-src--edit-element):
* lisp/org.el (org-fixup-indentation):
(org-cdlatex-environment-indent):
(org--get-expected-indentation):
(org-indent-region):
(org-toggle-fixed-width):
* lisp/ox.el (org-export-expand-include-keyword): Use
  `current-indentation' instead.
2018-05-09 01:26:31 +02:00
Nicolas Goaziou 9d8aade7ec Mark `org-with-silent-modifications' as obsolete
* lisp/org-clock.el (org-clock-sum):
* lisp/org-colview.el (org-columns--display-here):
(org-columns-remove-overlays):
(org-columns-quit):
(org-columns-edit-value):
(org-columns--compute-spec):
(org-columns-compute-all):
(org-agenda-colview-compute):
* lisp/org-indent.el (org-indent-remove-properties):
(org-indent-add-properties):
* lisp/org.el (org-sort-entries):
(org-refresh-properties):
(org-refresh-category-properties):
(org-refresh-stats-properties):
(org-agenda-prepare-buffers): Do not use
`org-with-silent-modifications'.
2018-04-29 12:02:01 +02:00
Bastien 1933d9ef26 org-clock.el (org-clock-jump-to-current-clock): Tiny enhancements
* 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.
2018-04-28 12:23:26 +02:00
Bastien f80f7ed98b org-clock.el: New option :tags to insert tags in clock reports
* 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.
2018-04-26 20:55:27 +02:00
Nicolas Goaziou f05493504a Replace `org-get-tags-at' with `org-get-tags'
* contrib/lisp/org-drill.el (org-part-of-drill-entry-p):
* lisp/org-agenda.el (org-agenda-finalize):
(org-search-view):
(org-agenda-get-todos):
(org-agenda-get-timestamps):
(org-agenda-get-sexps):
(org-agenda-get-progress):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled):
(org-agenda-get-blocks):
(org-agenda-change-all-lines):
* lisp/org-bibtex.el (org-bibtex-headline):
* lisp/org-clock.el (org-clock-get-table-data):
* lisp/org-pcomplete.el (org-get-tags):
* lisp/org.el (org-trust-scanner-tags):
(org-get-local-tags-at):
(org-get-local-tags):
(org-set-tags):
(org-map-entries):
(org-entry-properties): Use `org-get-tags' instead of
`org-get-tags-at'.
2018-04-19 11:51:54 +02:00
Nicolas Goaziou 5ad085f34c Merge branch 'maint' 2018-03-06 10:15:22 +01:00
Nicolas Goaziou 9449939ca0 org-clock: Fix face for clock overruns
* lisp/org-clock.el (org-clock-get-clock-string): Fix 6655429b8.

Reported-by: Luke <mideniko1234-org@yahoo.co.uk>
<http://lists.gnu.org/r/emacs-orgmode/2018-03/msg00078.html>
2018-03-06 10:13:12 +01:00
Bastien 902148a967 Merge branch 'maint' 2018-03-04 21:22:32 +01:00
Bastien 74f6ed1eb0 org-clock.el: Strip bracket links from the heading
* 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.
2018-03-04 21:21:00 +01:00
Nicolas Goaziou 79b36b6a8d Merge branch 'maint' 2018-02-21 15:04:37 +01:00
Nicolas Goaziou 6655429b8d org-capture: Refresh clock mode line when finalizing capture
* 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.
2018-02-21 15:02:33 +01:00
Kyle Meyer 47908228e7 Merge branch 'maint' 2018-02-18 16:33:04 -05:00
Glenn Morris ec8590d5e2 Backport commit 69107f347 from Emacs
; Fix doc typos related to indefinite articles
69107f347b3ac7f51cd22333f57393fd735915f2
Glenn Morris
Fri Feb 16 17:33:57 2018 -0500
2018-02-18 16:32:41 -05:00
Nicolas Goaziou af824a9b39 Merge branch 'maint' 2018-02-14 18:00:38 +01:00
Nicolas Goaziou 1a5151c51d org-clock: Fix default clocktable properties priority
* lisp/org-clock.el (org-clock-report): Improve docstring.  Refactor
  code.  Ensure user-defined properties have precedence over automatic
  ones.

Reported-by: Tyler Smith <tyler@plantarum.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00215.html>
2018-02-14 17:57:21 +01:00
Nicolas Goaziou cdacaa5e87 Merge branch 'maint' 2018-02-04 23:33:41 +01:00
Jose Robins e6f891e7aa org-clock.el: Add an autoload entry for the function org-clock-sum-today
* 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
2018-02-04 23:32:59 +01:00
Nicolas Goaziou 4b2006db3d Merge branch 'maint' 2018-02-01 22:43:19 +01:00
Nicolas Goaziou 0790855c93 org-clock: Fix remnant UTC time in clock computation
* lisp/org-clock.el (org-clock-get-sum-start): Remove wrong UTC
  reference.

Reported-by: Jose Robins <jose.robins@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00018.html>
2018-02-01 22:40:39 +01:00
Nicolas Goaziou cafa08334a Merge branch 'maint' 2018-01-21 23:27:05 +01:00
Jack Henahan ffa5f3c519 org-clock: Improve `untilnow' range behavior and performance
* 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
2018-01-21 23:26:22 +01:00
Nicolas Goaziou 0155441358 Merge branch 'maint' 2018-01-19 18:22:00 +01:00
Tim Landscheidt b289a65be7 Use https for links to orgmode.org
TINYCHANGE
2018-01-19 18:14:58 +01:00
Nicolas Goaziou d30bea7cee Fold CLOCK and LOGBOOK drawers upon creating them
* 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'.
2018-01-10 15:58:21 +01:00
Nicolas Goaziou 4403d4685e Give drawers their own invisibility spec
* 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.
2018-01-10 15:58:21 +01:00
Aliaksey Artamonau 0a8711a0a5 org-clock.el: Fix one time continuous clock in
* 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
2018-01-10 12:48:28 +01:00
Nicolas Goaziou 8c7a14a850 org-clock: Consider hours when splitting the table with :steps
* lisp/org-clock.el (org-clocktable-steps): Check time when :tstart
  and :tend are defined.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/step): Add
  tests.

Reported-by: savoie@nsidc.org
<http://lists.gnu.org/r/emacs-orgmode/2018-01/msg00227.html>
2018-01-09 19:47:39 +01:00
Nicolas Goaziou 3566a3eeee org-clock: Fix `org-clock-display' called with `C-u C-u C-u'
* lisp/org-clock.el (org-clock-display): Compute H and M when
  necessary.
2018-01-08 15:22:33 +01:00
Nicolas Goaziou 9c675b0727 org-clock: Small fixes
* lisp/org-clock.el (org-clock-display-default-range): Improve
  docstring.  Add :safe keyword.
(org-clock-display): Fix comparison function.
2018-01-08 14:59:53 +01:00
Kyle Meyer 3e1641ef0a Update copyright years 2018-01-07 00:27:54 -05:00
Nicolas Goaziou 76ee7b7cdd org-clock: Allow CLOCK_MODELINE_TOTAL inheritance
* lisp/org-clock.el (org-clock-get-sum-start): Allow
  CLOCK_MODELINE_TOTAL inheritance.
2018-01-03 22:54:28 +01:00
Nicolas Goaziou bac8d25441 org-clock: Fix timezone in `org-clock-get-sum-start'
* lisp/org-clock.el (org-clock-get-sum-start): Remove timezone
  argument from `encode-time'.

Reported-by: Ihor Radchenko <ihor_radchenko@mymail.sutd.edu.sg>
<http://lists.gnu.org/r/emacs-orgmode/2017-12/msg00499.html>
2017-12-22 19:19:49 +01:00
Nicolas Goaziou 2faaacfeeb Revert the whole time zone mess
* lisp/org.el (org-time-string-to-time):
(org-time-string-to-seconds): Remove optional ZONE argument.
(org-2ft):
(org-check-before-date):
(org-check-after-date):
(org-check-dates-range):
(org-parse-time-string):
* lisp/org-clock.el (org-clock-get-sum-start):
(org-clock-out):
(org-clock-timestamps-change):
(org-clock-sum):
(org-clock-update-time-maybe):
* lisp/org-colview.el (org-columns--age-to-minutes): Apply change.
* testing/lisp/test-org-clock.el (org-test-clock-create-clock):
(test-org-clock/clocktable/scope):
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Apply change.  Simplify tests to avoid daylight saving time issue.
2017-12-03 08:57:37 +01:00
Charles A. Roelli 18af0f88d7 Backport commit 98288ecaf from Emacs
* 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
2017-11-13 22:07:59 -05:00
Georgiy Tugai 07f939f419 org-clock: Fix clock report sometimes ignoring hours before :wstart
* 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
2017-10-08 10:53:39 +02:00
Charles A. Roelli 24ea1b136a Backport commit bd49b6f1b from Emacs
* lisp/org-clock.el (org-clock--oldest-date): Only execute
'decode-time' on times later than year -2**31 under macOS 10.6.
See Bug#27706.

Workaround for faulty localtime() under macOS 10.6
bd49b6f1b39cffeaf6098bc7b0182552683b1c07
Charles A. Roelli
Sun Oct 1 19:07:22 2017 +0200
2017-10-01 20:46:11 -04:00
Nicolas Goaziou 4fdac06ef1 org-clock: Fix compilation error
Reported-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-09/msg00623.html>
2017-09-29 22:01:29 +02:00
Paul Eggert ff0dcf52a5 Backport commit bc511a64f from Emacs
Prefer HTTPS to FTP and HTTP in documentation
bc511a64f6da9ab51acc7c8865e80c4a4cb655c2
Paul Eggert
Wed Sep 13 15:54:37 2017 -0700
2017-09-17 00:28:38 -04:00
Nicolas Goaziou 748bfee34a org-clock: Remove interactive from `org-clock-select-task'
* lisp/org-clock.el (org-clock-select-task): Remove `interactive'.

This function is not meant to be called interactively.  Use
`org-clock-goto' with a prefix argument instead.
2017-08-14 11:17:44 +02:00
Galen Menzel 3359e05e82 Implement `org-decode-time' for backward compatibility
* lisp/org-compat.el (org-decode-time): New function.
* lisp/org-clock.el (org-clock-get-sum-start): Use new function.

Emacs 24's `decode-time' doesn't accept two arguments.
2017-08-11 15:07:45 +02:00
Nicolas Goaziou 2bc39af847 Merge branch 'maint' 2017-08-07 13:30:19 +02:00
Nicolas Goaziou b561c8b7ef org-clock: Fix typo in last commit
* lisp/org-clock.el (org-clock-get-sum-start): Fix typo.
2017-08-07 13:29:52 +02:00
Nicolas Goaziou 5c1d9c53f0 Merge branch 'maint' 2017-08-07 13:27:39 +02:00
Nicolas Goaziou 43a1d5e920 org-clock: Fix `org-clock-get-sum-start'
* lisp/org-clock.el (org-clock-get-sum-start): Return time as UTC.

Reported-by: Josh Moller-Mara <jmm@CNS.NYU.EDU>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00128.html>
2017-08-07 13:25:20 +02:00
Nicolas Goaziou 569b7d105c Merge branch 'maint' 2017-08-05 15:38:13 +02:00