浏览代码

org-capture.el: Allow `:table-line-pos' to be a function name, a string or a variable

* lisp/org-capture.el (org-capture-place-table-line): If the value of
`:table-line-pos' is a function name, used its return value to set the
position inside the table.  The return value must be a string like
"II-3".  Else `:table-line-pos' is 'eval'ed.

TINYCHANGE
Thomas Holst 11 年之前
父节点
当前提交
176125c32f
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      lisp/org-capture.el

+ 3 - 0
lisp/org-capture.el

@@ -1149,6 +1149,9 @@ may have been stored before."
     ;; Check if the template is good
     (if (not (string-match org-table-dataline-regexp txt))
 	(setq txt "| %?Bad template |\n"))
+    (if (functionp table-line-pos)
+	(setq table-line-pos (funcall table-line-pos))
+      (setq table-line-pos (eval table-line-pos)))
     (cond
      ((and table-line-pos
 	   (string-match "\\(I+\\)\\([-+][0-9]\\)" table-line-pos))