yatex

diff yatexlib.el @ 187:2f91947a43a1

YaTeX-end-environment should not warn if opening structure is coming before closing one.
author yuuji@gentei.org
date Thu, 15 Dec 2011 13:39:36 +0900
parents 67b1e094e151
children cf7352dfa40c
line diff
     1.1 --- a/yatexlib.el	Thu Oct 13 09:50:45 2011 +0900
     1.2 +++ b/yatexlib.el	Thu Dec 15 13:39:36 2011 +0900
     1.3 @@ -2,7 +2,7 @@
     1.4  ;;; YaTeX and yahtml common libraries, general functions and definitions
     1.5  ;;; yatexlib.el
     1.6  ;;; (c)1994-2009 by HIROSE Yuuji.[yuuji@yatex.org]
     1.7 -;;; Last modified Thu Oct 13 09:36:20 2011 on firestorm
     1.8 +;;; Last modified Thu Dec 15 13:37:26 2011 on firestorm
     1.9  ;;; $Id$
    1.10  
    1.11  ;; General variables
    1.12 @@ -912,7 +912,7 @@
    1.13  		    (goto-char m0)
    1.14  		    (put 'YaTeX-inner-environment 'indent (current-column))
    1.15  		    (throw 'begin t)))))
    1.16 -	  (buffer-substring
    1.17 +	  (YaTeX-buffer-substring
    1.18  	   (progn (skip-chars-forward open) (1+ (point)))
    1.19  	   (progn (skip-chars-forward close) (point)))))))
    1.20  
    1.21 @@ -998,9 +998,16 @@
    1.22    (let ((env (YaTeX-inner-environment)))
    1.23      (if (not env) (error "No premature environment")
    1.24        (save-excursion
    1.25 -	(if (YaTeX-search-active-forward
    1.26 -	     (YaTeX-replace-format-args YaTeX-struct-end env "" "")
    1.27 -	     YaTeX-comment-prefix nil t)
    1.28 +	(if (and
    1.29 +	     (YaTeX-re-search-active-forward
    1.30 +	      (concat
    1.31 +	       "\\(" (YaTeX-replace-format-args
    1.32 +		      YaTeX-struct-end env "" "")
    1.33 +	       "\\)\\|\\(" (YaTeX-replace-format-args
    1.34 +		      YaTeX-struct-begin env "" "")
    1.35 +	       "\\)")
    1.36 +	      YaTeX-comment-prefix nil t)
    1.37 +	     (match-beginning 1))	;is closing struc.
    1.38  	    (if (y-or-n-p
    1.39  		 (concat "Environment `" env
    1.40  			 "' may be already closed. Force close?"))