emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Vladimir Alexiev <vladimir@sirma.bg>
Cc: emacs-orgmode@gnu.org
Subject: Re: [HOW] no way to escape vertical bar (pipe char) in tables?
Date: Mon, 07 Mar 2011 08:47:36 -0700	[thread overview]
Message-ID: <87ipvvexuv.fsf@gmail.com> (raw)
In-Reply-To: <loom.20110224T125512-466@post.gmane.org> (Vladimir Alexiev's message of "Thu, 24 Feb 2011 11:59:39 +0000 (UTC)")

Vladimir Alexiev <vladimir@sirma.bg> writes:

> I want to manage some perl regexps in a table
> then feed them to a code block (literate programming).
> Unfortunately they include alternatives (|) 
> and the table editor thinks this is a column break.
>
> There's no way to escape this?
>

Using a different character (namely ¦) the following should work

#+source: clean
#+begin_src emacs-lisp :var in=""
  (flet ((clean (in)
                (if (listp in)
                    (mapcar #'clean in)
                  (if (stringp in)
                      (replace-regexp-in-string "¦" "|" in)
                    in))))
    (clean in))
#+end_src

#+results: regexps
| first  | (a¦b) |
| second | (1¦2) |

#+begin_src perl :var a=clean(in=regexps)[0,1] :var b=clean(in=regexps)[1,1]
  $a; $b;
#+end_src

#+results:
: (1|2)

Best -- Eric

      parent reply	other threads:[~2011-03-07 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 11:59 [HOW] no way to escape vertical bar (pipe char) in tables? Vladimir Alexiev
2011-03-03 11:00 ` Bastien
2011-03-03 16:00   ` Camille persson
2011-03-07  8:16   ` Vladimir Alexiev
2011-03-07  8:29     ` Bastien
2011-03-07 15:47 ` Eric Schulte [this message]

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=87ipvvexuv.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=vladimir@sirma.bg \
    /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).