浏览代码

Add an orgtbl-to-orgtbl transformation.

Useful for documenting orgtbl transformation and formatting
functions.

Signed-off-by: Jason Riedy <jason@acm.org>

Conflicts:

	ChangeLog
Carsten Dominik 17 年之前
父节点
当前提交
54188f8618
共有 2 个文件被更改,包括 24 次插入0 次删除
  1. 8 0
      ChangeLog
  2. 16 0
      lisp/org-table.el

+ 8 - 0
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  <dominik@science.uva.nl>
 
 	* lisp/org.el (org-read-date-analyze): "." as an alias for "+0" in

+ 16 - 0
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