emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: francois@avalenn.eu
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] [org-table] user-chosen separator in org-table-convert-region
Date: Sun, 29 Sep 2013 12:28:50 +0200	[thread overview]
Message-ID: <CFB3F68D-CCAD-4084-8E19-B3F1DDF46CB2@gmail.com> (raw)
In-Reply-To: <8aac63099d110d297d0ada9ff87cb93b@avalenn.eu>

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

Hi Francois,

thanks for the explanation.  I have checked in a modified version which does
what you proposal and also allows the user to call `C-c |' with a triple prefix
arg.  In that case, the command will prompt the user for a regular expression
that will be used.

Useful, thank you!

- Carsten

On 3.9.2013, at 12:20, francois@avalenn.eu wrote:

> 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
> 
> 
> 


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  parent reply	other threads:[~2013-09-29 10:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 10:20 [PATCH] [org-table] user-chosen separator in org-table-convert-region francois
2013-09-24 13:08 ` Carsten Dominik
2013-09-27  9:39   ` francois
2013-09-29 10:28 ` Carsten Dominik [this message]
  -- 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=CFB3F68D-CCAD-4084-8E19-B3F1DDF46CB2@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=francois@avalenn.eu \
    /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).