emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: francois@avalenn.eu
To: emacs-orgmode@gnu.org
Subject: [PATCH] [org-table] user-chosen separator in org-table-convert-region
Date: Tue, 03 Sep 2013 12:20:22 +0200	[thread overview]
Message-ID: <8aac63099d110d297d0ada9ff87cb93b@avalenn.eu> (raw)

Hello,

I made this patch to make easier conversion to
org-table from csv-like text with arbitrary separator.

---
  lisp/org-table.el |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index c7e7eb8..c8c2462 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -575,6 +575,8 @@ nil      When nil, the command tries to be smart 
and figure out the
  		 (if (< separator 1)
  		     (user-error "Number of spaces in separator must be >= 1")
  		   (format "^ *\\| *\t *\\| \\{%d,\\}" separator)))
+		((stringp separator)
+		   (format "^ *\\|%s" separator))
  		(t (error "This should not happen"))))
        (while (re-search-forward re end t)
  	(replace-match "| " t t)))
-- 
1.7.9

             reply	other threads:[~2013-09-03 10:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 10:20 francois [this message]
2013-09-24 13:08 ` [PATCH] [org-table] user-chosen separator in org-table-convert-region Carsten Dominik
2013-09-27  9:39   ` francois
2013-09-29 10:28 ` Carsten Dominik
  -- strict thread matches above, loose matches on Subject: below --
2013-09-03 14:25 francois

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8aac63099d110d297d0ada9ff87cb93b@avalenn.eu \
    --to=francois@avalenn.eu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).