# HG changeset patch # User HIROSE Yuuji # Date 1415144387 -32400 # Node ID 2561570d7194da991f189b7ffda43c4626a919c5 # Parent b6500fb81ee0cd28f66bde821e06b3674288b0d4 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. diff -r b6500fb81ee0 -r 2561570d7194 yatexprc.el --- a/yatexprc.el Sun Sep 21 14:15:42 2014 +0900 +++ b/yatexprc.el Wed Nov 05 08:39:47 2014 +0900 @@ -1,7 +1,7 @@ ;;; yatexprc.el --- YaTeX process handler ;;; ;;; (c)1993-2013 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Mon Apr 1 22:44:38 2013 on firestorm +;;; Last modified Wed Nov 5 08:28:49 2014 on firestorm ;;; $Id$ ;;; Code: @@ -608,7 +608,10 @@ (let* ((command (read-string-with-history "Preview command: " (YaTeX-replace-format - (or (YaTeX-get-builtin "PREVIEW") dvi2-command) + (or (YaTeX-get-builtin "PREVIEW") + (if (eq (get 'dvi2-command 'format) 'pdf) + tex-pdfview-command + dvi2-command)) "p" (format (cond (YaTeX-dos "-y:%s") (t "-paper %s")) @@ -859,6 +862,9 @@ (fname (if rin (substring latex-cmd (1+ rin)) "")) (r (YaTeX-assoc-regexp preview-command YaTeX-dvi2-command-ext-alist)) (ext (if r (cdr r) ""))) + (and (null r) + (eq (get 'dvi2-command 'format) 'pdf) + (setq ext "pdf")) (concat (if (string= fname "") (setq fname (substring (file-name-nondirectory @@ -997,7 +1003,7 @@ (let ((ff (function (lambda (f) (if setbuf (set-buffer (find-file-noselect f)) (find-file f))))) - b-in main-file YaTeX-create-file-prefix-g + b-in main-file mfa YaTeX-create-file-prefix-g (hilit-auto-highlight (not setbuf))) (if (setq b-in (YaTeX-get-builtin "!")) (setq main-file (YaTeX-guess-parent b-in))) @@ -1022,9 +1028,9 @@ ((and main-file (file-exists-p (setq main-file (concat "../" main-file))) (or b-in - (y-or-n-p (concat (expand-file-name main-file) + (y-or-n-p (concat (setq mfa (expand-file-name main-file)) " is main file?:")))) - (setq YaTeX-parent-file main-file) + (setq YaTeX-parent-file mfa) ;(YaTeX-switch-to-buffer main-file setbuf) (funcall ff main-file) )