yatex

changeset 325:2561570d7194 dev

evince usage; YaTeX-parent-file handling: Default previewer after [prefix] t d changed to PDF viewer. YaTeX-parent-file set to absolute-path after main-file ask.
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 05 Nov 2014 08:39:47 +0900
parents b6500fb81ee0
children d989511a492a
files yatexprc.el
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/yatexprc.el	Sun Sep 21 14:15:42 2014 +0900
     1.2 +++ b/yatexprc.el	Wed Nov 05 08:39:47 2014 +0900
     1.3 @@ -1,7 +1,7 @@
     1.4  ;;; yatexprc.el --- YaTeX process handler
     1.5  ;;; 
     1.6  ;;; (c)1993-2013 by HIROSE Yuuji.[yuuji@yatex.org]
     1.7 -;;; Last modified Mon Apr  1 22:44:38 2013 on firestorm
     1.8 +;;; Last modified Wed Nov  5 08:28:49 2014 on firestorm
     1.9  ;;; $Id$
    1.10  
    1.11  ;;; Code:
    1.12 @@ -608,7 +608,10 @@
    1.13     (let* ((command (read-string-with-history
    1.14  		    "Preview command: "
    1.15  		    (YaTeX-replace-format
    1.16 -		     (or (YaTeX-get-builtin "PREVIEW") dvi2-command)
    1.17 +		     (or (YaTeX-get-builtin "PREVIEW")
    1.18 +			 (if (eq (get 'dvi2-command 'format) 'pdf)
    1.19 +			     tex-pdfview-command
    1.20 +			   dvi2-command))
    1.21  		     "p" (format (cond
    1.22  				  (YaTeX-dos "-y:%s")
    1.23  				  (t "-paper %s"))
    1.24 @@ -859,6 +862,9 @@
    1.25  	 (fname (if rin (substring latex-cmd (1+ rin)) ""))
    1.26  	 (r (YaTeX-assoc-regexp preview-command YaTeX-dvi2-command-ext-alist))
    1.27  	 (ext (if r (cdr r) "")))
    1.28 +    (and (null r)
    1.29 +	 (eq (get 'dvi2-command 'format) 'pdf)
    1.30 +	 (setq ext "pdf"))
    1.31      (concat
    1.32       (if (string= fname "")
    1.33  	 (setq fname (substring (file-name-nondirectory
    1.34 @@ -997,7 +1003,7 @@
    1.35    (let ((ff (function (lambda (f)
    1.36  			(if setbuf (set-buffer (find-file-noselect f))
    1.37  			  (find-file f)))))
    1.38 -	b-in main-file YaTeX-create-file-prefix-g
    1.39 +	b-in main-file mfa YaTeX-create-file-prefix-g
    1.40  	(hilit-auto-highlight (not setbuf)))
    1.41      (if (setq b-in (YaTeX-get-builtin "!"))
    1.42  	(setq main-file (YaTeX-guess-parent b-in)))
    1.43 @@ -1022,9 +1028,9 @@
    1.44         ((and main-file
    1.45  	     (file-exists-p (setq main-file (concat "../" main-file)))
    1.46  	     (or b-in
    1.47 -		 (y-or-n-p (concat (expand-file-name main-file)
    1.48 +		 (y-or-n-p (concat (setq mfa (expand-file-name main-file))
    1.49  				   " is main file?:"))))
    1.50 -	(setq YaTeX-parent-file main-file)
    1.51 +	(setq YaTeX-parent-file mfa)
    1.52  	;(YaTeX-switch-to-buffer main-file setbuf)
    1.53  	(funcall ff main-file)
    1.54  	)