From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Bug: Table export to [tc]sv doesn't convert \vert [7.8.11] Date: Mon, 31 Dec 2012 10:30:49 +0100 Message-ID: <87obhao9fa.fsf@bzg.ath.cx> References: <20121225233220.03a42d24@nbtrap.com> <87sj6qkrd7.fsf@bzg.ath.cx> <20121229202531.3787d46d@nbtrap.com> <87r4m7ewyu.fsf@bzg.ath.cx> <20121230230104.3314d945@nbtrap.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tpbhr-0005kH-MR for emacs-orgmode@gnu.org; Mon, 31 Dec 2012 04:30:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tpbhq-0001c2-83 for emacs-orgmode@gnu.org; Mon, 31 Dec 2012 04:30:51 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:61544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tpbhq-0001by-1I for emacs-orgmode@gnu.org; Mon, 31 Dec 2012 04:30:50 -0500 Received: by mail-wi0-f180.google.com with SMTP id hj13so6931089wib.13 for ; Mon, 31 Dec 2012 01:30:49 -0800 (PST) In-Reply-To: <20121230230104.3314d945@nbtrap.com> (Nathan Trapuzzano's message of "Sun, 30 Dec 2012 23:01:04 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nathan Trapuzzano Cc: emacs-orgmode@gnu.org Hi Nathan, Nathan Trapuzzano writes: > Of course the particular implementation will have to be seen before it > can be accepted, but I'd like to get the spec accepted (provisionally) > before setting to work on it. As a start, you can look at the way org-e-*.el backend export tables, (use `org-e-ascii-table-cell' as an entry point). What we need is a callback function to convert entities in cells, in org-export.el. Since we already have org-entities, I would use it together with `org-entity-get-representation' to convert entities from the \vert{} representation to the "|" character (in the ASCII backend.) > Here's what I propose: > > 1. Do away with \vert{} entirely, leaving just \vert as an escape > sequence standing for |, no matter where it appears. \vert{} > unnecesarily complicates things, in my opinion. Better to rely on org-entities and the way entities are treated so far. > 2. The escape sequence must itself be escapable, wherefore I propose > to give the backslash special meaning in front of the string > "vert". Specifically: > > a. An even number of consecutive backslashes followed by "vert" > stands for that number of backslashes divided by two followed by > "vert". > > b. An odd number of consecutive backslashes followed by "vert" > stands for that many backslashes integer-divided by two, followed by > "|". > > For example, "\vert" exports to "|", "\\vert" to "\vert", "\\\vert" to > "\|", "\\\\vert" to "\\vert", and so on. Obviously, upon importing, > the reverse of the above will be carried out. I would not take that route -- from experience, escaping espace sequences can drive you mad, and all this is not intuitive for users. I would simply convert entities by default and use a special table cookie in lines where you do not want the conversion to happen. For example: | Header 1 | Header 2 | |----------+----------| | \vert{} | ABC | => convert to "|" But: | | Header 1 | Header 2 | |---+----------+----------| | \ | \vert{} | ABC | Don't convert. The "\" char is free and a good choice here. -- Bastien