Subscribed unsubscribe Subscribe Subscribe

@peccul is peccu

(love peccu '(emacs lisp cat outdoor bicycle mac linux coffee))

= org-rememberでタグ付けがめんどいのでパッチッチ

[2012-01-10 15:33:36]
>>>[emacs]
>>>[org-mode]

年末年始でGTD w/ org-modeに再入門して,今回はうまくいきそうなpeccuです.

さて,org-rememberのテンプレートに%^gとか書いとくとタグを聞いてくれますね.

普段のタグ入力(C-cC-q / org-set-tags-command)はワンキーで選択できたりしていい感じなんですが,org-rememberのときのTagを聞くインタフェースがしょぼすぎるので,org-set-tags-commandのときのインタフェースを無理矢理ねじ込みました.

org-rememberのテンプレートを扱ってる関数がでかくてきもいのでアドバイスじゃなくて直接書いちゃいました.

diff --git a/lisp/org-remember.el b/lisp/org-remember.el
index 4f3190c..2c7df9a 100644
--- a/lisp/org-remember.el
+++ b/lisp/org-remember.el
@@ -572,10 +572,23 @@ to be run from that hook to function properly."
 		      (org-global-tags-completion-table
 		       (if (equal char "G") (org-agenda-files) (and file (list file)))))
 		     (org-add-colon-after-tag-completion t)
-		     (ins (org-icompleting-read
-			   (if prompt (concat prompt ": ") "Tags: ")
-			   'org-tags-completion-function nil nil nil
-			   'org-tags-history)))
+                     (table (append org-tag-persistent-alist
+                                    (or org-tag-alist (org-get-buffer-tags))
+                                    (and
+                                     org-complete-tags-always-offer-all-agenda-tags
+                                     (org-global-tags-completion-table
+                                      (org-agenda-files)))))
+		     (ins (if (or (eq t org-use-fast-tag-selection)
+                                   (and org-use-fast-tag-selection
+                                        (delq nil (mapcar 'cdr table))))
+                               (org-fast-tag-selection
+                                nil nil table
+                                (if org-fast-tag-selection-include-todo
+                                    org-todo-key-alist))
+                            (org-icompleting-read
+                             (if prompt (concat prompt ": ") "Tags: ")
+                             'org-tags-completion-function nil nil nil
+                             'org-tags-history))))
 		(setq ins (mapconcat 'identity
 				     (org-split-string ins (org-re "[^[:alnum:]_@#%]+"))
 				     ":"))

org-set-tags-commandが呼び出してるorg-set-tagsをほぼコピペしただけです.自分の環境でしか試してません.