diff --git a/.hgtags b/.hgtags index 094811c..1a426f7 100644 --- a/.hgtags +++ b/.hgtags @@ -19,4 +19,5 @@ 0e37ced833ef9388295be594da9bc91ff6eae037 yatex-1.80 0e37ced833ef9388295be594da9bc91ff6eae037 yatex-1.80 a2bb2426a15410438d5e5917ce939bd4bbbe8194 yatex-1.80 +ca7cf34e959cc35960081f25b0f903b1bd2a191f master-beginning fbb636ff0fe3fd784af7697db5805a20d33b04d2 yatex-1.81 diff --git a/yatexprc.el b/yatexprc.el index 1dcebc1..2f4e35c 100644 --- a/yatexprc.el +++ b/yatexprc.el @@ -1,7 +1,7 @@ ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*- ;;; ;;; (c)1993-2018 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sat Oct 5 12:44:16 2019 on firestorm +;;; Last modified Mon Nov 25 21:01:57 2019 on monster ;;; $Id$ ;;; Code: @@ -168,6 +168,8 @@ (defvar YaTeX-typeset-rerun-msg "Rerun to get cross-references right.") (defvar YaTeX-typeset-citation-msg "Warning: Citation \`") +(defvar YaTeX-typeset-remove-dvi-when-pdf t + "*Non-nil means removing dvi file which has same rootname as PDF output") (defun YaTeX-typeset-sentinel (proc mes) (cond ((null (buffer-name (process-buffer proc))) ;; buffer killed @@ -303,12 +305,22 @@ (if (save-excursion (re-search-backward (concat - "^Output written on .*\\.pdf (.*page," - "\\|\\.dvi -> .*\\.pdf$") + "^Output written on \\(.*\\.pdf\\) (.*page," + "\\|.* -> \\(.*\\.pdf\\)$") nil t)) - ;; If PDF output log found in buffer, - ;; set next default previewer to 'pdf viewer - (put 'dvi2-command 'format 'pdf)) + (let*((pdf (or (YaTeX-match-string 1) + (YaTeX-match-string 2))) + (rootname (substring + pdf 0 (rindex pdf ?.))) + (dvi (format "%s.dvi" rootname)) + (log (format "%s.log" rootname))) + ;; If PDF output log found in buffer, + ;; set next default previewer to 'pdf viewer + (put 'dvi2-command 'format 'pdf) + (if YaTeX-typeset-remove-dvi-when-pdf + (progn + (delete-file log) ;Ugly, should not do here + (delete-file dvi))))) ;;Confirm process buffer to be shown when error (YaTeX-showup-buffer pbuf 'YaTeX-showup-buffer-bottom-most)