emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] [PATCH] quote the real csv separator


From: Carsten Dominik
Subject: Re: [Orgmode] [PATCH] quote the real csv separator
Date: Sun, 24 Oct 2010 18:26:40 +0200

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, Łukasz 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- 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 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 "\"") "\"\"") "\"")
    s))

--8<---------------cut here---------------end--------------->8---

--
Miłego dnia,
Łukasz Stelmach


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

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