emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug: Table export to [tc]sv doesn't convert \vert [7.8.11]


From: Nathan Trapuzzano
Subject: Re: [O] Bug: Table export to [tc]sv doesn't convert \vert [7.8.11]
Date: Wed, 02 Jan 2013 16:50:21 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Bastien <address@hidden> writes:

> Hi Nathan,
>
> Nathan Trapuzzano <address@hidden> 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.

I only recently started using org-mode, let alone looking at the
source. I'll see what you mean if I get the time.

>> 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.

The problem with not escaping escape sequences is that there always ends
up being some string of characters that cannot be represented. As for
driving one mad, I think that "\\\\+vert" is much simpler to understand
than "\\(\\b\\\\vert\\b\\|\\\\vert{}\\)", especially if the latter only
applies when the row in which the sequence falls is not escaped as you
describe below.

> 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.

This would apply the escape to the entire row. I supposed it's better
than the way things are now, but it's still not a very good solution in
my mind.



reply via email to

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