yatex

diff yatexprc.el @ 70:44e3a5e1e883

Fix makefile for Windows Brush up label completion \cite completion Support much more about LaTeX2e --- [yahtml] English Info (By Jun Ohya) Automatic pixel size detection for <img src="..."> Aware global-class of css definition & for char-entity reference
author yuuji
date Sun, 09 Apr 2000 03:37:47 +0000
parents 807c1e7e68b7
children 0aaebd07dad0
line diff
     1.1 --- a/yatexprc.el	Thu Jul 15 04:58:26 1999 +0000
     1.2 +++ b/yatexprc.el	Sun Apr 09 03:37:47 2000 +0000
     1.3 @@ -1,8 +1,8 @@
     1.4  ;;; -*- Emacs-Lisp -*-
     1.5  ;;; YaTeX process handler.
     1.6  ;;; yatexprc.el
     1.7 -;;; (c )1993-1999 by HIROSE Yuuji.[yuuji@gentei.org]
     1.8 -;;; Last modified Tue Jul 13 13:47:46 1999 on firestorm
     1.9 +;;; (c )1993-1999 by HIROSE Yuuji.[yuuji@yatex.org]
    1.10 +;;; Last modified Sat Dec 18 22:16:11 1999 on firestorm
    1.11  ;;; $Id$
    1.12  
    1.13  ;(require 'yatex)
    1.14 @@ -479,7 +479,7 @@
    1.15  	   (buffer-substring
    1.16  	    (point)
    1.17  	    (progn (skip-chars-forward "0-9" (match-end 0)) (point))))
    1.18 -	  error-buffer (YaTeX-get-error-file cur-buf))
    1.19 +	  error-buffer (expand-file-name (YaTeX-get-error-file cur-buf)))
    1.20      (if (or (null error-line) (equal 0 error-line))
    1.21  	(error "Can't detect error position."))
    1.22      (YaTeX-set-virtual-error-position 'error-buffer 'error-line)
    1.23 @@ -517,7 +517,8 @@
    1.24        (goto-char (match-beginning 0))
    1.25        (setq error-line (string-to-int
    1.26  			(buffer-substring (match-beginning 1) (match-end 1)))
    1.27 -	    error-file (YaTeX-get-error-file YaTeX-current-TeX-buffer))
    1.28 +	    error-file (expand-file-name
    1.29 +			(YaTeX-get-error-file YaTeX-current-TeX-buffer)))
    1.30        (YaTeX-set-virtual-error-position 'error-file 'error-line)
    1.31        (setq error-buf (YaTeX-switch-to-buffer error-file t)))
    1.32        (if (null error-buf)
    1.33 @@ -710,7 +711,9 @@
    1.34     (YaTeX-parent-file
    1.35      (eq (get-file-buffer YaTeX-parent-file) (current-buffer)))
    1.36     ((YaTeX-get-builtin "!")
    1.37 -    (string-match (YaTeX-guess-parent (YaTeX-get-builtin "!")) (buffer-name)))
    1.38 +    (string-match
    1.39 +     (concat "^" (YaTeX-guess-parent (YaTeX-get-builtin "!")))
    1.40 +     (buffer-name)))
    1.41     (t
    1.42      (save-excursion
    1.43        (let ((latex-main-id
    1.44 @@ -724,7 +727,11 @@
    1.45  SETBUF is t(Use it only from Emacs-Lisp program)."
    1.46    (interactive "P")
    1.47    (if (and (interactive-p) setbuf) (setq YaTeX-parent-file nil))
    1.48 -  (let (b-in main-file)
    1.49 +  (let ((ff (function (lambda (f)
    1.50 +			(if setbuf (set-buffer (find-file-noselect f))
    1.51 +			  (find-file f)))))
    1.52 +	b-in main-file YaTeX-create-file-prefix-g
    1.53 +	(hilit-auto-highlight (not setbuf)))
    1.54      (if (setq b-in (YaTeX-get-builtin "!"))
    1.55  	(setq main-file (YaTeX-guess-parent b-in)))
    1.56      (if YaTeX-parent-file
    1.57 @@ -733,18 +740,30 @@
    1.58      (if (YaTeX-main-file-p)
    1.59  	(if (interactive-p) (message "I think this is main LaTeX source.") nil)
    1.60        (cond
    1.61 -       ((and (interactive-p) main-file (get-file-buffer main-file))
    1.62 -	(goto-buffer-window main-file))
    1.63 -       ((and main-file (YaTeX-switch-to-buffer main-file setbuf)))
    1.64 +       ((and ;;(interactive-p) 
    1.65 +	     main-file
    1.66 +	     (cond ((get-file-buffer main-file)
    1.67 +		    (cond
    1.68 +		     (setbuf (set-buffer (get-file-buffer main-file)))
    1.69 +		     ((get-buffer-window (get-file-buffer main-file))
    1.70 +		      (select-window
    1.71 +		       (get-buffer-window (get-file-buffer main-file))))
    1.72 +		     (t (switch-to-buffer (get-file-buffer main-file)))))
    1.73 +		   ((file-exists-p main-file)
    1.74 +		    (funcall ff main-file)))))
    1.75 +       ;;((and main-file (YaTeX-switch-to-buffer main-file setbuf)))
    1.76         ((and main-file
    1.77  	     (file-exists-p (setq main-file (concat "../" main-file)))
    1.78  	     (y-or-n-p (concat (expand-file-name main-file)
    1.79  			       " is main file?:")))
    1.80  	(setq YaTeX-parent-file main-file)
    1.81 -	(YaTeX-switch-to-buffer main-file setbuf))
    1.82 +	;(YaTeX-switch-to-buffer main-file setbuf)
    1.83 +	(funcall ff main-file)
    1.84 +	)
    1.85         (t (setq main-file (read-file-name "Enter your main text: " nil nil 1))
    1.86  	  (setq YaTeX-parent-file main-file)
    1.87 -	  (YaTeX-switch-to-buffer main-file setbuf))
    1.88 +	 ; (YaTeX-switch-to-buffer main-file setbuf))
    1.89 +	  (funcall ff main-file))
    1.90         )))
    1.91    nil)
    1.92