forked from mirrors/org-mode
org-collector: enable specifying a default table-value as a parameter
* contrib/lisp/org-collector.el (org-dblock-write:propview): if a 'defaultval' property has been set, then use this in place of org-propview-default-value. TINYCHANGE
This commit is contained in:
parent
02ab072061
commit
7230133f8d
|
@ -121,6 +121,7 @@ preceeding the dblock, then update the contents of the dblock."
|
||||||
(scope (plist-get params :scope))
|
(scope (plist-get params :scope))
|
||||||
(noquote (plist-get params :noquote))
|
(noquote (plist-get params :noquote))
|
||||||
(colnames (plist-get params :colnames))
|
(colnames (plist-get params :colnames))
|
||||||
|
(defaultval (plist-get params :defaultval))
|
||||||
(content-lines (org-split-string (plist-get params :content) "\n"))
|
(content-lines (org-split-string (plist-get params :content) "\n"))
|
||||||
id table line pos)
|
id table line pos)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
@ -133,9 +134,10 @@ preceeding the dblock, then update the contents of the dblock."
|
||||||
(t (error "Cannot find entry with :ID: %s" id))))
|
(t (error "Cannot find entry with :ID: %s" id))))
|
||||||
(unless (eq id 'global) (org-narrow-to-subtree))
|
(unless (eq id 'global) (org-narrow-to-subtree))
|
||||||
(setq stringformat (if noquote "%s" "%S"))
|
(setq stringformat (if noquote "%s" "%S"))
|
||||||
(setq table (org-propview-to-table
|
(let ((org-propview-default-value (if defaultval defaultval org-propview-default-value)))
|
||||||
(org-propview-collect cols stringformat conds match scope inherit
|
(setq table (org-propview-to-table
|
||||||
(if colnames colnames cols)) stringformat))
|
(org-propview-collect cols stringformat conds match scope inherit
|
||||||
|
(if colnames colnames cols)) stringformat)))
|
||||||
(widen))
|
(widen))
|
||||||
(setq pos (point))
|
(setq pos (point))
|
||||||
(when content-lines
|
(when content-lines
|
||||||
|
|
Loading…
Reference in New Issue