unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joe Fineman <joe_f@verizon.net>
To: help-gnu-emacs@gnu.org
Subject: Follow-up: How to call tex-buffer & tex-print in an Elisp program
Date: Thu, 15 Feb 2007 01:32:06 GMT	[thread overview]
Message-ID: <uejosmcjx.fsf@verizon.net> (raw)

Posting another complaint about tex-print reminded me that I had
neglected to follow up an earlier one (15 January 2005):

> I am using Emacs 21.3.1 under Windows XP.

> The documentation for the command tex-print says

>   Print the .dvi file made by M-x tex-region, M-x tex-buffer or M-x
>   tex-file.

> The printed TeX manual (§21.9.3), on the other hand, says s.v. C-c C-p

>   Print the output from the last C-c C-r, C-c C-b, or C-c C-f command
>   (tex-print).

> It appears the the first statement is misleading, and the second
> statement is literally true, that is, tex-print prints the output from
> the last such command keyed from the keyboard.  It does not not see
> the output of such commands if they are called within Elisp.  [...]

This received no reply, possibly because it contained a bad guess &
some bad temper.  But a little later, in another place, I happened on
the answer:

>   From: David Kastrup <dak@gnu.org>
>   Newsgroups: comp.emacs
>   Subject: Re: AUCTeX: More than one TeX-command in a function
>   Date: Tue, 15 Feb 2005 17:47:54 +0100

>   Niels Teglsbo <teglsbo@diku.dk> writes:

>   > What I wanted was something like TeX-command-master that would
>   > compile /and/ view in one operation, with one keypress.

>   This is not supported at the moment.  You have to be aware that all
>   AUCTeX commands (practically all) only _start_ a TeX process and
>   don't wait for its completion.  That is so that you can resume
>   editing while LaTeX is working in the background.  But that means
>   that starting sequences of commands is a rather complicated
>   procedure.  [...]

So the problem is that tex-print does not see the output of the
preceding tex-buffer, because it hasn't finished running at the time
that tex-print runs.  That is why it prints out the .dvi from job
before.  It has nothing to do with how either job was called.  The
moral is, give it time:

  (tex-buffer)
  (sleep-for 4)
  (tex-print)

I have found 4 s to be adequate.
-- 
---  Joe Fineman    joe_f@verizon.net

||:  The starting point of conversation is contradiction.  :||

             reply	other threads:[~2007-02-15  1:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-15  1:32 Joe Fineman [this message]
2007-02-15  7:53 ` Follow-up: How to call tex-buffer & tex-print in an Elisp program Joost Kremers

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.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uejosmcjx.fsf@verizon.net \
    --to=joe_f@verizon.net \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).