emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH 3/4] Add an orgtbl-to-orgtbl transformation.


From: Jason Riedy
Subject: [Orgmode] [PATCH 3/4] Add an orgtbl-to-orgtbl transformation.
Date: Sun, 4 May 2008 18:54:42 -0700

Useful for documenting orgtbl transformation and formatting
functions.

Signed-off-by: Jason Riedy <address@hidden>
---
 ChangeLog         |    2 ++
 lisp/org-table.el |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d70bc98..d8f1a3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
        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  <address@hidden>
 
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 19dd74a..af12a4c 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -3917,6 +3917,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
-- 
1.5.5.rc1.121.g1594





reply via email to

[Prev in Thread] Current Thread [Next in Thread]