yatex

changeset 577:117a846879bc dev

merged
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 26 Nov 2019 08:26:49 +0900
parents 777d17c07759 70bb775b481c
children 4dad5f91b26c
files yatexprc.el
diffstat 2 files changed, 19 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/.hgtags	Thu Oct 17 09:52:31 2019 +0900
     1.2 +++ b/.hgtags	Tue Nov 26 08:26:49 2019 +0900
     1.3 @@ -19,4 +19,5 @@
     1.4  0e37ced833ef9388295be594da9bc91ff6eae037 yatex-1.80
     1.5  0e37ced833ef9388295be594da9bc91ff6eae037 yatex-1.80
     1.6  a2bb2426a15410438d5e5917ce939bd4bbbe8194 yatex-1.80
     1.7 +ca7cf34e959cc35960081f25b0f903b1bd2a191f master-beginning
     1.8  fbb636ff0fe3fd784af7697db5805a20d33b04d2 yatex-1.81
     2.1 --- a/yatexprc.el	Thu Oct 17 09:52:31 2019 +0900
     2.2 +++ b/yatexprc.el	Tue Nov 26 08:26:49 2019 +0900
     2.3 @@ -1,7 +1,7 @@
     2.4  ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*-
     2.5  ;;; 
     2.6  ;;; (c)1993-2018 by HIROSE Yuuji.[yuuji@yatex.org]
     2.7 -;;; Last modified Sat Oct  5 12:44:16 2019 on firestorm
     2.8 +;;; Last modified Mon Nov 25 21:01:57 2019 on monster
     2.9  ;;; $Id$
    2.10  
    2.11  ;;; Code:
    2.12 @@ -168,6 +168,8 @@
    2.13  (defvar YaTeX-typeset-rerun-msg "Rerun to get cross-references right.")
    2.14  (defvar YaTeX-typeset-citation-msg
    2.15    "Warning: Citation \`")
    2.16 +(defvar YaTeX-typeset-remove-dvi-when-pdf t
    2.17 +  "*Non-nil means removing dvi file which has same rootname as PDF output")
    2.18  (defun YaTeX-typeset-sentinel (proc mes)
    2.19    (cond ((null (buffer-name (process-buffer proc)))
    2.20           ;; buffer killed
    2.21 @@ -303,12 +305,22 @@
    2.22  			 (if (save-excursion
    2.23  			       (re-search-backward
    2.24  				(concat
    2.25 -				 "^Output written on .*\\.pdf (.*page,"
    2.26 -				 "\\|\\.dvi -> .*\\.pdf$")
    2.27 +				 "^Output written on \\(.*\\.pdf\\) (.*page,"
    2.28 +				 "\\|.* -> \\(.*\\.pdf\\)$")
    2.29  				nil t))
    2.30 -			     ;; If PDF output log found in buffer,
    2.31 -			     ;; set next default previewer to 'pdf viewer
    2.32 -			     (put 'dvi2-command 'format 'pdf))
    2.33 +			     (let*((pdf (or (YaTeX-match-string 1)
    2.34 +					    (YaTeX-match-string 2)))
    2.35 +				   (rootname (substring
    2.36 +					      pdf 0 (rindex pdf ?.)))
    2.37 +				   (dvi (format "%s.dvi" rootname))
    2.38 +				   (log (format "%s.log" rootname)))
    2.39 +			       ;; If PDF output log found in buffer,
    2.40 +			       ;; set next default previewer to 'pdf viewer
    2.41 +			       (put 'dvi2-command 'format 'pdf)
    2.42 +			       (if YaTeX-typeset-remove-dvi-when-pdf
    2.43 +				   (progn
    2.44 +				     (delete-file log) ;Ugly, should not do here
    2.45 +				     (delete-file dvi)))))
    2.46  		       ;;Confirm process buffer to be shown when error
    2.47  		       (YaTeX-showup-buffer
    2.48  			pbuf 'YaTeX-showup-buffer-bottom-most)