unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Follow-up: How to call tex-buffer & tex-print in an Elisp program
@ 2007-02-15  1:32 Joe Fineman
  2007-02-15  7:53 ` Joost Kremers
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Fineman @ 2007-02-15  1:32 UTC (permalink / raw)
  To: help-gnu-emacs

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.  :||

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Follow-up: How to call tex-buffer & tex-print in an Elisp program
  2007-02-15  1:32 Follow-up: How to call tex-buffer & tex-print in an Elisp program Joe Fineman
@ 2007-02-15  7:53 ` Joost Kremers
  0 siblings, 0 replies; 2+ messages in thread
From: Joost Kremers @ 2007-02-15  7:53 UTC (permalink / raw)
  To: help-gnu-emacs

Joe Fineman wrote:
>> 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.  [...]

the first statement is not misleading if you read it correctly. it say that
tex-print prints the dvi file made by M-x tex-region etc. note the M-x: it
actually talks about these commands being called *interactively*.

-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-15  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-15  1:32 Follow-up: How to call tex-buffer & tex-print in an Elisp program Joe Fineman
2007-02-15  7:53 ` Joost Kremers

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).