yatex
diff yatexprc.el @ 64:36a48185b95a
Changes are listed in yatex.new.
Major one is supporing GNU Emacs20 and XEmacs.
author | yuuji |
---|---|
date | Tue, 16 Dec 1997 13:28:38 +0000 |
parents | b9f753846b6b |
children | 0eb6997bee16 |
line diff
1.1 --- a/yatexprc.el Mon Apr 07 20:07:48 1997 +0000 1.2 +++ b/yatexprc.el Tue Dec 16 13:28:38 1997 +0000 1.3 @@ -2,10 +2,11 @@ 1.4 ;;; YaTeX process handler. 1.5 ;;; yatexprc.el 1.6 ;;; (c )1993-1997 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 1.7 -;;; Last modified Mon Jan 27 10:22:06 1997 on crx 1.8 +;;; Last modified Thu Dec 11 16:16:21 1997 on crx 1.9 ;;; $Id$ 1.10 1.11 -(require 'yatex) 1.12 +;(require 'yatex) 1.13 +(require 'yatexlib) 1.14 1.15 (defvar YaTeX-typeset-process nil 1.16 "Process identifier for jlatex" 1.17 @@ -24,6 +25,18 @@ 1.18 (if YaTeX-dos "/c" "-c")) 1.19 "Shell option for command execution.") 1.20 1.21 +(defvar YaTeX-latex-message-code 1.22 + (cond 1.23 + (YaTeX-dos (cdr (assq 1 YaTeX-kanji-code-alist))) 1.24 + ((and YaTeX-emacs-20 (member 'undecided (coding-system-list)) 1.25 + 'undecided)) 1.26 + ((featurep 'mule) 1.27 + (or (and (boundp '*autoconv*) *autoconv*) 1.28 + (and (fboundp 'coding-system-list) 'automatic-conversion))) 1.29 + ((boundp 'NEMACS) 1.30 + (cdr (assq (if YaTeX-dos 1 2) YaTeX-kanji-code-alist)))) 1.31 + "Process coding system for LaTeX.") 1.32 + 1.33 (if YaTeX-typeset-buffer-syntax nil 1.34 (setq YaTeX-typeset-buffer-syntax 1.35 (make-syntax-table (standard-syntax-table))) 1.36 @@ -38,7 +51,10 @@ 1.37 (interactive) 1.38 (save-excursion 1.39 (let ((p (point)) (window (selected-window)) execdir (cb (current-buffer)) 1.40 - (map YaTeX-typesetting-mode-map)) 1.41 + (map YaTeX-typesetting-mode-map) 1.42 + (outcode 1.43 + (cond ((eq major-mode 'yatex-mode) YaTeX-coding-system) 1.44 + ((eq major-mode 'yahtml-mode) yahtml-coding-system)))) 1.45 (if (and YaTeX-typeset-process 1.46 (eq (process-status YaTeX-typeset-process) 'run)) 1.47 ;; if tex command is halting. 1.48 @@ -57,12 +73,9 @@ 1.49 (cd execdir) 1.50 (erase-buffer) 1.51 (cond 1.52 - (YaTeX-dos ;if MS-DOS 1.53 - ;(YaTeX-put-nonstopmode) 1.54 + ((not (fboundp 'start-process)) ;YaTeX-dos;if MS-DOS 1.55 (call-process 1.56 - shell-file-name nil buffer nil YaTeX-shell-command-option command) 1.57 - ;(YaTeX-remove-nonstopmode) 1.58 - ) 1.59 + shell-file-name nil buffer nil YaTeX-shell-command-option command)) 1.60 (t ;if UNIX 1.61 (set-process-buffer 1.62 (setq YaTeX-typeset-process 1.63 @@ -76,9 +89,15 @@ 1.64 (set-syntax-table YaTeX-typeset-buffer-syntax) 1.65 (setq mode-name modename) 1.66 (if YaTeX-typeset-process ;if process is running (maybe on UNIX) 1.67 - (cond ((boundp 'MULE) 1.68 + (cond ((fboundp 'set-current-process-coding-system) 1.69 (set-current-process-coding-system 1.70 - YaTeX-latex-message-code YaTeX-coding-system)) 1.71 + YaTeX-latex-message-code outcode)) 1.72 + ((fboundp 'set-process-coding-system) 1.73 + (set-process-coding-system 1.74 + YaTeX-typeset-process YaTeX-latex-message-code outcode)) 1.75 + (YaTeX-emacs-20 1.76 + (set-buffer-process-coding-system 1.77 + YaTeX-latex-message-code outcode)) 1.78 ((boundp 'NEMACS) 1.79 (set-kanji-process-code YaTeX-latex-message-code)))) 1.80 (if YaTeX-dos (message "Done.") 1.81 @@ -213,7 +232,7 @@ 1.82 (set-buffer (find-file-noselect texput))) 1.83 ;;(find-file YaTeX-texput-file) 1.84 (erase-buffer) 1.85 - (if YaTeX-need-nonstop 1.86 + (if (and (eq major-mode 'yatex-mode) YaTeX-need-nonstop) 1.87 (insert "\\nonstopmode{}\n")) 1.88 (insert preamble "\n" subpreamble "\n") 1.89 (setq lineinfo (list (count-lines 1 (point-end-of-line)) lineinfo)) 1.90 @@ -340,7 +359,7 @@ 1.91 (setq default-directory df) 1.92 (cd df)) 1.93 (erase-buffer) 1.94 - (if YaTeX-dos 1.95 + (if (not (fboundp 'start-process)) 1.96 (call-process 1.97 shell-file-name nil buffer nil YaTeX-shell-command-option command) 1.98 (if (and (get-buffer-process buffer) 1.99 @@ -386,7 +405,7 @@ 1.100 (setq default-directory dir) ;for 18 1.101 (cd dir) ;for 19 1.102 (cond 1.103 - (YaTeX-dos ;if MS-DOS 1.104 + ((not (fboundp 'start-process)) ;if MS-DOS 1.105 (send-string-to-terminal "\e[2J\e[>5h") ;CLS & hide cursor 1.106 (call-process shell-file-name "con" "*dvi-preview*" nil 1.107 YaTeX-shell-command-option 1.108 @@ -573,7 +592,7 @@ 1.109 ) 1.110 1.111 (defun YaTeX-put-nonstopmode () 1.112 - (if (and YaTeX-need-nonstop (eq major-mode 'yatex-mode)) 1.113 + (if (and (eq major-mode 'yatex-mode) YaTeX-need-nonstop) 1.114 (if (re-search-backward "\\\\nonstopmode{}" (point-min) t) 1.115 nil ;if already written in text then do nothing 1.116 (save-excursion 1.117 @@ -585,7 +604,7 @@ 1.118 ) 1.119 1.120 (defun YaTeX-remove-nonstopmode () 1.121 - (if (and YaTeX-need-nonstop (eq major-mode 'yatex-mode)) ;for speed 1.122 + (if (and (eq major-mode 'yatex-mode) YaTeX-need-nonstop) ;for speed 1.123 (save-excursion 1.124 (YaTeX-visit-main t) 1.125 (goto-char (point-min)) 1.126 @@ -692,7 +711,7 @@ 1.127 (erase-buffer) 1.128 (cd dir) ;for 19 1.129 (cond 1.130 - (YaTeX-dos 1.131 + ((not (fboundp 'start-process)) 1.132 (call-process shell-file-name "con" "*dvi-printing*" nil 1.133 YaTeX-shell-command-option cmd)) 1.134 (t