org-modeã§è¨æï¼Clockingï¼ããéã«ç¹å®ã®TODOãã¼ã¯ã¼ãã®å ´åã ãç¶æ å¤æ´ãã
ãã®è¨äºã¯ã.emacs Advent Calendar 2016ã®18æ¥ç®ã®è¨äºã§ãã
org-modeã®å°ãã¿ã§ãã
ã¯ããã«
org-modeã§ã¯TODO管çã®ä¸ã§ããã®ã¿ã¹ã¯ã«ããã£ãæéãè¨æ¸¬ãããã¨ãã§ããããã«ãªã£ã¦ãã¾ãã
C-c C-x C-iâæéè¨æ¸¬ãéå§ãã(clock-in)
C-c C-x C-oâæéè¨æ¸¬ãçµäºãã(clock-out)
ã§ã便å©ãªãã¨ã«ãclock-inããå ´åã«ãèªåã§TODOãã¼ã¯ã¼ããå¤æ´ãããã¨ãã§ãã¾ãã
;; æéè¨æ¸¬ãéå§ãããèªåã§STARTEDç¶æ ã«ãã (setq org-clock-in-switch-to-state "STARTED")
ããããã£ã¦ããã¨ãæªçæã®TODOãçæï¼æéè¨æ¸¬éå§ï¼ããã¨ãSTARETEDã«ãªããçææ¸ãæªçæãããããããããªãã¨ããããã§ãã
Aããã¸ã§ã¯ããéå§ããç¶æ ãAããã¸ã§ã¯ãã¯STARTEDã¨è¡¨ç¤ºãããBããã¸ã§ã¯ãã¯TODOã®ã¾ã¾ã«ãªã£ã¦ãããã¾ããã¢ã¼ãã©ã¤ã³ã«ã¯è¨æãã¦ããã¿ã¹ã¯ã表示ãããã®ã便å©ã
org-captureãæ´»ç¨ããã¨ãã¿ã¹ã¯ã«çæãã¦ããéã«å²ãè¾¼ã¿ï¼é»è©±çï¼ãå ¥ã£ã¦ä¸æãããå ´åã§ããå²ãè¾¼ã¾ãããã®ãå«ãç°¡åã«è¨æãããã¨ãã§ãã¾ãã詳ããã¯ãã¡ãã®éå»è¨äºãã覧ãã ããã
ãã®ããããã§å°ã£ããã¨
ãããªãããªã§ãã£ã¦ãã®ã§ãããå°ã£ããã¨ãããã¾ããã
ãããããã§ãã
æ¬å½ã®TODOããä¸æçã«å®æ½ãã¦ããTODOã§ç¡ãä½æ¥ãããã¼ãã£ã³ã°ã®ãããªè¨æã ããã¦ãããããã®ããã¹ã¦ãclock-inããã¨çSTARTEDç¶æ ã«ãªã£ã¦ãã¾ã£ã¦ãä½ãæ¬å½ã®TODOãªã®ãããããªããªã£ã¦ãã¾ãã®ã§ãï¼ä»åã¯ä¾ã¨ãã¦é©å½ã«ä½ãã¾ããããå®éã¯ãã£ã¨éå¤ãªãã®ã30åè¿ããã¾ã£ã¦ãã¾ãã¾ããï¼ã
æ¬å½ã¯ãGTDã§ã¯æ¥æ¬¡ã¬ãã¥ã¼ãé±æ¬¡ã¬ãã¥ã¼ã¯åºæ¬ãªã®ã§ããã®ä¸ã§ä¸è¦ãªãã®ãå®äºç¶æ ã«ãã¦ããã®ãåºæ¬ãªã®ã§ãããããã¯ãã£ã¦ããããã ããã¾ãã¨çä»ããã®ãé¢åã ããããããè¨æã ãããããã®ããã¡ãã¡å®äºã«å¤æ´ããã®ãé¢åã ããã¨ãããã¨ã§ãã¢ããã¼ã·ã§ã³ãããªãä¸ãã£ã¦ãã¾ãã¾ããã
è¨æã ããã¦ãTODOã§ãªããã®ã¯ãTODOãã¼ã¯ã¼ããããªãããã«ã§ããªãã ããããã¨è«ã®è¯ããã¨ãèãã¦ãã¾ããã
ãããªé½åã®ãããããã
å®ã¯org-clock-in-switch-to-stateã«ã¯é¢æ°ãæå®ãããã¨ãã§ãã¾ãï¼ã§ãããã¨èªä½ã¯ç¥ã£ã¦ããã©ããããããããããæå³ãããã£ã¦ãªãã£ãï¼ã
;; æéè¨æ¸¬ãéå§ãããSTARTEDç¶æ ã« (setq org-clock-in-switch-to-state 'my-org-clock-in-switch-to-state) ;;; TODOã®å ´åã ãSTARTEDã«å¤æ´ãã (defun my-org-clock-in-switch-to-state (state) (when (or (string-equal state "TODO") (string-equal state "STARTED")) "STARTED"))
my-org-clock-in-switch-to-stateã«ã¯åã®ç¶æ ã®TODOãã¼ã¯ã¼ããå ¥ã£ã¦ããã®ã§ãTODOãæ¢ã«STARTEDã®å ´åã®ã¿"STARTED"ãè¿ãããã«ãªã£ã¦ãã¾ãï¼ããããè¦ç´ãã¨STARTEDãæ¡ä»¶ã«å ¥ããå¿ è¦ãªããããããããªãå ´åã¯stateããã®ã¾ã¾è¿ããã»ããããã®ããªï¼ï¼
ããããã¨ãããªæãã§ãTODOã«è¨å®ãã¦ããªãå ´åã¯ãSTRATEDãè¨å®ãããªãã®ã§ãorg-agendaãæ±ããªãã§è¯ããããã
ã¾ã¨ã
ä»ã®äººã®.emacsãèªãã§ã¦ç¥ã£ãã®ã ãã©ããªããããªè¨å®ããã¦ããã®ãæ³åããªããèªãã¨åå¼·ã«ãªãã
ææ¥ã¯takaxpããã®ãé«éèµ·åç¨ãããã *scratch*ãããã¡ãã®äºå®ã§ãã楽ãã¿ã§ããã