소스 검색

Remember: Allow template target headline to be a function

The target headline in a remember template may by be a function that
will be called to computer the real headline to be used.
Carsten Dominik 16 년 전
부모
커밋
cdb13c76e4
2개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      lisp/ChangeLog
  2. 3 0
      lisp/org-remember.el

+ 5 - 0
lisp/ChangeLog

@@ -1,5 +1,10 @@
 2009-06-17  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-remember.el (org-remember-templates): Allow the headline
+	element to be a function.
+	(org-remember-apply-template): If the headline is a function, call
+	it to get the true function.
+
 	* org-clock.el (org-clock-menu): New function.
 	(org-clock-update-mode-line): Update help string.
 	(org-clock-modify-effort-estimate): New function.

+ 3 - 0
lisp/org-remember.el

@@ -186,6 +186,7 @@ calendar           |  %:type %:date"
 		 (const :tag "Use `org-default-notes-file'" nil))
 		(choice :tag "Destin. headline"
 		 (string :tag "Specify")
+		 (function :tag "Function")
 		 (const :tag "Use `org-remember-default-headline'" nil)
 		 (const :tag "At beginning of file" top)
 		 (const :tag "At end of file" bottom))
@@ -431,6 +432,8 @@ to be run from that hook to function properly."
 
 	(when (functionp file)
 	  (setq file (funcall file)))
+	(when (functionp headline)
+	  (setq headline (funcall headline)))
 	(when (and file (not (file-name-absolute-p file)))
 	  (setq file (expand-file-name file org-directory)))