From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: execute lisp function after enter a cell in a org-table Date: Mon, 31 Oct 2011 22:50:05 +0900 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:45175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKsFf-0006yP-2a for emacs-orgmode@gnu.org; Mon, 31 Oct 2011 09:50:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKsFa-0001dd-Vb for emacs-orgmode@gnu.org; Mon, 31 Oct 2011 09:50:11 -0400 Received: from mail-gy0-f169.google.com ([209.85.160.169]:48360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKsFa-0001cJ-MK for emacs-orgmode@gnu.org; Mon, 31 Oct 2011 09:50:06 -0400 Received: by gyg8 with SMTP id 8so1256274gyg.0 for ; Mon, 31 Oct 2011 06:50:05 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode Mailing List 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