"Sebastien Vauban" <sva-n...@mygooglest.com> 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

Reply via email to