From mboxrd@z Thu Jan 1 00:00:00 1970 From: ishi soichi Subject: Re: Elisp code to insert a word in table Date: Sat, 4 Dec 2010 20:27:46 +0900 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2059304055==" Return-path: Received: from [140.186.70.92] (port=47253 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POqHM-00051m-VI for emacs-orgmode@gnu.org; Sat, 04 Dec 2010 06:27:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POqHM-0000vO-2T for emacs-orgmode@gnu.org; Sat, 04 Dec 2010 06:27:48 -0500 Received: from mail-pz0-f41.google.com ([209.85.210.41]:41905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POqHL-0000uh-Q3 for emacs-orgmode@gnu.org; Sat, 04 Dec 2010 06:27:48 -0500 Received: by pzk27 with SMTP id 27so4122016pzk.0 for ; Sat, 04 Dec 2010 03:27:46 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org --===============2059304055== Content-Type: multipart/alternative; boundary=001636e0b961b17b4a049693f164 --001636e0b961b17b4a049693f164 Content-Type: text/plain; charset=ISO-8859-1 Ah, I need more help, though... I have tried this code. I made it as simple as possible to clarify my question. (defun add-word () (interactive) '(org-table-put (@2 $2 "word!"))) and execute in a buffer having a table already. It did not work at all. But also I kept wondering what could happen if there are two separate tables in the same buffer? I checked cells with C-c?, then realized that the cell locations are not unique in more than one table. So, there must be a way to identify the table in question. Thanks again. soichi 2010/12/3 ishi soichi > Thanks for such a quick response! > > soichi > > 2010/12/3 Carsten Dominik > > Hi Ishi, >> >> >> On Dec 3, 2010, at 10:00 AM, ishi soichi wrote: >> >> Hi. I'm trying to write an elisp code to enter words into a table of >>> org-mode. >>> >>> after designating a buffer, which already contains a table, I simply >>> wrote, >>> >>> '(insert "test!" @2$2) >>> >>> does not work obviously. >>> >> >> indeed. >> >> >> >> >>> Do I need to move the "point" to the particular cell before inserting? >>> >> >> You could to that, using the functions org-table-goto-line and then >> org-table-goto-column. >> >> However, it is easier to use, for programmatic access to fields, the >> functions >> `org-table-put' and `org-table-get'. >> >> - Carsten >> > > --001636e0b961b17b4a049693f164 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ah, I need more help, though...

I have tried this code. = =A0I made it as simple as possible to clarify my question.

(defun add-word ()
=A0=A0(interactive)
= =A0=A0'(org-table-put (@2 $2 "word!")))

and execute in a buffer having a table already. =A0It d= id not work at all.

But also I kept wondering what= could happen if there are two separate tables in the same buffer? =A0I che= cked cells with C-c?, then realized that the cell locations are not unique = in more than one table. =A0So, there must be a way to identify the table in= question.

Thanks again.

soichi

=
2010/12/3 ishi soichi <soichi777@gmail.com>
Thanks for such a quick response!

soichi

2010/12/3 Carsten Dominik <carsten.dominik@gma= il.com>

Hi Ishi,


On Dec 3, 2010, at 10:00 AM, ishi soichi wrote:

Hi. I'm trying to write an elisp code to enter words into a table of or= g-mode.

after designating a buffer, which already contains a table, I simply wrote,=

=A0 =A0'(insert "test!" @2$2)

does not work obviously.

indeed.




Do I need to move the "point" to the particular cell before inser= ting?

You could to that, using the functions org-table-goto-line and then org-tab= le-goto-column.

However, it is easier to use, for programmatic access to fields, the functi= ons
`org-table-put' and `org-table-get'.

- Carsten


--001636e0b961b17b4a049693f164-- --===============2059304055== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============2059304055==--