emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Michael Bach <phaebz@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: LaTeX export: Keep point position in TeX file
Date: Thu, 12 Jan 2012 13:14:26 +0000	[thread overview]
Message-ID: <87hb01qczx.fsf@ucl.ac.uk> (raw)
In-Reply-To: <4f0ed0da.82600e0a.21d0.29ec@mx.google.com> (Michael Bach's message of "Thu, 12 Jan 2012 13:28:29 +0100")

Michael Bach <phaebz@gmail.com> 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)

  reply	other threads:[~2012-01-12 13:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12 12:28 LaTeX export: Keep point position in TeX file Michael Bach
2012-01-12 13:14 ` Eric S Fraga [this message]
2012-01-23 22:09   ` Michael Bach
2012-01-24  8:50     ` Eric S Fraga

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=87hb01qczx.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=phaebz@gmail.com \
    /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).