* org-clock.el (org-clock-sound): Enhance docstring.
(org-notify): Use the parameter `play-sound' as argument for
`org-clock-play-sound'.
(org-clock-play-sound): New optional argument `clock-sound' to
override `org-clock-sound'.
* org.el (org-use-last-clock-out-time-as-effective-time): New option.
(org-current-effective-time): Use the new option.
* org-clock.el (org-clock-get-last-clock-out-time): New
function.
When set to `t', this new option will take the time of the last clock out
timestamp and use it when changing/logging the todo state.
Thanks to Gaizka Villate who suggested this.
* lisp/org-clock.el (org-x11idle-exists-p): Only shell out when running
on X.
The definition of this variable currently executes "command" via the
shell during evaluation, irrespective of the platform on which
Org-mode is running. Unfortunately, on Windows, this matches the
"command.com" NT Virtual DOS Machine executable and so this gets
launched, but this is a shell and therefore sits there waiting for
user input and never returns. The net result is that Emacs will hang
on Windows when evaluating org-clock.el with the ntdvm.exe process
spinning at 100%.
The simple fix is to check that the platform is X before trying to
deal with the "x11idle" external process.
TINYCHANGE
* 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.
* 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'.
* 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.
* 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.
* 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.
* 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.
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"
* 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
* 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.
* 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.
* 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
* 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.
* 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).
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
lisp/org.el (org-scan-tags): Require todo-only argument, and document
that it should be the same one set by make-org-tags-matcher.
Fix documentation to explain that todo-only is really
not-done-todo-only.
(org-make-tags-matcher): If todo part of matcher starts with /!,
matcher now always checks that the TODO keyword is present and
is a not-done state. This matters e.g. for org-map-entries
which unlike org-scan-tags does not do its own separate todo-only
filtering. Added docs to explain matcher dependencies.
(org-map-entries): Make sure todo-only is correctly passed from
org-make-tags-matcher to org-scan-tags.
* lisp/org-clock.el: (org-clock-get-table-data): Make sure todo-only
does not leak when it is set by make-org-tags-macher.
* lisp/org-crypt.el: (org-encrypt-entries, org-decrypt-entries): Make
sure todo-only is correctly passed from org-make-tags-matcher to
org-scan-tags.
* contrib/lisp/contacts.el: (org-contacts-filter) : Make sure todo-only
is correctly passed from org-make-tags-matcher to org-scan-tags.
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.
* lisp/org-clock.el (org-clock-get-table-data): Bind org-scanner-tags
to tags-list and org-trust-scanner-tags to t while evaluating the
matcher, since the matcher is always evaluated at the current entry.
TINYCHANGE
* org-clock.el (org-clock-out): Do not delete the current clocking task
when org-clock-out-hook clocks in another task
My clock out hook keeps the clock running by automatically clocking in
a new task (the parent task, or the default task). This sets a new
clocking task which was then clobbered at the end of org-clock-out
so that J in the agenda would return
"No running clock, use `C-c C-x C-j' to jump to the most recent one"
We now detect that another task is clocked in and skip clearing the
org-clock-current-task variable used by the agenda to determine if
the clock is currently running.
* org-clock.el (org-in-clocktable-p): Moved to org.el.
* org.el (org-in-clocktable-p): New function. Moved from org-clock.el
Fixes a bug reported by suvayu ali in
<CAMXnza2W9VSJ2d-dDmsByNmTVgxnt1Onp=J5S=TsFEi8MOVNtg@mail.gmail.com>.
`org-context' depends on the function but org.el does not depend on
org-clock.el.
Rename `org-on-heading-p' and `org-on-target-p' to
`org-at-heading-p' and `org-at-target-p' to be more
consistent with the org-at-*-p family.
Also define two aliases.
* lisp/org-clock.el (org-clock-out-if-current): Fix marker in no buffer error
for task state change in an indirect buffer
org-clock-out-when-current was enhanced in 098cf35 (Clock: Clock out
when done also in indirect buffers, 2009-03-23) to handle indirect
buffers.
This enhancement uses (buffer-base-buffer (org-clocking-buffer)) but
when not clocking (org-clocking-buffer) returns nil - so
buffer-base-buffer returns the base buffer of the current buffer which
is never nil. This leads to marker in no buffer errors trying to stop
the clock when it is not running.
Now we explicitly check up front that the clock is running before
any other conditions that lead to stopping the clock.
* lisp/org-clock.el (org-clock-in):
(org-clock-find-position): Make space after date optional.
* lisp/org.el (org-set-regexps-and-options):
(org-ts-regexp):
(org-ts-regexp-both):
(org-ts-regexp1):
(org-ctrl-c-ctrl-c): Make `C-c C-c' on date fix the time stamp
* doc/org.texi (Creating timestamps): Document the effect of `C-c C-c'
on a timestamp.
This function by Max Mikhanosha was added accidently. We are
waiting for the FSF to process Max copyright assignement to get
this function in org-mode.
Thanks to Achim Gratz for spotting at this.
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
Use `org-outline-regexp' instead or `outline-regexp'. Also use the
new defconst `org-outline-regexp-bol' to match `org-outline-regexp'
at the beginning of line.
* org.el (org-outline-regexp-bol): New defconst.
(org-outline-level, org-set-font-lock-defaults, org-cycle)
(org-overview, org-content, org-flag-drawer)
(org-first-headline-recenter, org-insert-todo-heading)
(org-map-region, org-move-subtree-down, org-paste-subtree)
(org-kill-is-subtree-p, org-context-p, org-refile)
(org-refile-new-child, org-toggle-comment, org-todo)
(org-add-planning-info, org-add-log-setup, org-scan-tags)
(org-set-tags, org-insert-property-drawer)
(org-prepare-agenda-buffers, org-preview-latex-fragment)
(org-speed-command-default-hook, org-check-for-hidden)
(org-toggle-item, org-toggle-heading)
(org-indent-line-function, org-set-autofill-regexps)
(org-fill-paragraph, org-toggle-fixed-width-section)
(org-yank-generic, org-yank-folding-would-swallow-text)
(org-first-sibling-p, org-goto-sibling)
(org-goto-first-child, org-show-entry): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
* org-remember.el (org-remember-handler): Use
`org-outline-regexp-bol'.
* org-mouse.el (org-mouse-match-todo-keyword, org-mode-hook)
(org-mouse-move-tree, org-mouse-transform-to-outline): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
* org-macs.el (org-with-limited-levels)
(org-get-limited-outline-regexp): Use `org-outline-regexp'.
* org-indent.el (org-indent-outline-re)
(org-indent-refresh-section, org-indent-refresh-to): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
* org-html.el (org-export-as-html): Use
`org-outline-regexp-bol'.
* org-footnote.el (org-footnote-at-definition-p)
(org-footnote-normalize): Use `org-outline-regexp' and
`org-outline-regexp-bol'.
* org-exp.el (org-export-preprocess-string): Don't redefine
`outline-regexp'.
* org-docbook.el (org-export-as-docbook): Use
`org-outline-regexp-bol'.
* org-colview.el (org-columns, org-columns-compute): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
* org-colview-xemacs.el (org-columns, org-columns-compute):
Use `org-outline-regexp-bol'.
* org-clock.el (org-clock-insert-selection-line)
(org-clock-in, org-clock-out, org-dblock-write:clocktable):
Use `org-outline-regexp' and `org-outline-regexp-bol'.
* org-ascii.el (org-export-as-ascii)
(org-export-ascii-push-links): Use `org-outline-regexp' and
`org-outline-regexp-bol'.
* org-archive.el (org-archive-to-archive-sibling)
(org-archive-all-done): Use `org-outline-regexp' and
`org-outline-regexp-bol'.
* org-agenda.el (org-agenda, org-search-view)
(org-agenda-list-stuck-projects, org-agenda-get-timestamps)
(org-agenda-get-progress, org-agenda-get-blocks): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
* org.el (org-shiftcontrolup, org-shiftcontroldown): New
commands to use `org-clock-timestamps-change'.
* org-clock.el (org-clock-timestamps-change)
(org-clock-timestamps-down, org-clock-timestamps-up)
(org-at-clock-log-p): New functions to let the user update
clock log timestamps while keeping the same clock duration.
Thanks to Rainer Stengele for this idea.