Mercurial > hgrepos > hgweb.cgi > yatex
comparison yatexprc.el @ 577:117a846879bc dev
merged
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Tue, 26 Nov 2019 08:26:49 +0900 |
parents | 80692d8b8828 70bb775b481c |
children | 4dad5f91b26c |
comparison
equal
deleted
inserted
replaced
575:777d17c07759 | 577:117a846879bc |
---|---|
1 ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*- | 1 ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*- |
2 ;;; | 2 ;;; |
3 ;;; (c)1993-2018 by HIROSE Yuuji.[yuuji@yatex.org] | 3 ;;; (c)1993-2018 by HIROSE Yuuji.[yuuji@yatex.org] |
4 ;;; Last modified Sat Oct 5 12:44:16 2019 on firestorm | 4 ;;; Last modified Mon Nov 25 21:01:57 2019 on monster |
5 ;;; $Id$ | 5 ;;; $Id$ |
6 | 6 |
7 ;;; Code: | 7 ;;; Code: |
8 ;(require 'yatex) | 8 ;(require 'yatex) |
9 (require 'yatexlib) | 9 (require 'yatexlib) |
166 Supplying an integer to this variable inhibit compulsory call of bibtex, | 166 Supplying an integer to this variable inhibit compulsory call of bibtex, |
167 thus, it call bibtex only if warning messages about citation are seen.") | 167 thus, it call bibtex only if warning messages about citation are seen.") |
168 (defvar YaTeX-typeset-rerun-msg "Rerun to get cross-references right.") | 168 (defvar YaTeX-typeset-rerun-msg "Rerun to get cross-references right.") |
169 (defvar YaTeX-typeset-citation-msg | 169 (defvar YaTeX-typeset-citation-msg |
170 "Warning: Citation \`") | 170 "Warning: Citation \`") |
171 (defvar YaTeX-typeset-remove-dvi-when-pdf t | |
172 "*Non-nil means removing dvi file which has same rootname as PDF output") | |
171 (defun YaTeX-typeset-sentinel (proc mes) | 173 (defun YaTeX-typeset-sentinel (proc mes) |
172 (cond ((null (buffer-name (process-buffer proc))) | 174 (cond ((null (buffer-name (process-buffer proc))) |
173 ;; buffer killed | 175 ;; buffer killed |
174 (set-process-buffer proc nil)) | 176 (set-process-buffer proc nil)) |
175 ((memq (process-status proc) '(signal exit)) | 177 ((memq (process-status proc) '(signal exit)) |
301 (if (equal 0 (process-exit-status proc)) | 303 (if (equal 0 (process-exit-status proc)) |
302 ;; Successful typesetting done | 304 ;; Successful typesetting done |
303 (if (save-excursion | 305 (if (save-excursion |
304 (re-search-backward | 306 (re-search-backward |
305 (concat | 307 (concat |
306 "^Output written on .*\\.pdf (.*page," | 308 "^Output written on \\(.*\\.pdf\\) (.*page," |
307 "\\|\\.dvi -> .*\\.pdf$") | 309 "\\|.* -> \\(.*\\.pdf\\)$") |
308 nil t)) | 310 nil t)) |
309 ;; If PDF output log found in buffer, | 311 (let*((pdf (or (YaTeX-match-string 1) |
310 ;; set next default previewer to 'pdf viewer | 312 (YaTeX-match-string 2))) |
311 (put 'dvi2-command 'format 'pdf)) | 313 (rootname (substring |
314 pdf 0 (rindex pdf ?.))) | |
315 (dvi (format "%s.dvi" rootname)) | |
316 (log (format "%s.log" rootname))) | |
317 ;; If PDF output log found in buffer, | |
318 ;; set next default previewer to 'pdf viewer | |
319 (put 'dvi2-command 'format 'pdf) | |
320 (if YaTeX-typeset-remove-dvi-when-pdf | |
321 (progn | |
322 (delete-file log) ;Ugly, should not do here | |
323 (delete-file dvi))))) | |
312 ;;Confirm process buffer to be shown when error | 324 ;;Confirm process buffer to be shown when error |
313 (YaTeX-showup-buffer | 325 (YaTeX-showup-buffer |
314 pbuf 'YaTeX-showup-buffer-bottom-most) | 326 pbuf 'YaTeX-showup-buffer-bottom-most) |
315 (message "Command FAILED!")) | 327 (message "Command FAILED!")) |
316 ;;pull back original mode-name | 328 ;;pull back original mode-name |