From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: LaTeX export: Keep point position in TeX file Date: Thu, 12 Jan 2012 13:14:26 +0000 Message-ID: <87hb01qczx.fsf@ucl.ac.uk> References: <4f0ed0da.82600e0a.21d0.29ec@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlKUI-0000KV-Rx for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 08:14:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlKUE-0006Pk-I1 for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 08:14:38 -0500 Received: from vscane-c.ucl.ac.uk ([144.82.108.43]:55428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlKUE-0006PP-CY for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 08:14:34 -0500 In-Reply-To: <4f0ed0da.82600e0a.21d0.29ec@mx.google.com> (Michael Bach's message of "Thu, 12 Jan 2012 13:28:29 +0100") 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: Michael Bach Cc: emacs-orgmode@gnu.org Michael Bach writes: > Hello everyone, > > The way I am now doing LaTeX export is that I have the exported tex > buffer below the org buffer. When I do an export via `C-c C-e l' the > .tex buffer gets updated, but point jumps to beginning of buffer instead > of staying where it was. (How) Can I changed that so point stays near > where it was before I exported again? > > Best Regards, > Michael I think this behaviour arises because the exporter exports to a buffer which it first empties. So the behaviour you see is very different from when Emacs "reverts" a buffer when the file changes out from under it. If so, I suggest you could achieve what you want by using the org-export-* hooks to, for instance, save current position before export and then jump to that position after export? Maybe org-export-first-hook and org-export-latex-final-hook could be used? Untried and obviously untested! And likely beyond my elisp capabilities so I'd be very keen on seeing a solution. This behaviour has also bothered me (well, very minor irritation) for a long time as I often export to latex when debugging the export to PDF. HTH, eric -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1 : using Org-mode version 7.8.03 (release_7.8.03.106.gc835)