From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Fidler Subject: orgtbl in languages that do not support block comments Date: Thu, 13 Jan 2011 13:37:04 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1145541408==" Return-path: Received: from [140.186.70.92] (port=43822 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdSyq-0000cH-93 for emacs-orgmode@gnu.org; Thu, 13 Jan 2011 14:37:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdSyo-0007eI-TI for emacs-orgmode@gnu.org; Thu, 13 Jan 2011 14:37:08 -0500 Received: from mail-fx0-f41.google.com ([209.85.161.41]:34298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdSyo-0007e6-KL for emacs-orgmode@gnu.org; Thu, 13 Jan 2011 14:37:06 -0500 Received: by fxm12 with SMTP id 12so1980818fxm.0 for ; Thu, 13 Jan 2011 11:37:04 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-org --===============1145541408== Content-Type: multipart/alternative; boundary=00248c11dc0b3f22310499bf71d4 --00248c11dc0b3f22310499bf71d4 Content-Type: text/plain; charset=ISO-8859-1 All, I have written org-table-comment.el (at http://www.emacswiki.org/emacs/download/org-table-comment.el) which should allows you to create org-tables in languages that do not have block comments. For example in elisp: ;; |------+----------------+----+-------| ;; | | | | <5> | ;; | This | is | a | table | ;; | that | may be created | in | orgtbl-comment-mode | ;; |------+----------------+----+-------| or ;; |------+----------------+----+---------------------| ;; | This | is | a | table | ;; | that | may be created | in | orgtbl-comment-mode | ;; |------+----------------+----+---------------------| It also supports single-comment radio tables, for example in LaTeX the following now works if you are using the overlays driver for org-table-comment: % BEGIN RECEIVE ORGTBL salesfigures % END RECEIVE ORGTBL salesfigures % #+ORGTBL: SEND salesfigures orgtbl-to-latex % |-------+------+---------+---------| % | Month | Days | Nr sold | per day | % |-------+------+---------+---------| % | Jan | 23 | 55 | 2.4 | % | Feb | 21 | 16 | 0.8 | % | March | 22 | 278 | 12.6 | % |-------+------+---------+---------| % #+TBLFM: $4=$3/$2;.1f When editing the table, pressing C-c C-c produces the LaTeX table, as follows: % BEGIN RECEIVE ORGTBL salesfigures \begin{tabular}{lrrr} \hline Month & Days & Nr sold & per day \\ \hline Jan & 23 & 55 & 2.4 \\ Feb & 21 & 16 & 0.8 \\ March & 22 & 278 & 12.6 \\ \hline \end{tabular} % END RECEIVE ORGTBL salesfigures % #+ORGTBL: SEND salesfigures orgtbl-to-latex % |-------+------+---------+---------| % | Month | Days | Nr sold | per day | % |-------+------+---------+---------| % | Jan | 23 | 55 | 2.4 | % | Feb | 21 | 16 | 0.8 | % | March | 22 | 278 | 12.6 | % |-------+------+---------+---------| % #+TBLFM: $4=$3/$2;.1f NOTE: This requires `comment-region' and `uncomment-region' to work properly in the mode you are using. Also filling/wrapping in the mode needs to not wrap the orgbls. If anyone is interested in testing this and letting me know if it works on other platforms, let me know. Matt. --00248c11dc0b3f22310499bf71d4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable All,

I have written org-table-comment.el (at http://www.emacswiki.org/= emacs/download/org-table-comment.el) which should allows you to create = org-tables in languages that do not have
block comments.=A0 For example in elisp:

;; |------+----------------+----+-------|;; |=A0=A0=A0=A0=A0 |=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 |=A0=A0=A0 | <5>=A0=A0 |
;; | This | is=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 | a=A0 | table |
;; | that | may be created | in | orgtbl-comment-mode |
;; |------+------------= ----+----+-------|
=
or

;; |------+----------------+----+---------------= ------|
;; | This | is=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 | a=A0 | table=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= |
;; | that | may be crea= ted | in | orgtbl-comment-mode |
;; |-----= -+----------------+----+---------------------|

It also supports single-comment radio tables, fo= r example in LaTeX
= the following now works= if you are using the overlays driver for
org-table-comment:

% BEGIN RECEIVE ORGTBL salesfigures
% END RECEIVE ORGTBL sa= lesfigures

% #+ORGTBL: SEND salesfigures orgtbl-to-latex
% |-------+------+-----= ----+---------|
% | Month | Days | Nr sold= | per day |

% |-------+------+-----= ----+---------|
% | Jan=A0=A0 |=A0=A0 23 |= =A0=A0=A0=A0=A0 55 |=A0=A0=A0=A0 2.4 |
% | Feb=A0=A0 |=A0=A0 2= 1 |=A0=A0=A0=A0=A0 16 |=A0=A0=A0=A0 0.8 |
= % | March |=A0=A0 22 |=A0=A0=A0=A0 278 |=A0=A0=A0 12.6 |
% |-------+------+-----= ----+---------|
% #+TBLFM: $4=3D$3/$2;.1f<= /span>

When editing the table, pressing C-c C-c produce= s the LaTeX table, as follows:

% BEGIN RECEIVE ORGTBL salesfigures
\begin{tabular}{lrrr}
\hline
Month & Days & Nr sold & per day \\ \hline
Jan & 23 & 55 & 2.4 \\
Feb & 21 & 16 &= amp; 0.8 \\
March & 22 & 278 &= 12.6 \\
\hline
\end{tabular}
% END RECEIVE ORGTBL sa= lesfigures

% #+ORGTBL: SEND salesfigures orgtbl-to-latex
% |-------+------+-----= ----+---------|
% | Month | Days | Nr sold= | per day |
% |-------+------+-----= ----+---------|
% | Jan=A0=A0 |=A0=A0 23 |= =A0=A0=A0=A0=A0 55 |=A0=A0=A0=A0 2.4 |
% | Feb=A0=A0 |=A0=A0 2= 1 |=A0=A0=A0=A0=A0 16 |=A0=A0=A0=A0 0.8 |
= % | March |=A0=A0 22 |=A0=A0=A0=A0 278 |=A0=A0=A0 12.6 |
% |-------+------+-----= ----+---------|
% #+TBLFM: $4=3D$3/$2;.1f<= /span>

NOTE: This requires `comment-region' and `un= comment-region' to work
properly in the mode yo= u are using.=A0 Also filling/wrapping in the
mode needs to not wrap the orgbls.

If anyone is interested in testing this and letting me know if it works= on other platforms, let me know.

Matt.
--00248c11dc0b3f22310499bf71d4-- --===============1145541408== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1145541408==--