emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] quote the real csv separator
@ 2010-10-23 22:56 Łukasz Stelmach
  2010-10-24 16:26 ` Carsten Dominik
  0 siblings, 1 reply; 11+ messages in thread
From: Łukasz Stelmach @ 2010-10-23 22:56 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-10-25 12:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-23 22:56 [PATCH] quote the real csv separator Łukasz Stelmach
2010-10-24 16:26 ` Carsten Dominik
2010-10-24 16:52   ` Nick Dokos
2010-10-24 19:37     ` Carsten Dominik
2010-10-25 10:32     ` Stefan Vollmar
2010-10-24 20:49   ` Łukasz Stelmach
2010-10-25  1:25     ` Bernt Hansen
2010-10-25  8:45       ` Łukasz Stelmach
2010-10-25  9:06         ` Carsten Dominik
2010-10-25 11:59           ` Łukasz Stelmach
2010-10-25  9:15   ` Sébastien Vauban

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).