yatex

diff yatexmth.el @ 51:b0371b6ed799

Created `ChangeLog'. Log hereafter will be written in `ChangeLog'.
author yuuji
date Tue, 20 Dec 1994 21:00:21 +0000
parents d7e7b4654058
children 5d94deabb9f9
line diff
     1.1 --- a/yatexmth.el	Mon Oct 24 17:26:47 1994 +0000
     1.2 +++ b/yatexmth.el	Tue Dec 20 21:00:21 1994 +0000
     1.3 @@ -2,7 +2,7 @@
     1.4  ;;; YaTeX math-mode-specific functions.
     1.5  ;;; yatexmth.el rev.2
     1.6  ;;; (c )1993-1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
     1.7 -;;; Last modified Tue Oct 11 22:57:43 1994 on figaro
     1.8 +;;; Last modified Fri Dec  2 17:03:30 1994 on VFR
     1.9  ;;; $Id$
    1.10  
    1.11  ;;; [Customization guide]
    1.12 @@ -42,7 +42,7 @@
    1.13  ;;;			("'" . Other-List-if-any)))
    1.14  ;;;
    1.15  ;;;	  Put these expressions into your ~/.emacs, and you can use this
    1.16 -;;;	completion in the YaTeX-math-mode.
    1.17 +;;;	completion in the math-mode.
    1.18  ;;;
    1.19  ;;;	  And you can add your favorite completion sequences to the
    1.20  ;;;	default completion list invoked with `;', by defining those lists
    1.21 @@ -81,8 +81,8 @@
    1.22  ;;;		      '(("," . YaTeX-math-funcs-list)
    1.23  ;;;			("'" . ほかに定義したいシリーズがあれば…)))
    1.24  ;;;
    1.25 -;;;	これらを ~/.emacs に書いておけば、野鳥の math-mode で自分専用の
    1.26 -;;;	イメージ補完が利用できます。
    1.27 +;;;	これらを ~/.emacs に書いておけば、math-mode で自分専用のイメージ
    1.28 +;;;	補完が利用できます。
    1.29  
    1.30  (defvar YaTeX-jisold
    1.31    (and (boundp 'dos-machine-type)
    1.32 @@ -378,6 +378,10 @@
    1.33    (list 'nth 1 list))
    1.34  
    1.35  (defvar YaTeX-math-cmd-regexp (concat (regexp-quote YaTeX-ec) "[A-z]"))
    1.36 +(defvar YaTeX-math-verbatim-environments
    1.37 +  '("alltt")
    1.38 +  "*List of environments in which LaTeX math mode is disabled.
    1.39 +This value is appended with YaTeX-verbatim-environments.")
    1.40  
    1.41  ;;;
    1.42  ;;YaTeX math-mode functions
    1.43 @@ -438,12 +442,14 @@
    1.44    "If current position is supposed to be in LaTeX-math-mode, return t."
    1.45    (or (YaTeX-quick-in-environment-p
    1.46         '("math" "eqnarray" "equation" "eqnarray*" "displaymath"))
    1.47 -      (let ((p (point)) (nest 0) me0
    1.48 +      (let*((p (point)) (nest 0) me0
    1.49 +	    (delim (concat YaTeX-sectioning-regexp
    1.50 +			   "\\|^%\\|^$\\|^\C-l"))
    1.51  	    (boundary
    1.52  	     (save-excursion
    1.53 -	       (if (looking-at YaTeX-paragraph-delimiter)
    1.54 +	       (if (looking-at delim)
    1.55  		   (goto-char (max (point-min) (1- (point)))))
    1.56 -	       (re-search-backward YaTeX-paragraph-delimiter nil 1)
    1.57 +	       (re-search-backward delim nil 1)
    1.58  	       (point))))
    1.59  	(save-excursion
    1.60  	  (cond
    1.61 @@ -455,7 +461,7 @@
    1.62  				     "\\([()]\\|[][]\\)") boundary t))
    1.63  		  (setq me0 (match-end 0))
    1.64  		  (if (or (YaTeX-on-comment-p)
    1.65 -			  (YaTeX-quick-in-environment-p "verbatim")) nil
    1.66 +			  (YaTeX-literal-p)) nil
    1.67  		    (if (or (= (char-after (1- me0)) ?\))
    1.68  			    (= (char-after (1- me0)) ?\]))
    1.69  			(setq nest (1+ nest))
    1.70 @@ -464,11 +470,18 @@
    1.71  		(if (< nest 0) (throw 'open t))))
    1.72  	    t)
    1.73  	   (t (catch 'dollar
    1.74 -		(while (search-backward "$" boundary t)
    1.75 +		(while ;(search-backward "$" boundary t);little bit fast.
    1.76 +		    (YaTeX-re-search-active-backward ;;;;;; Too slow???
    1.77 +		     "\\$" YaTeX-comment-prefix boundary t)
    1.78  		  (cond
    1.79  		   ((equal (char-after (1- (point))) ?$) ; $$ equation $$
    1.80  		    (backward-char 1)
    1.81  		    (setq nest (1+ nest)))
    1.82 +		   ((let ((YaTeX-verbatim-environments
    1.83 +			   (append YaTeX-math-verbatim-environments
    1.84 +				   YaTeX-verbatim-environments)))
    1.85 +		      (YaTeX-literal-p))
    1.86 +		    nil)
    1.87  		   ((and (equal (char-after (1- (point))) ?\\ )
    1.88  			 (not (equal (char-after (- (point) 3)) ?\\ )))
    1.89  		    nil)		;\$
    1.90 @@ -583,8 +596,9 @@
    1.91      (setq result
    1.92  	  (catch 'complete
    1.93  	    (if (and (not force)
    1.94 -		     (or (and (not YaTeX-auto-math-mode) (not YaTeX-math-mode))
    1.95 -			 (not (YaTeX-in-math-mode-p))))
    1.96 +		     (if YaTeX-auto-math-mode
    1.97 +			 (not (YaTeX-in-math-mode-p))
    1.98 +		       (not YaTeX-math-mode)))
    1.99  		(throw 'complete 'escape));this tag should be exit, but...
   1.100  	    (while t
   1.101  	      (message "Sequence(TAB for menu): %s" key)