This package provides automated org-clock-in and org-clock-out by adding Doing tag to a heading of an org mode buffer. While the Doing tag appears in an org buffer, Emacs Org mode maintains the task clocking.
You can say “I’m on it!”.
Please put org-onit.el into your load-path.
If you use package.el or other package manager, no necessary to add (require 'org-onit) to your init.el and just call toggle commands org-onit-toggle-doing or org-onit-toggle-auto in an org buffer.
It is recommended to install org-bookmark-heading because a normal jump by built-in bookmark.el is not sufficiently accurate for org buffers. org-bookmark-heading provides more precise jumping capability by adding ID property to each org mode heading. org-onit.el will use org-bookmark-heading if available but not mandatory.
(with-eval-after-load "org-clock"
(setq org-clock-out-remove-zero-time-clocks t))(with-eval-after-load "org"
(global-set-key (kbd "C-<f11>") 'org-clock-goto)
(define-key org-mode-map (kbd "<f11>") 'org-onit-toggle-doing)
(define-key org-mode-map (kbd "M-<f11>") 'org-onit-toggle-auto)
(define-key org-mode-map (kbd "S-<f11>") 'org-onit-goto-anchor))You can freely arrange org-clock-frame-title-format. If you install org-clock-toay.el in your system, then you can show a working time only for today.
(with-eval-after-load "org"
(add-to-list 'org-tag-faces '("Doing" :foreground "#FF0000"))
(add-hook 'org-cycle-hook #'org-onit-clock-in-when-unfold))
(with-eval-after-load "org-clock"
(setq org-clock-clocked-in-display 'frame-title) ;; or 'both
(setq org-clock-frame-title-format
'((:eval (format "%s|%s| %s"
(if org-onit--auto-clocking "Auto " "")
(org-onit-get-sign)
org-mode-line-string)))))If you apply the above recommended keybindings, then just type <f11> in an org buffer. A tag of a heading having the cursor will be changed to Doing and automatically start to org-clock-in. You can go any buffers and do anything but you can go back to the Doing tagged heading by just typing C-<f11>. Typing <f11> again, then org-clock-out is executed and Doing tag will disappear. When you type S-<f11>, you can go back to the original position you are jumped from.
org-clock-in will be called when:
- calling
org-onit-toggle-doingif the task is notDONE - calling
org-onit-toggle-doingat any headings if:wakeupoforg-onit-basic-optionsisdoingorboth - unfolding a heading if
:unfoldoforg-onit-basic-optionsis non-nil
org-clock-out will be called when:
- calling
org-onit-toggle-doing - making the task
DONEor removing todo state
Use M-x org-onit-toggle-auto. Toggling org-clock-in and org-clock-out will be done automatically no need to toggle Doing tag by yourself.
org-clock-in will be called when:
- visiting a heading if the task is not
DONE - visiting a heading if
:nostateoforg-onit-basic-optionsisautoorbothand the task is notDONE - making the task not
DONE
org-clock-out will be called when:
- switching to other headings if the task has a todo state (e.g.
TODO) - switching to other headings if
:nostateoforg-onit-basic-options=isautoorbothand the task is notDONE - making the task
DONE - calling
org-onit-toggle-doing
- org-onit-wakeup-done (
deprecated, useorg-onit-basic-options)- Allow switching to
org-clock-inbyorg-onit-toggle-doingwhen the heading is DONE. - Default: nil
- Allow switching to
- org-onit-include-no-state-heading (
deprecated, useorg-onit-basic-options)- Allow switching to
org-clock-inin any headings except headings in TODO whenorg-onit-toggle-autois used - Default: nil
- Allow switching to
- org-onit-basic-options
- This variable is buffer-local. Please use
setq-defaultorcustom-set-variablesin your init.el. :wakeupallows switching toorg-clock-inwhen the heading is DONE.:nostateallows switching toorg-clock-inin any headings except headings in TODO:unfoldallows switching toorg-clock-inwhen unfolding a heading- Default: (
:wakeupnil:nostatenil:unfoldnil):wakeupand:nostatecan takedoing,auto,both, andnil- If
doingis specified, the option will be used inorg-onit-toggle-doing - If
autois specified, the option will be used inorg-onit-toggle-auto - If
bothis specified, the option will be used inorg-onit-toggle-doingandorg-onit-toggle-auto
- If
:unfoldcan taketornil- But
:wakeupand:nostateare given priority over:unfold
- But
- This variable is buffer-local. Please use
- org-onit-encure-clock-out-when-exit
- Call
org-clock-outwhen killing Emacs iforg-clock-persisis nothistoryornil - Default: t
- Call
- org-onit-keep-no-state
- If non-nil, allow clocking in but keep the heading TODO state none
- If nil and
:nostateoforg-onit-basic-optionsis specified as non-nil, then the subtree will be changed to TODO heading state and clock-in - Default: t
- org-onit-update-options
org-onit-basic-options ;; (:wakeup nil :nostate nil :unfold nil) (org-onit-update-options '(:nostate doing :unfold t)) ;; update the local variable org-onit-basic-options ;; (:wakeup nil :nostate doing :unfold t)
- org-onit-switch-task-hook
- org-onit-start-autoclock-hook
- org-onit-stop-autoclock-hook
- org-onit-after-jump-hook
(defun my-onit-reveal () (org-reveal) (org-cycle-hide-drawers 'all) (org-show-entry) (show-children) (org-show-siblings)) (add-hook 'org-onit-after-jump-hook #'my-onit-reveal)
- cask
- install via brew
brew install cask - manual install
cd ~/ hub clone cask/cask export PATH="$HOME/.cask/bin:$PATH"
- install via brew
Below operation flow is recommended.
make # Install git-hooks in local .git
git branch [feature-branch] # Create branch named [feature-branch]
git checkout [feature-branch] # Checkout branch named [feature-branch]
# <edit loop>
emacs org-onit.el # Edit something you want
make test # Test org-onit
git commit -am "brabra" # Commit (auto-run test before commit)
# </edit loop>
hub fork # Create fork at GitHub
git push [user] [feature-branch] # Push feature-branch to your fork
hub pull-request # Create pull-request- 1.0.7 (2019-09-30)
- [new]
org-onit-update-optionsis added to updateorg-onit-basic-options - [deprecated]
org-onit-toggle-optionswill beorg-onit-basic-options
- [new]
- 1.0.6 (2019-09-29)
- [improved] Make
org-onit-toggle-optionsbuffer local
- [improved] Make
- 1.0.5 (2019-09-26)
- [new]
org-onit-clock-in-when-unfoldis now public function
- [new]
- 1.0.4 (2019-09-25)
- [new]
org-onit-keep-no-stateis added
- [new]
- 1.0.3 (2019-09-24)
- [improved]
org-onit-use-unfold-as-doingis integrated toorg-onit-toggle-options - [deprecated]
org-onit-use-unfold-as-doing
- [improved]
- 1.0.2 (2019-09-12)
- [new]
org-onit-toggle-optionsis introduced - [improved]
org-clock-in-switch-to-stateis reflected toorg-onit-todo-state - [deprecated]
org-onit-wakeup-done - [deprecated]
org-onit-include-no-state-heading
- [new]
- 1.0.1 (2019-09-01)
- [improved] Rename “todo status” to “todo state”
- [breaking change] rename to
org-onit-include-no-state-heading - [new] support to clock-out when removing todo state
- 1.0.0 (2019-09-01)
- initial release
