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: Fri, 28 Dec 2012 18:26:26 +0100 Message-ID: <87sj6qkrd7.fsf@bzg.ath.cx> References: <20121225233220.03a42d24@nbtrap.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Todul-0001MT-5R for emacs-orgmode@gnu.org; Fri, 28 Dec 2012 12:40:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Todug-0006l6-Jf for emacs-orgmode@gnu.org; Fri, 28 Dec 2012 12:40:11 -0500 Received: from mail-wi0-f176.google.com ([209.85.212.176]:40794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Todug-0006ig-C9 for emacs-orgmode@gnu.org; Fri, 28 Dec 2012 12:40:06 -0500 Received: by mail-wi0-f176.google.com with SMTP id hm6so8348787wib.9 for ; Fri, 28 Dec 2012 09:40:05 -0800 (PST) In-Reply-To: <20121225233220.03a42d24@nbtrap.com> (Nathan Trapuzzano's message of "Tue, 25 Dec 2012 23:32:20 -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 --=-=-= Content-Type: text/plain Hi Nathan, Nathan Trapuzzano writes: > Converting \vert and \vert{} when exporting an Org table to csv or tsv does not > properly convert them to the vertical bar. Instead, they are retained literally. A hackish patch like this one fixes this, but it's not general enough. Also, converting entities in tables is prone to false-positives, so let's live with this limitation until we generalize the way entities are handled. Best, --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=org-convert-csv-entities.patch diff --git a/lisp/org.el b/lisp/org.el index 04bb2e9..a366f95 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -20030,8 +20030,12 @@ With prefix arg UNCOMPILED, load the uncompiled versions." (defun org-quote-csv-field (s) "Quote field for inclusion in CSV material." (if (string-match "[\",]" s) - (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\"") - s)) + (setq s (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\""))) + (if (string-match "\\\\\\([a-zA-Z]+[0-9]*\\)\\({}\\)?" s) + (setq s (replace-match + (org-entity-get-representation + (match-string 1 s) 'ascii) t t s 0))) + s) (defun org-force-self-insert (N) "Needed to enforce self-insert under remapping." --=-=-= Content-Type: text/plain -- Bastien --=-=-=--