From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] quote the real csv separator Date: Sun, 24 Oct 2010 18:26:40 +0200 Message-ID: <57E157F5-BDE7-4431-B15F-8EE52E571677@gmail.com> References: <87mxq4wman.fsf@kotik.lan> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=42615 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PA3PG-0000po-FS for emacs-orgmode@gnu.org; Sun, 24 Oct 2010 12:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PA3PA-0007je-Q0 for emacs-orgmode@gnu.org; Sun, 24 Oct 2010 12:26:50 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:49882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PA3PA-0007jL-JP for emacs-orgmode@gnu.org; Sun, 24 Oct 2010 12:26:44 -0400 Received: by eydd26 with SMTP id d26so1130193eyd.0 for ; Sun, 24 Oct 2010 09:26:43 -0700 (PDT) In-Reply-To: <87mxq4wman.fsf@kotik.lan> 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: =?UTF-8?Q?=C5=81ukasz_Stelmach?= Cc: emacs-orgmode@gnu.org Hi Lukasz, thanks for the patch, but I do not understand it. The separator for csv is always the comma, or am I wrong here? So this function should use comma, hard-coded. The only place where it is used is when orgtbl-to-csv calls the generic exporter. It does so with comma as separator and with org-quote-csv-field as formatting function. What use case do you have in mind? - Carsten On Oct 24, 2010, at 12:56 AM, =C5=81ukasz Stelmach wrote: > Hi. > > I'd rather use an optional sep argument to the org-quote-csv-field > function but I've got no idea how to stick it into the orgtbl-apply-=20= > fmt. > However, the quoting function should use current rather then assume > comma. > > --8<---------------cut here---------------start------------->8--- > diff --git a/lisp/org.el b/lisp/org.el > index b482b8e..501dd8d 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -18019,7 +18019,7 @@ With prefix arg UNCOMPILED, load the =20 > uncompiled versions." > > (defun org-quote-csv-field (s) > "Quote field for inclusion in CSV material." > - (if (string-match "[\",]" s) > + (if (string-match (concat "[\"" *orgtbl-sep* "]") s) > (concat "\"" (mapconcat 'identity (split-string s "\"") =20 > "\"\"") "\"") > s)) > > --8<---------------cut here---------------end--------------->8--- > > --=20 > Mi=C5=82ego dnia, > =C5=81ukasz Stelmach > > > _______________________________________________ > 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