[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Misbehavior of tex-print in Elisp: workaround, please?

From: Joe Fineman
Subject: Misbehavior of tex-print in Elisp: workaround, please?
Date: Sat, 15 Jan 2005 18:14:55 GMT
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

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

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

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.  Nor can
I find, using apropos, any functions that can do that within a

Specifically, I am trying to write a utility that will print out part
or all of the current buffer in TeX monospace:

(defun lpr-literal (r/b)
  "Print all or part of buffer with TeX literal mode."
  (interactive "cr(egion) or b(uffer)?")
  (let ((passage (if (equal r/b ?r)
                     (buffer-substring (region-beginning) (region-end))
                   (if (equal r/b ?b)
                       (buffer-substring (point-min) (point-max))))))
    (find-file "/usr/own/f/tex/Lpr-scratch.tex")
    (delete-region (point-min) (point-max))
    (insert-file "~/tex/Tex-literal-hdr")
    (goto-char (point-max))
    (insert passage)
    (goto-char (point-max))
    (insert-file "~/tex/Tex-literal-ftr")
    (untabify (point-min) (point-max))
    (goto-char (point-min))
    (replace-regexp "\e.\\|\C-r" "")

This works up to the the last line, which prints, not what was just
run, but what was last run from the keyboard. 

I have tried to fool the command by using (command-execute
(key-binding ...))  in the last two lines, but it sees thru that.  I
have also tried resetting various variables such as
tex-last-buffer-texed, to no avail.

It may be rude to call this behavior a bug, inasmuch as it must have
taken some programming effort to produce it, but what on earth is the
point of it?

Another command that, frustratingly & AFAICT pointlessly, won't work
when called in Elisp is browse-url.
---  Joe Fineman    address@hidden

||:  November: the eleventh twelfth of a weariness.  :||

reply via email to

[Prev in Thread] Current Thread [Next in Thread]