emacs-orgmode
[Top][All Lists]
Advanced

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

[O] execute lisp function after enter a cell in a org-table


From: Torsten Wagner
Subject: [O] execute lisp function after enter a cell in a org-table
Date: Mon, 31 Oct 2011 22:50:05 +0900

Hi,
I make my tiny steps in learning elisp by trying to improve org-mode
for my own needs.
Recently, I came across the needs to execute a small lisp function
whenever I enter the next / previous column in a org-mode table.
I thought it might be interesting if I could try to keep this as
general as possible. Think about calling a certain lisp function
whenever you enter a certain column in a table.
For my needs it would be (set-input-method 'foo) to change
automatically the input method. This would allow to type in two
different languages within the table. However, it could be anything
else, from validating input data, change between different minor modes
or automatic table formatting of the table itself (think about tables
with a fixed narrow column width and an automatic extension of the
current selected column),

I'm still in the middle of implementing this and want to ask
a) is there a general interest for such a feature?
b) for some guidance from the org-mode wizards ;)

I read a bit in org-table.el and there is a function
"org-table-current-column" which does already half of the job.
If I understand right I would have to create a new lisp function which
executes the given lisp snippets for a given column (I would like to
add them like normal table functions).
This new function would been a hook function? As far as I read throw
all possible hook functions, I could not find any which would be
called within tables for each jump into a cell or column.
I thought the tab-function itself (which let the cursor jump into the
next column) might be used. but I am unsure about this. Similar the
present way of tables to execute lisp functions is limited to updates
of the table. However as far as I could understand the simple movement
of the cursor does not trigger an table update.

Any ideas, help and pointers to org-mode code would be nice. For
learning purpose, I really want to go through this by myself, so
please no "add this to your .emacs" stuff ;)

Totti



reply via email to

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