From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] Output table Date: Mon, 02 Dec 2013 11:28:08 -0700 Message-ID: <87txerf663.fsf@gmail.com> References: <86txerrzx4.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnYQZ-0005EF-Dd for emacs-orgmode@gnu.org; Mon, 02 Dec 2013 13:41:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnYQU-0007j2-Oi for emacs-orgmode@gnu.org; Mon, 02 Dec 2013 13:41:03 -0500 Received: from mail-pb0-x236.google.com ([2607:f8b0:400e:c01::236]:46870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnYQU-0007hu-Fp for emacs-orgmode@gnu.org; Mon, 02 Dec 2013 13:40:58 -0500 Received: by mail-pb0-f54.google.com with SMTP id un15so19471459pbc.41 for ; Mon, 02 Dec 2013 10:40:56 -0800 (PST) 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: Sebastien Vauban Cc: emacs-orgmode@gnu.org "Sebastien Vauban" writes: > Hello, > > I'm trying to generate R graphs from lines found in the *Messages* buffer with > the following code of mine: > > #+begin_src emacs-lisp :results output table > (setq txt nil) > (with-current-buffer "*Messages*" > (goto-char (point-min)) > (while (re-search-forward > "^Retrieving newsgroup: \\(.+\\)" > nil t) > (setq txt (concat txt (format "%s" (match-string 1)) "\n")) > (princ txt))) > #+end_src > > However, the results is always an example block, NEVER in an Org _table_ -- and > I don't understand why. Does anybody? > > Best regards, > Seb I bet because ":results output" in Emacs Lisp is only interpreted as a string. You're better off just returning a list with something like the following. #+begin_src emacs-lisp :results output table (let (txts) (with-current-buffer "*Messages*" (goto-char (point-min)) (while (re-search-forward "^Retrieving newsgroup: \\(.+\\)" nil t) (push (match-string 1) txts))) txts) #+end_src -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D