[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] changing cells in an org-mode table with Emacs lisp
From: |
Michael Brand |
Subject: |
Re: [O] changing cells in an org-mode table with Emacs lisp |
Date: |
Sun, 28 Dec 2014 19:38:00 +0100 |
Hi Tamas
On Sat, Dec 27, 2014 at 5:37 PM, Tamas Papp <address@hidden> wrote:
> | a | a |
> | aa | aa |
> | aaa | aaa |
>
> would be replaced by
>
> | *a* | *a* |
> | aa | *aa* |
> | aaa | aaa |
#+BEGIN_SRC emacs-lisp :results silent
(defun format-cell (cell row col)
(if (<= (length cell) col)
(concat "*" cell "*")
cell))
#+END_SRC
| *a* | *a* |
| aa | *aa* |
| aaa | aaa |
#+TBLFM: @<$<..@>$> = '(format-cell @0$0 (org-table-current-dline)
(org-table-current-column))
or
#+TBLFM: @<$<..@>$> = '(format-cell @0$0 @# $#)
For explanations please see the manual.
Michael