emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Torsten Wagner <torsten.wagner@gmail.com>
To: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: execute lisp function after enter a cell in a org-table
Date: Mon, 31 Oct 2011 22:50:05 +0900	[thread overview]
Message-ID: <CAPaq-gMCVsSQN8vSTpSKRiMENBnG1Eepdep7LRTmJN=gXxa1_Q@mail.gmail.com> (raw)

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	other threads:[~2011-10-31 13:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPaq-gMCVsSQN8vSTpSKRiMENBnG1Eepdep7LRTmJN=gXxa1_Q@mail.gmail.com' \
    --to=torsten.wagner@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).