emacs - AUCTeX: Run Compile Command n-times -


i'd have function asks number n , executes default compile command n-times afterwards. unlike c-c c-c (i.e. tex-command-master) don't want asked command run, should select default compile command based on auctex settings. naturally if error occurs execution should stop.

i know tex-texify, however, doesn't statisfy needs because want emacs run pdflatex 5 times indepent of auctex parser thinks adequate.

any appreciated!


edit: have looked little further , using code above reference have started writing function this. however, has 1 major flaw. let me first give code:

(defcustom tex-multitex-command "latex" "default multitex command" :type 'string :group 'tex-command) (defun tex-multitex (n)   "run tex-command n-times"   (interactive "nrun tex/latex how many times: ")   (while (> n 0)       (tex-command tex-multitex-command 'tex-master-file)     (setq n (- n 1)))) 

as can see, have implemented config variable selecting correct compilation command. let me present problem:

the compilation of latex document takes time, however, function instantly calls second (and following) executions of compile command. maybe can provide in finding solution checks whether compilation has finished prior executing (tex-command tex-multitex-command 'tex-master-file), executes said function or prints error message if compilation finished error.

with of code of tex-texify function have developed function want, code given below.

i'd thank user4815162342; although solution not based on suggestion, think solution might of use different problem. i'd thank tn, author of tex-texify, shamelessly took , adapted code problem. ;)

(defcustom tex-multitex-command "latex"   "default multitex command"   :type 'string :group 'tex-command)  (defun tex-multitex-sentinel (&optional proc sentinel)   "non-interactive! call standard-sentinel of current latex-process. if there still left do start next latex-command."   (set-buffer (process-buffer proc))   (funcall tex-multitex-sentinel proc sentinel)   (let ((case-fold-search nil))     (when (string-match "\\(finished\\|exited\\)" sentinel)       (set-buffer tex-command-buffer)       (unless (plist-get tex-error-report-switches (intern (tex-master-file)))         (tex-multitex tex-multitex-num-left)))))  (defun tex-multitex (n)   "run tex-command n-times"   (interactive "nrun tex/latex how many times: ")   (when (or (called-interactively-p 'any)         (null (boundp 'tex-multitex-num-left)))     (setq tex-multitex-num-left n))   (if (>= tex-multitex-num-left 1)       (progn     (tex-command tex-multitex-command 'tex-master-file)     (setq tex-multitex-num-left (- tex-multitex-num-left 1))     (setq proc (get-buffer-process (current-buffer)))     (setq tex-multitex-sentinel (process-sentinel proc))     (set-process-sentinel proc 'tex-multitex-sentinel)))) 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -