[Top][All Lists]

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

[AUCTeX] Re: TeX-clean misbehaviour

From: Ralf Angeli
Subject: [AUCTeX] Re: TeX-clean misbehaviour
Date: Mon, 21 Sep 2009 21:12:05 +0200

* Uwe Siart (2009-09-20) writes:

> Are you aware that your documents can never have cross references or a 
> toc if you purge .aux and .toc immediately after each LaTeX run?  

While thinking about this thread I had an idea about how to automate
running commands in AUCTeX.  And since we've occasionally been getting
requests about this, I toyed around with the idea a bit.  Unfortunately
one cannot do this without user intervention at the moment because some
necessary logic is in `TeX-command-query' which asks the user about the
command, but some semi-automatic processing would be possible:

(defun TeX-command-master-semi-auto ()
  "Query for commands to run till successful finish or error."
  (let ((buf (current-buffer))
        (TeX-process-asynchronous nil)
    (catch 'error
      (while (not (string= (setq command (TeX-command-query (TeX-master-file)))
        (TeX-command command 'TeX-master-file)
        (set-buffer buf)
        (when (plist-get TeX-error-report-switches (intern (TeX-master-file)))
          (throw 'error nil))))))

(define-key TeX-mode-map (kbd "<f5>") 'TeX-command-master-semi-auto)

Note that this is really crude.  The main issue is that it has to ask
for the command in order to determine what to do next.  Since the call
of the "View" command is the abort criterion, it will ask for that and
if the user accepts, do nothing.  I might try to enhance this and get it
into AUCTeX proper when I find some time.


reply via email to

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