emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Charles C. Berry" <ccberry@ucsd.edu>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>, Eike <eike@eknet.org>
Subject: Re: [PATCH] ob-core: check argument to goto-char
Date: Sat, 30 Apr 2016 23:24:49 +0200	[thread overview]
Message-ID: <87zisayela.fsf@saiph.selenimh> (raw)
In-Reply-To: <alpine.OSX.2.20.1604301340050.791@charles-berrys-macbook.local> (Charles C. Berry's message of "Sat, 30 Apr 2016 14:15:43 -0700")

Hello,

"Charles C. Berry" <ccberry@ucsd.edu> writes:

> The easiest way to borrow babel tools is to use babel to execute src 
> blocks directly. Here is a start. Run this src block to define a function
> `insert-quoted-list-as-result':
>
> #+BEGIN_SRC emacs-lisp
>    (defun insert-quoted-list-as-result (my-list)
>    (save-excursion
>      (insert
>       (format
>        "#+BEGIN_SRC emacs-lisp\n '%S\n#+END_SRC\n\n" my-list))
>      (let ((org-confirm-babel-evaluate nil))
>        (org-babel-execute-src-block)))
>      (delete-region (point)
>  		   (org-babel-where-is-src-block-result)))
> #+END_SRC
>
> Then put the next line in an *.org buffer and try it out by typing C-x C-e 
> just below the line:
>
> : (insert-quoted-list-as-result '(("id" "num") hline ("a" "1") ("b" "2")))

I suggest to use built-in `orgtbl-to-orgtbl' instead:

  (insert (orgtbl-to-orgtbl '(("id" "num") hline ("a" "1") ("b" "2")) nil))


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2016-04-30 21:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-30 11:05 [PATCH] ob-core: check argument to goto-char Eike
2016-04-30 17:38 ` Charles C. Berry
2016-04-30 18:47   ` Eike
2016-04-30 21:15     ` Charles C. Berry
2016-04-30 21:24       ` Nicolas Goaziou [this message]
2016-04-30 23:08         ` Eike
2016-04-30 21:40       ` Eike

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=87zisayela.fsf@saiph.selenimh \
    --to=mail@nicolasgoaziou.fr \
    --cc=ccberry@ucsd.edu \
    --cc=eike@eknet.org \
    --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).