From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: org-mode 7.5, save-excursion does not work in tables Date: Thu, 23 Jun 2011 16:31:33 +0530 Message-ID: <81tybgizg2.fsf@gmail.com> References: <87hb7gc2vn.fsf@gilgamesch.quim.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZhei-0005BJ-V2 for emacs-orgmode@gnu.org; Thu, 23 Jun 2011 07:01:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZheh-0006P0-45 for emacs-orgmode@gnu.org; Thu, 23 Jun 2011 07:01:04 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:64987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZheg-0006Oj-Kx for emacs-orgmode@gnu.org; Thu, 23 Jun 2011 07:01:02 -0400 Received: by pvc12 with SMTP id 12so1298723pvc.0 for ; Thu, 23 Jun 2011 04:01:00 -0700 (PDT) In-Reply-To: <87hb7gc2vn.fsf@gilgamesch.quim.ucm.es> (Uwe Brauer's message of "Thu, 23 Jun 2011 11:29:16 +0200") 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: Uwe Brauer Cc: emacs-orgmode@gnu.org > Hello > > I want a simple function which allows me to insert a new row > before I wrap a region. (Because otherwise rows which > already contain information get disordered.) > > Like > > (defun my-org-wrap-cell () > (interactive) > (save-excursion > (progn > (org-table-insert-row 1) > (org-table-wrap-region nil)))) > > However the save excursion does not work: the cursor even jumps > outside the table. Have you looked at markers? http://www.gnu.org/s/emacs/manual/html_node/elisp/Markers.html#Markers Basicall you will put a marker, prettify the buffer, jump to the marker and free it. M-x apropos RET marker shows a bunch of files (including org) that use markers. > > Example > > > | Nombre | | Qual | Comment | > | Jim Miller | | | % Some very long text: UB:23.06.2011 Wrong: instead > | of t use the third component of the vecto | > | John Smith | | | Not much | > |------------+---+------+-----------------------------------------------------------------------------------------------| > > The wrap function does this > | Nombre | | Qual | Comment | > | Jim Miller | | | % Some very long text: UB:23.06.2011 Wrong: | > | John Smith | | | instead of t use the third component of the vecto > | Not much | > |------------+---+------+------------------------------------------------------------| > > Instead of > > > | Nombre | | Qual | Comment | > | Jim Miller | | | % Some very long text: UB:23.06.2011 Wrong: | > | | | | instead of t use the third component of the vecto | > | John Smith | | | Not much | > |------------+---+------+---------------------------------------------------| --