org-mode + remember-mode ã§Emacså ã§ç¬æã«ã¡ã¢ãããâã³ã¼ããªã¼ãã£ã³ã°ã«çããã»ã¡ã¢æ¤ç´¢ãã
Emacsã§å³åº§ã«ã¡ã¢ãåãæ¹æ³ã¯ãããããããæ¥æ¬ãªãã°Howmã¨ãChangeLogã¡ã¢ã人æ°ãªã®ããªã俺ã¯org-mode + remember-modeã使ã£ã¦ããã
org-rememberãã¤ã³ã¹ãã¼ã«ãã
remember-modeã¯é ã®ä¸ã§æãä»ãããã®ãå³åº§ã«ã¡ã¢ãããããã®ã·ã³ãã«ã§ä¾¿å©ãªãã¼ã«ã ãM-x rememberã§ã¡ã¢ç¨ãããã¡ããããã¢ãããããããã¡ã¢ãæ¸ãã¦C-c C-cãæ¼ãã°è¨é²ããããããã ããhttps://gna.org/p/remember-el ãªããapt-get install remember-elããªãã§ã¤ã³ã¹ãã¼ã«ãã¦ã¿ããã
org-modeã¯outline-modeã®è¶
è¶
æ¡å¼µçã ããã¨ãã¨æ§é åããã¹ããæ±ããã®ã ã£ãã®ããæ¬æ ¼çãªã¢ã¦ãã©ã¤ã³ããã»ããµã«ãªã£ã¦ããããTODO管çãäºå®è¡¨ãã¹ãã¬ããã·ã¼ãï¼ã¾ãã§è¡¨è¨ç®ã§ããï¼ï¼ãªã©ã¨çµã³ä»ãã¦ãããEmacs22ã«æ¨æºæ·»ä»ãªã®ã ããæ¥é²ææ©ã§éçºãé²ãããã¦ããã®ã§ãgitãªãã¸ããªããã¤ã³ã¹ãã¼ã«ããã°ããã ããããã¾ãã«é«æ©è½ããã¦ã©ãããæãã¤ããã°ããã®ãããããªãã¨æãããã¾ãã¯ãã ã®ã¢ã¦ãã©ã¤ã³ããã»ããµãTODO管çã¨ãã¦ä½¿ã£ã¦ã¿ãã¨ãããæ
£ãããGTDãã§ããããEmacsã§æç« ãæ¸ã人ã¯org-modeã®ä½¿ç¨æ¹æ³ãç¿å¾ãã¦ããã¦æã¯ãªãã
$ git clone git://repo.or.cz/org-mode.git
org-modeã«ã¯remember-modeã¨ã®åããæã§ããorg-rememberã³ãã³ããå®ç¾©ããã¦ãããããã使ãã°ç¹å®ã®ãã¡ã¤ã«ã®ç¹å®ã®å ´æã«ã¤ãã¤ãã¨ã¡ã¢ãè¨é²ãããã¨ãã§ããããææ°çã®org-modeã§ãããªè¨å®ããã¦ã¿ããã
(require 'org-install) (setq org-startup-truncated nil) (setq org-return-follows-link t) (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) (org-remember-insinuate) (setq org-directory "~/memo/") (setq org-default-notes-file (concat org-directory "agenda.org")) (setq org-remember-templates '(("Todo" ?t "** TODO %?\n %i\n %a\n %t" nil "Inbox") ("Bug" ?b "** TODO %? :bug:\n %i\n %a\n %t" nil "Inbox") ("Idea" ?i "** %?\n %i\n %a\n %t" nil "New Ideas") ))
org-rememberã使ã£ã¦ã¿ã
ãã®ç¶æ ã§M-x org-rememberãå®è¡ããã¨ã
Select template: [t]odo [b]ug [i]dea
ãªãã¦ããã³ãããã¨ã³ã¼ã¨ãªã¢ã«è¡¨ç¤ºãããã®ã§ãtãããbãããiãã®ã©ãããé¸æãããããããããtodoãããbugãããideaãã«ç¸å½ããããããã¨ãæãä»ããããtããæ¼ããããã¨ã*Remember*ãããã¡ãåºã¦ããã®ã§ã¿ã¤ãã«ã¨ä¸èº«ï¼æ¸ããªãã¦ãããï¼ãæ¸ãã¦C-c C-cã§ç»é²ã§ããã
親åãªãã¨ã«ããããããªç»é²æ¹æ³ããããã¡ã«æ¸ãã¦ãã^^ æ¸ãè¾¼ã¾ãããã¡ã¤ã«ã¯ ~/memo/agenda.org ã ãéãã¦ã¿ãã¨ããInboxãã¨ããè¦åºãã®ä¸ã§ãã¦ãã¨ãã¨ããé
ç®ãç»é²ãããã®ãããããã¡ã¢ããã¹ã¦ã²ã¨ã¤ã®ãã¡ã¤ã«ã«ç½®ãã¦ãããã¨ã§ã¡ã¢ã«ãããããã±ããã²ã¨ã¤ã®ååããéµå®ã§ãã¦ããæãã
ãããªæãã§æ軽ã«ä½¿ããã®ã§ãEmacsã§ãªã«ãããã¡ã¢ãã¼ã«ããªãããªã¼ã¨æã£ããorg-rememberãããããããããplanner.elãåãããã«ç¬æã«ã¡ã¢ãããæ©è½ãããããorg-modeã¯æ±ç¨çã«ä½ããã¦ããããå¿ç¨ç¯å²ãåºããå®éã«ä¿ºã¯plannerããorgã«ä¹ãæããçµç·¯ãããã
org-rememberãã³ã¼ããªã¼ãã£ã³ã°ã®ã¡ã¢
ããããã¯ããã°ã©ãã³ã°ããã人åãã®è©±ãorg-rememberã§ç¬æã«ã¡ã¢ãåãããã¨ã¯ä¸ã«æ¸ãã¦ãããã¨ãå®éã«è©¦ãã¦ã¿ãã°ãããã¯ãããããã³ã¼ããªã¼ãã£ã³ã°ã«çããã¦ã¿ããã
ããã°ã©ãã³ã°æè¡ã®åä¸ã®ããã«ã¯ã人ã®ã³ã¼ããèªãã®ã大äºã ãããã°ã©ãã®ä»äºã¯ã³ã¼ããæ¸ãããã人ã®ã³ã¼ããèªãæ©ä¼ã®æ¹ãå¤ãã¨ãããã¦ãããããã§ãªãã¦ããããã°æãã³ã¼ããæ¸ãéã®åèã«ã³ã¼ããèªããã¨ã«ãªãã ããã
ã³ã¼ããèªãå ´åãé©å®ã¡ã¢ãåããã¨ã大åã¨ãªããã³ã¼ãã«é ãããæå³ãä½ããã£ã¦ããããªã©ããã¡ãã¡é ã®ä¸ã«è¦ãã¦ããã®ã¯ããã»ã©è¨æ¶åã®ãã人ã«ããã§ããªãã ãããããã§ãµã¤ãã®äººã«ã§ãããã¨ã¨ããã°ã¡ã¢ã ã
org-rememberã§ã¯ã¡ã¢ã®ç¨®é¡ãé¸æãã¦ã¡ã¢ãè¨é²ããã®ã ããã³ã¼ããªã¼ãã£ã³ã°æã¯é£ç¶ãã¦ã³ã¼ããªã¼ãã£ã³ã°é¢é£ã®ã¡ã¢ã¨ãªãããããã®é¸æã®ã¹ããããçãã¨ãããå
·ä½çã«ã¯org-remember-templatesãletã§ãããã
ãã¦ãå
ç¨ã®ã¹ã¯ãªã¼ã³ã·ã§ããã§æ°´è²ã®æåã§ãfile:~/memo/hatena/2009-01-21.txt::ãããªãã¦ã®ãåºã¦ãã¦ããã ãããããã¯org-modeã«ããããã¤ãã¼ãªã³ã¯ã§ãã®ä¸ã§ãC-c C-oãããEnterã*1ãæ¼ãã¨ãã®ãªã³ã¯ã辿ããã¨ãã§ãããorg-rememberã¯ã¡ã¢ãéããæç¹ã§ã®ãã¡ã¤ã«ã®ä½ç½®ãèªåçã«è¨é²ãã¦ããããã人æã§ä½ç½®ãã¡ã¢ããå¿
è¦ããªããããã¯ã³ã¼ããªã¼ãã£ã³ã°çã«å¬ããæ©è½ã ã
以ä¸ã®ã³ã¼ãã¯org-rememberã§ã³ã¼ããªã¼ãã£ã³ã°ã®ã¡ã¢ãåããorg-remember-code-readingãã³ãã³ãã®å®ç¾©ã ãæ¼ãããããã¼ã«å²ãå½ã¦ããã
(defvar org-code-reading-software-name nil) ;; ~/memo/code-reading.org ã«è¨é²ãã (defvar org-code-reading-file "code-reading.org") (defun org-code-reading-read-software-name () (set (make-local-variable 'org-code-reading-software-name) (read-string "Code Reading Software: " (or org-code-reading-software-name (file-name-nondirectory (buffer-file-name)))))) (defun org-code-reading-get-prefix (lang) (concat "[" lang "]" "[" (org-code-reading-read-software-name) "]")) (defun org-remember-code-reading () (interactive) (let* ((prefix (org-code-reading-get-prefix (substring (symbol-name major-mode) 0 -5))) (org-remember-templates `(("CodeReading" ?r "** %(identity prefix)%?\n \n %a\n %t" ,org-code-reading-file "Memo")))) (org-remember)))
org-remember-code-readingã¯ã¾ãã½ããã¦ã§ã¢ã®ååãèãã¦ãããåä½ã®ãã¡ã¤ã«ã ã£ãããã¡ã¤ã«åã®ã¾ã¾Enterãæ¼ãããè¤æ°ãã¡ã¤ã«ã®ã½ããã¦ã§ã¢ã®å ´åã¯ãã®ã½ããã¦ã§ã¢ã®ååãå ¥åããããã½ããã¦ã§ã¢å㯠org-code-reading-read-software-name ã«è¨é²ããããããããã¡ãã¼ã«ã«ãªã®ã§åããã¡ã¤ã«ã«ã¤ãã¦ã¯ååå ¥åãããã½ããã¦ã§ã¢åããã®ã¾ã¾ä½¿ãããããã®å¾ã¯é常ã®org-rememberã®ããã«*Remember*ãããã¡ãåºã¦ããã®ã§ã¡ã¢ãããããã¡ã¢ã®ã¿ã¤ãã«ã«ã¯è¨èªåã¨ã½ããã¦ã§ã¢åãåºã¦ãã¦ãããã¬ã³ã¬ã³ã¡ã¢ãï¼
ã¡ã¢ãæ¤ç´¢ãã
ã¡ã¢ããã¸ã¿ã«åããä¸ã§å¤§åãªã®ãæ¤ç´¢ã ãorg-modeã§æååæ¤ç´¢ããã¨ããã®æååãå«ã¾ããã¨ã³ããªãã¢ã¦ãã©ã¤ã³å±éãããããã®ä»ã®ã¨ã³ããªã¯è¦ããªãããã«ãªã£ã¦ããã
ãã¨ãã°ãorg-remember-code-readingã§ã¡ã¢ãã¦ãããã¡ã¤ã«ããããªæãã ã£ãã¨ããã
è¶ æ´çæ³ã®è¦³ç¹ã§ããã¦æ´çããªãç¶æ ã«ãããããªã½ããã¦ã§ã¢ã®ã¡ã¢ãç¾ åããã¦ããããã®ä¸ã§org-modeã®ã¡ã¢ã ããåãåºããããã°ãC-c / /ãï¼M-x org-occurï¼ãæ¼ãã¦ã¿ããããã¨ããRegexp: ãã¨ããããã³ãããåºã¦ããã®ã§org-modeã¨å ¥åããã¨ããã®ããã«ä»ã®ã¡ã¢ã¯é ãããorg-modeã®é¨åããã¤ã©ã¤ãããã¦ããããã®ããã«æ´çã®æéã¯æ¤ç´¢ã§ã¾ããªããããã¨ã¯ãªã³ã¯ãé£ã¹ã°ã¡ã¢ãã¦ãã対象ã®ãã¡ã¤ã«ã«ãã©ãã¤ããã
ãªã³ã¯é移å
ãC-c C-x C-pãã¨ãC-c C-x C-nã*2ãæ¼ãã¨ãã©ã¦ã¶ã§Tabãæ¼ãããã«ãªã³ã¯ãããªã³ã¯ã®ç§»åãã§ããã®ã ãããã®ã¾ã¾ã ã¨é ãã¦ãããªã³ã¯ã«å°éãã¦ãã¾ãã®ã§ãã¾ãã¡ä¸ä¾¿ã ãè¦ãã¦ããé¨åã®ã¿ã®ãªã³ã¯é移åã®ã³ãã³ããå®ç¾©ããããM-pãã¨ãM-nãã«å²ãå½ã¦ã¦ããããããã§æ¤ç´¢çµæããå¿«é©ã«ãªã³ã¯å ã«é£ã¹ããã
(defun org-next-visible-link () "Move forward to the next link. If the link is in hidden text, expose it." (interactive) (when (and org-link-search-failed (eq this-command last-command)) (goto-char (point-min)) (message "Link search wrapped back to beginning of buffer")) (setq org-link-search-failed nil) (let* ((pos (point)) (ct (org-context)) (a (assoc :link ct)) srch) (if a (goto-char (nth 2 a))) (while (and (setq srch (re-search-forward org-any-link-re nil t)) (goto-char (match-beginning 0)) (prog1 (not (eq (org-invisible-p) 'org-link)) (goto-char (match-end 0))))) (if srch (goto-char (match-beginning 0)) (goto-char pos) (setq org-link-search-failed t) (error "No further link found")))) (defun org-previous-visible-link () "Move backward to the previous link. If the link is in hidden text, expose it." (interactive) (when (and org-link-search-failed (eq this-command last-command)) (goto-char (point-max)) (message "Link search wrapped back to end of buffer")) (setq org-link-search-failed nil) (let* ((pos (point)) (ct (org-context)) (a (assoc :link ct)) srch) (if a (goto-char (nth 1 a))) (while (and (setq srch (re-search-backward org-any-link-re nil t)) (goto-char (match-beginning 0)) (not (eq (org-invisible-p) 'org-link)))) (if srch (goto-char (match-beginning 0)) (goto-char pos) (setq org-link-search-failed t) (error "No further link found")))) (define-key org-mode-map "\M-n" 'org-next-visible-link) (define-key org-mode-map "\M-p" 'org-previous-visible-link)