From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] [org-table] user-chosen separator in org-table-convert-region Date: Sun, 29 Sep 2013 12:28:50 +0200 Message-ID: References: <8aac63099d110d297d0ada9ff87cb93b@avalenn.eu> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2B84D5B2-634B-4022-B2FC-6425260FDE2B"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQEFJ-0006yc-Up for emacs-orgmode@gnu.org; Sun, 29 Sep 2013 06:29:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQEFE-0008G4-44 for emacs-orgmode@gnu.org; Sun, 29 Sep 2013 06:29:01 -0400 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:40156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQEFD-0008Fq-So for emacs-orgmode@gnu.org; Sun, 29 Sep 2013 06:28:56 -0400 Received: by mail-we0-f175.google.com with SMTP id q59so4265030wes.6 for ; Sun, 29 Sep 2013 03:28:54 -0700 (PDT) In-Reply-To: <8aac63099d110d297d0ada9ff87cb93b@avalenn.eu> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: francois@avalenn.eu Cc: emacs-orgmode@gnu.org --Apple-Mail=_2B84D5B2-634B-4022-B2FC-6425260FDE2B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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, >=20 > I made this patch to make easier conversion to > org-table from csv-like text with arbitrary separator. >=20 > --- > lisp/org-table.el | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) >=20 > 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 = >=3D 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))) > --=20 > 1.7.9 >=20 >=20 >=20 --Apple-Mail=_2B84D5B2-634B-4022-B2FC-6425260FDE2B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJSSADjAAoJEO+gg/nAZuwMam4H/29wW3daj7g5vzFqB3NJOgIh CfwkrEezIa/R7/PWWMMj3Hoq+EPnPRBCbaB3P5+kIBLj6kahXyqq8nDkrIo0EVPX n/zLMTbLQtfTl86DNfFuqV0v/aOLlxdTeNjhdXCOskjRlogeb4w9AE8rGc59rZNQ 7TAHkM8mQxv6F6l4+9VW/IIosxhoF/YPyslFfst7rRmNqGBqgyacTc/u5u3WaP9s tafS9qUsRwZrsMMDBwv/Zx2BbMaySRvixgw9c1+D54dL/nwFyEBi9+MOI+R5sMew pNjNbh9sjKiZlUramJUDMIxyZnjVwV5Bu/FC7PNSnSx/l7KQudv8I5EF1lxbWbw= =dkJF -----END PGP SIGNATURE----- --Apple-Mail=_2B84D5B2-634B-4022-B2FC-6425260FDE2B--