# HG changeset patch # User HIROSE Yuuji # Date 1574724409 -32400 # Node ID 117a846879bca80c98bc7c53ea24bdaf6cd88851 # Parent 777d17c077598b1813a74734c1b32565ff0d37d8# Parent 70bb775b481ce743d8da84eb207d6c4b7121297d merged diff -r 777d17c07759 -r 117a846879bc .hgtags --- a/.hgtags Thu Oct 17 09:52:31 2019 +0900 +++ b/.hgtags Tue Nov 26 08:26:49 2019 +0900 @@ -19,4 +19,5 @@ 0e37ced833ef9388295be594da9bc91ff6eae037 yatex-1.80 0e37ced833ef9388295be594da9bc91ff6eae037 yatex-1.80 a2bb2426a15410438d5e5917ce939bd4bbbe8194 yatex-1.80 +ca7cf34e959cc35960081f25b0f903b1bd2a191f master-beginning fbb636ff0fe3fd784af7697db5805a20d33b04d2 yatex-1.81 diff -r 777d17c07759 -r 117a846879bc yatexprc.el --- a/yatexprc.el Thu Oct 17 09:52:31 2019 +0900 +++ b/yatexprc.el Tue Nov 26 08:26:49 2019 +0900 @@ -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)