yatex
changeset 261:8c555014f933 dev
Auto-rerun supports natbib.
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Mon, 13 Feb 2012 21:59:32 +0900 |
parents | e2899f13e8a4 |
children | 15ec86ff549c |
files | yatexprc.el |
diffstat | 1 files changed, 19 insertions(+), 11 deletions(-) [+] |
line diff
1.1 --- a/yatexprc.el Mon Feb 13 17:06:47 2012 +0900 1.2 +++ b/yatexprc.el Mon Feb 13 21:59:32 2012 +0900 1.3 @@ -2,7 +2,7 @@ 1.4 ;;; YaTeX process handler. 1.5 ;;; yatexprc.el 1.6 ;;; (c)1993-2012 by HIROSE Yuuji.[yuuji@yatex.org] 1.7 -;;; Last modified Mon Feb 13 15:28:22 2012 on firestorm 1.8 +;;; Last modified Mon Feb 13 21:58:24 2012 on firestorm 1.9 ;;; $Id$ 1.10 1.11 ;(require 'yatex) 1.12 @@ -148,7 +148,7 @@ 1.13 1.14 (defvar YaTeX-typeset-rerun-msg "Rerun to get cross-references right.") 1.15 (defvar YaTeX-typeset-citation-msg 1.16 - "Warning: Citation .* on page [0-9]+ undefined on input line") 1.17 + "Warning: Citation \`") 1.18 (defvar YaTeX-typeset-auto-rerun t 1.19 "*Non-nil automatically reruns typesetter when cross-refs update found. 1.20 This is mechanism is ") 1.21 @@ -160,7 +160,7 @@ 1.22 (let* ((obuf (current-buffer)) (pbuf (process-buffer proc)) 1.23 (pwin (get-buffer-window pbuf)) 1.24 (owin (selected-window)) win 1.25 - tobecalled 1.26 + tobecalled shortname 1.27 (thiscmd (get 'YaTeX-typeset-process 'thiscmd)) 1.28 (ppprop (get 'YaTeX-typeset-process 'ppcmd)) 1.29 (ppcmd (cdr (assq proc ppprop))) 1.30 @@ -205,16 +205,22 @@ 1.31 (search-backward 1.32 ".bbl" YaTeX-typeset-marker t))) 1.33 (insert "\n" YaTeX-typeset-rerun-msg "\n") 1.34 - (setq tobecalled bibcmd)) 1.35 - ((save-excursion 1.36 - (search-backward 1.37 - YaTeX-typeset-rerun-msg YaTeX-typeset-marker t)) 1.38 + (setq tobecalled bibcmd shortname "+bibtex")) 1.39 + ((or 1.40 + (save-excursion 1.41 + (search-backward 1.42 + YaTeX-typeset-rerun-msg YaTeX-typeset-marker t)) 1.43 + (save-excursion 1.44 + (re-search-backward 1.45 + "natbib.*Rerun to get citations correct" 1.46 + YaTeX-typeset-marker t))) 1.47 (if bibcmd 1.48 (put 'YaTeX-typeset-process 'bibcmd 1.49 (cons (cons (get-buffer-process pbuf) bibcmd) 1.50 bcprop))) 1.51 - (setq tobecalled thiscmd)) 1.52 - (t nil)) 1.53 + (setq tobecalled thiscmd shortname "+typeset")) 1.54 + (t 1.55 + nil)) ;no need to call any process 1.56 (progn 1.57 (insert 1.58 (format 1.59 @@ -225,7 +231,7 @@ 1.60 (set-marker YaTeX-typeset-marker (point))) 1.61 (set-process-sentinel 1.62 (start-process 1.63 - (setq mode-name (concat mode-name "*2")) 1.64 + (setq mode-name (concat mode-name shortname)) 1.65 pbuf 1.66 shell-file-name YaTeX-shell-command-option tobecalled) 1.67 'YaTeX-typeset-sentinel) 1.68 @@ -250,7 +256,9 @@ 1.69 pbuf ; Use this buffer twice. 1.70 shell-file-name YaTeX-shell-command-option 1.71 ppcmd) 1.72 - 'YaTeX-typeset-sentinel)))) 1.73 + 'YaTeX-typeset-sentinel)) 1.74 + (t ;pull back original name 1.75 + (setq mode-name "typeset")))) 1.76 (forward-char 1)) 1.77 (setq YaTeX-typeset-process nil) 1.78 ;; Force mode line redisplay soon