emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with https://orgmode.org/manual/Results-of-Evaluation.html


From: Ihor Radchenko
Subject: Re: problem with https://orgmode.org/manual/Results-of-Evaluation.html
Date: Tue, 16 Jan 2024 16:45:16 +0000

Uwe Brauer via "General discussions about Org-mode."
<emacs-orgmode@gnu.org> writes:

> Ok understood, but then, who can I add hlines to table that does not
> possess any?

#+name: test
| 1 | 2 |
| 3 | 4 |

#+name: add-hlines
#+begin_src emacs-lisp :var table='(1 2) :results value
(let (result)
  (when table
    (unless (eq 'hline (car table)) (push 'hline result))
    (while table
      (push (pop table) result)
      (unless (eq 'hline (car result))
        (push 'hline result)))
    (nreverse result)))
#+end_src


#+begin_src python :var table=test :post add-hlines(table=*this*)
return [[1+x for x in row] for row in table]
#+end_src

#+RESULTS[63f00119cafb9b4a9e762f7f19db5d5c0b215d2d]:
|---+---|
| 2 | 3 |
|---+---|
| 4 | 5 |
|---+---|


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]