summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Holst <Thomas_Holst@gmx.de>2014-03-15 16:22:44 +0100
committerBastien Guerry <bzg@altern.org>2014-03-19 09:34:58 +0100
commit176125c32ff2a8adc6e1d3091a57e46e482da638 (patch)
tree2f2cf73c7238db5f5ad53d03c4405e8c33cbf320
parent88d151b05bf022f933fc159023cb1f76e8740bd0 (diff)
downloadorg-mode-176125c32ff2a8adc6e1d3091a57e46e482da638.tar.gz
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
-rw-r--r--lisp/org-capture.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index e7f5e20..cf6c9e2 100644
--- a/lisp/org-capture.el
+++ b/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))