Commit Graph

517 Commits

Author SHA1 Message Date
Bastien Guerry 62064c73fc org-clock.el: Fix clock overlays bug
* org-clock.el (org-clock-put-overlay): Put the overlay on the
whole headline, not only on the last character.  This fixes a
bug with overlays on headlines ending with a bracketed link.

Thanks to Ryan Kaskel for reporting this.
2012-08-19 08:01:43 +02:00
Bastien Guerry 09743f48d6 Fix many small typos. 2012-08-13 05:59:44 +02:00
Bastien Guerry 70dd1196d2 Massive code clean-up.
Delete trailing whitespaces.
Indent all sexps correctly.
Sentences end with double spaces.
2012-08-11 19:10:44 +02:00
Bastien Guerry 002b700cb3 Use ̀org-looking-back' instead of `looking-back' to keep compat with XEmacs
* org-clock.el (org-clock-cancel): Use `org-looking-back'.

* org-pcomplete.el (org-thing-at-point): Ditto.

* org.el (org-timestamp-change): Ditto.
2012-08-10 15:02:45 +02:00
Bastien Guerry bc19977534 org-clock.el: Let C-u M-x org-clock-out RET now prompts for a state to switch to
* org-clock.el (org-clock-in): Call `org-clock-out' with the
new argument `switch-to-state' set to nil.  Fix docstring.
(org-clock-in-last): Prompt for a todo state to switch to when
called with three universal prefix arguments.  Don't display a
message when the clock is already running.  Update docstring.
(org-clock-out): New argument `switch-to-state'.  When this
argument is non-nil, prompt for a state to switch the clocked
out task to, overriding `org-clock-out-switch-to-state'.
2012-08-09 14:52:38 +02:00
Bastien Guerry de271e3751 Introduce a new special property CLOCKSUM_T for today's clocked time.
* org.el (org-special-properties): New special property
CLOCKSUM_T.
(org-entry-properties): Handle the new special property.

* org-colview.el (org-columns): Handle a new special property
CLOCKSUM_T.
(org-agenda-colview-summarize, org-agenda-colview-compute):
Ditto.

* org-clock.el (org-clock-sum-today): New function.
(org-clock-sum): New argument PROPNAME to set a custom text
property instead of :org-clock-minutes.

* org.texi (Special properties, Column attributes)
(Agenda column view): Document the new special property
CLOCKSUM_T.

Thanks to Brian Wood who asked a question wrt this.
2012-08-05 11:12:04 +02:00
Bastien Guerry 42d2552a83 Check for the existence of the x11idle command only once.
* org-clock.el (org-x11idle-exists-p): New variable.
(org-user-idle-seconds): Use it.
2012-07-28 11:53:05 +02:00
Bastien Guerry 0102b4b404 Revert "org-clock.el (org-user-idle-seconds): Simplify."
This reverts commit f398b9ee53.
2012-07-28 08:35:04 +02:00
Achim Gratz c2735e7c19 Re-apply (correctly): Move org-element.el from contrib/lisp to lisp/.
* org.el (org-mode-map): Add keybindings to
`org-element-transpose' and `org-narrow-to-element'.
(org-metaup): Fall back on `org-element-drag-backward'.
(org-metadown): Fall back on `org-element-drag-forward'.
Also move chunks of declarations and require statements to
get rid of compiler warnings.

* org-exp-blocks.el (org): Don't require org.  Add declarations.

* org-clock.el (org): Don't require org.

* ob-exp.el (org-list-forbidden-blocks): Add declarations.
2012-07-28 07:06:25 +02:00
Achim Gratz 234df465ad Revert "Move org-element.el from contrib/lisp to lisp/."
This reverts commit abbea59611.
2012-07-28 07:02:21 +02:00
Bastien Guerry f398b9ee53 org-clock.el (org-user-idle-seconds): Simplify.
* org-clock.el (org-user-idle-seconds): Simplify.

Thanks to Nick Dokos for paving the way (all the way down).
2012-07-28 01:42:59 +02:00
Bastien Guerry abbea59611 Move org-element.el from contrib/lisp to lisp/.
* org.el (org-mode-map): Add keybindings to
`org-element-transpose' and `org-narrow-to-element'.
(org-metaup): Fall back on `org-element-drag-backward'.
(org-metadown): Fall back on `org-element-drag-forward'.
Also move chunks of declarations and require statements to
get rid of compiler warnings.

* org-exp-blocks.el (org): Don't require org.  Add declarations.

* org-clock.el (org): Don't require org.

* ob-exp.el (org-list-forbidden-blocks): Add declarations.
2012-07-28 00:55:45 +02:00
Bastien Guerry 796b4ec43b org-clock.el: Set the marker for `org-clock-history' at a safer position.
* org-clock.el (org-clock-in): Set the marker for
`org-clock-history' at a safer position.

The clock marker stored in `org-clock-history' used to be at the
beginning of the heading.  When manually inserting content here,
the marker is not updated because it is *before* the point.  So
set the clock marker right after the first "*" of the headline
so that it will always be correctly updated.
2012-07-27 17:24:16 +02:00
Eric Schulte 556f725e5b "concat 'string" -> "concat"
Thanks to Achim for pointing out this careless oversight in my last
commit.

* lisp/org-clock.el (org-clock-special-range): "concat 'string" ->
  "concat"
  (org-clocktable-shift): "concat 'string" -> "concat"
2012-07-25 10:53:55 -06:00
Eric Schulte d7a8b6636a replacing cl concatenate with concat
* lisp/org-clock.el (org-clock-special-range): Replacing cl concatenate
  with concat.
  (org-clocktable-shift): Replacing cl concatenate with concat.
2012-07-25 09:24:11 -06:00
Nicolas Calderon Asselin db2bf2a818 Added checks to determine which idle time to use
* lisp/org-clock.el (org-clock-idle-time): Org-mode assumed that x11idle
  was an available command, and returned an idle time of 0 if it was not
  (never idle). Added checks so that org-idle-time will come from emacs'
  own current-idle-time if x11idle cannot be found or if it cannot
  retrieve the idle time from X11

TINYCHANGE
2012-07-24 17:10:10 +02:00
Bastien Guerry fea1b82bef Bind `org-clock-in-last' to C-c C-x C-x and ̀org-clock-cancel' to C-c C-x C-q.
* org.el (org-flag-drawer): Add a docstring.
(org-mode-map): Bind ̀org-clock-cancel' to "C-cC-xC-q" and
`org-clock-in-last' to "C-cC-xC-x".  This fixes a bug in the
previous keybinding for `org-clock-in-last', which would
override the one for `org-clock-in'.

* org-clock.el (org-clock-in-last): Prevent errors when there
is no clocking history.
(org-clock-cancel): Fix bug when checking against a clock log
in a folded drawer.

Thanks to Bernt Hansen who reported the problem.
2012-07-14 08:33:48 +02:00
Bastien Guerry 3ecd7a9ad0 Move `org-clock-out-time' to the right place.
Thanks to Achim Gratz for spotting the compiler warning.
2012-07-13 01:45:49 +02:00
Bastien Guerry 3528fc6b42 Implement continuous clocking. Small other improvements. Update documentation.
* org.el (org-mode-map): Add `C-c C-x C-I' as a keybinding for
`org-clock-in-last'.

* org-clock.el (org-clock-continuously): New option.
(org-clock-in): Three universal prefix arguments set
`org-clock-continuously' to `t' temporarily.
(org-clock-in-last): Fix call to `org-clock-select-task' and
support continuous clocking.
(org-clock-out-time): New variable.
(org-clock-out): set `org-clock-out-time' when clocking out.
Small docstring rewriting.
(org-clock-remove-empty-clock-drawer): Fix "invalid search
bound" bug when trying to delete empty logbook drawer.
(org-clock-cancel): If the clock log is gone, send a warning
instead of deleting the region that is supposed to contain it.

* org.texi (Clocking commands): New cindex.
(Clocking commands): Update documentation for `org-clock-in'.
Document `org-clock-in-last'.  Mention `org-clock-out' and
`org-clock-in-last' as commands that can be globally bound.
(Resolving idle time): Document continuous clocking.
2012-07-12 14:04:54 +02:00
Bastien Guerry d5aa0e0d73 Rename `org-indent-line-function' to `org-indent-line'.
* org.el (org-mode, org-add-log-setup)
(org-get-property-block, org-entry-put)
(org-property-next-allowed-value, org-return)
(org-indent-line): Rename `org-indent-line-function' to
`org-indent-line'.

* org-timer.el (org-timer-item): Ditto.

* org-table.el (org-table-store-formulas): Ditto.

* org-clock.el (org-clock-in, org-clock-find-position): Ditto.
2012-07-11 19:11:26 +02:00
Tim Howe f88679a399 org-clock: Customizable variable syntax fix
* org-clock.el (org-clocktable-defaults): Revert extra layer of quoting.

It appears the goal in 9b23f082 was to allow defaulting a plist member
to a variable; however the plist was being constructed with LIST and
therefore the `, combination was unnecessary.

TINYCHANGE
2012-07-10 11:15:22 +02:00
Bastien Guerry 9780de8b30 org-clock.el (org-clock-in-last): New command.
* org-clock.el (org-clock-in-last): New command.

This autoloaded command provides a way to clock in the last clocked
item stored in `org-clock-history' from any buffer.  This is handy
when you don't want to go back to your .org file to clock into the
last clocked task.
2012-07-06 12:54:43 +02:00
Bastien Guerry 8dd8540f55 org-clock.el (org-clock-in): Fix typo in docstring.
* org-clock.el (org-clock-in): Fix typo in docstring.
2012-07-06 12:34:36 +02:00
Bastien Guerry e32a4777df Merge branch 'maint' 2012-06-03 10:29:09 +02:00
Bastien Guerry 5968047924 Backport changes by Chong Yidong in Emacs trunk (revno 108457).
* org-clock.el (org-clock-string-limit)
(org-clock-modeline-total, org-clock-task-overrun-text)
(org-clock-mode-line-entry): Doc fix, "modeline" -> "mode line".
2012-06-03 10:28:46 +02:00
Achim Gratz 595d451280 use org-no-warnings macro for XEmacs compatibility
* lisp/org-agenda.el: Replace with-no-warnings with
  org-no-warnings (defined in org-macs.el).

* lisp/org-bbdb.el: Replace with-no-warnings with
  org-no-warnings (defined in org-macs.el).

* lisp/org-clock.el: Replace with-no-warnings with
  org-no-warnings (defined in org-macs.el).

* lisp/org.el: Replace with-no-warnings with org-no-warnings (defined
  in org-macs.el).
2012-05-19 09:48:57 +02:00
Bastien Guerry 7c513b3047 New option `org-clock-frame-title-format'.
* org-clock.el (org-frame-title-format-backup): New variable
to store the value of `frame-title-format' before `org-clock'
might replace it by `org-clock-frame-title-format'.
(org-clock-frame-title-format): New option.
(org-frame-title-string): Delete.
(org-clock-update-mode-line): Minor code reformatting.
(org-clock-in, org-clock-out, org-clock-cancel): Use
`org-clock-frame-title-format'.

See http://thread.gmane.org/gmane.emacs.orgmode/55477

Trying to update `frame-title-format' is tricky and error-prone, since
users can set up this variable in many different ways.  AFAIK there is
no equivalent to `global-mode-string' for setting the frame title, we
would use it otherwise.

The user can still configure `org-clock-frame-title-format' the way he
wants.
2012-05-05 14:21:13 +02:00
Bastien Guerry 005576f0b6 org-clock.el (org-clock-get-clock-string): Add a space.
* org-clock.el (org-clock-get-clock-string): Add a space.
2012-05-05 11:30:58 +02:00
Bastien Guerry c306dbe388 org-clock.el: Fix bug in `org-clocktable-write-default'.
* org-clock.el (org-clocktable-write-default): Temporarily
disable `delete-active-region' so that we don't accidently
delete an active region when exporting a subtree/region.

Thanks to Mike McLean for the detailed bug report.
2012-04-29 01:18:35 +02:00
Bastien Guerry 008689cc79 org-clock.el: Use `executable-find' instead of `org-program-exists'.
* org-clock.el (org-program-exists): Remove.
(org-show-notification, org-clock-play-sound): Use
`executable-find' instead of `org-program-exists'.

Thanks to Sébastien Vauban for pointing this.
2012-04-28 23:43:10 +02:00
Bastien Guerry 1c203d8d19 Match #+name/#+tblname/#+tblfm along with uppercase twins.
* org.el: Use (case-fold-search t).
(org-edit-special, org-ctrl-c-ctrl-c): Ditto.

* org-table.el:
(org-table-store-formulas, org-table-get-stored-formulas)
(org-table-fix-formulas, org-table-edit-formulas)
(org-old-auto-fill-inhibit-regexp, orgtbl-ctrl-c-ctrl-c)
(orgtbl-toggle-comment, org-table-get-remote-range): Ditto.

* org-footnote.el:
(org-footnote-goto-local-insertion-point): Ditto.

* org-exp.el: Ditto.

* org-colview.el:
(org-dblock-write:columnview, org-dblock-write:columnview):
Ditto.

* org-colview-xemacs.el:
(org-dblock-write:columnview): Ditto.

* org-clock.el (org-clocktable-write-default): Ditto.

* org-capture.el (org-capture-place-table-line): Ditto.

* ob.el (org-babel-data-names, org-babel-goto-named-src-block)
(org-babel-src-block-names)
(org-babel-where-is-src-block-result, org-babel-result-end)
(org-babel-where-is-src-block-head)
(org-babel-find-named-result, org-babel-result-names): Ditto.
2012-04-23 12:48:33 +02:00
Bastien Guerry ef956d7181 When clocking, Don't modify `frame-title-format' if it is a string.
* org-clock.el (org-clock-out, org-clock-cancel)
(org-clock-in): Don't modify `frame-title-format' if it is a
string.

Thanks to Mike McLean for reporting this and to Matt Lundin for
pointing at the problem in the code.
2012-04-22 09:01:28 +02:00
Bastien Guerry 80cc1ccd9e org-clock.el (org-program-exists): Fix docstring.
* org-clock.el (org-program-exists): Fix docstring.

Thanks to Sébastien Vauban for reporting this.
2012-04-21 12:10:51 +02:00
Bastien Guerry 41939cb04b org-clock.el (org-program-exists): Fix docstring.
* org-clock.el (org-program-exists): Fix docstring.

Thanks to Sébastien Vauban for reporting this.
2012-04-20 13:20:42 +02:00
Bastien Guerry d89823a75b org-clock.el: New option `org-clock-file-time-cell-format'.
* org-clock.el (org-clock-file-time-cell-format): New option.
(org-clocktable-write-default): Use it.
2012-04-20 13:06:46 +02:00
Adam Spiers 1685087f5f org.el: Display a message when no clock is active.
* org-clock.el (org-clock-modify-effort-estimate): Display a
message when no clock is currently active.

TINYCHANGE
2012-04-20 12:41:11 +02:00
George Kettleborough 37fafb7b9e Option for clock and timer to be displayed in frame-title
* 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.
2012-04-20 11:56:34 +02:00
Bastien Guerry 8c4ccab028 Merge branch 'hotfix' 2012-04-11 01:14:39 +02:00
Bastien Guerry 56bd9dc552 org-clock.el: Rename `org-task-overrun*' to `org-clock-task-overrun*'.
* org-clock.el (org-clock-task-overrun-text)
(org-task-overrun, org-clock-get-clock-string)
(org-clock-update-mode-line)
(org-clock-notify-once-if-expired): Rename `org-task-overrun'
and `org-task-overrun-text' to `org-clock-task-overrun' and
`org-clock-task-overrun-text' respectively.
(org-task-overrun-text): New alias.
2012-04-11 01:14:21 +02:00
Bastien Guerry bdd922e3f7 Add :version to org-clock.el options. 2012-04-03 13:27:34 +02:00
Bastien Guerry 7d64e883b0 org-clock.el (org-show-notification): Use `fboundp' instead of `featurep' and the additional `require'.
* org-clock.el (org-show-notification): Use `fboundp' instead
of `featurep' and the additional `require'.

Thanks to Peter Münster for reporting this.
2012-04-02 16:52:16 +02:00
Bastien Guerry 42d60368a3 Merge branch 'hotfix-7.8.06' 2012-04-02 08:07:57 +02:00
Bastien Guerry 3658686f59 Fix name of dynamically bound variable in org-clock.el. 2012-04-02 08:07:52 +02:00
Bastien Guerry e3913a2ab5 Merge branch 'hotfix-7.8.06' 2012-04-02 00:53:37 +02:00
Bastien Guerry 5c38bf0ef7 Fix copyright and authors lines. 2012-04-02 00:53:28 +02:00
Bastien Guerry 967783215b Merge branch 'hotfix-7.8.06'
Conflicts:
	lisp/org.el
2012-03-31 11:04:40 +02:00
Bastien Guerry b46fa17a97 Fix global dynamic variables in org-clock.el.
Thanks to Martyn Jago for this patch.
2012-03-30 22:43:03 +02:00
Bastien Guerry 8ab92f8b55 Delete trailing whitespaces in core files. 2012-03-28 02:05:36 +02:00
Bastien Guerry 7686a81c14 New option to format the total time cells.
* org-clock.el (org-clock-in-prepare-hook): New option to
format the total time cells.
(org-clocktable-write-default): Use the new option.
2012-03-28 00:49:55 +02:00
Bastien Guerry eb7f7159c9 Merge branch 'hotfix-7.8.06' 2012-03-23 13:42:29 +01:00