From 54188f8618d31a01060fb66261c074800910b1de Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 6 May 2008 14:15:45 +0200 Subject: [PATCH] Add an orgtbl-to-orgtbl transformation. Useful for documenting orgtbl transformation and formatting functions. Signed-off-by: Jason Riedy Conflicts: ChangeLog --- ChangeLog | 8 ++++++++ lisp/org-table.el | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index bf287f564..9c1bc68fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,14 @@ * lisp/org-exp.el (org-export-as-html, org-close-li): Implement description lists. + * lisp/org-table.el (*orgtbl-default-fmt*): New variable. + (orgtbl-format-line): Use the value of *orgtbl-default-fmt* + when there is no other fmt available. + (orgtbl-to-generic): Allow an explicitly nil :tstart or + :tend to suppress the appropriate string. + (orgtbl-to-orgtbl): New function for translating to another orgtbl + table. + 2008-05-02 Carsten Dominik * lisp/org.el (org-read-date-analyze): "." as an alias for "+0" in diff --git a/lisp/org-table.el b/lisp/org-table.el index ef1d93244..4028dc67f 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -3910,6 +3910,22 @@ this function is called." :hlstart "@headitem "))) (orgtbl-to-generic table (org-combine-plists params2 params)))) +(defun orgtbl-to-orgtbl (table params) + "Convert the orgtbl-mode TABLE into another orgtbl-mode table. +Useful when slicing one table into many. The :hline, :sep, +:lstart, and :lend provide orgtbl framing. The default nil :tstart +and :tend suppress strings without splicing; they can be set to +provide ORGTBL directives for the generated table." + (let* ((params2 + (list + :tstart nil :tend nil + :hline "|---" + :sep " | " + :lstart "| " + :lend " |")) + (params (org-combine-plists params2 params))) + (orgtbl-to-generic table params))) + (provide 'org-table) ;; arch-tag: 4d21cfdd-0268-440a-84b0-09237a0fe0ef -- 2.11.4.GIT