yatex

changeset 187:2f91947a43a1 dev

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 61996cd55816
children af2098da767b
files yatex.el yatexlib.el
diffstat 2 files changed, 15 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/yatex.el	Thu Dec 01 23:02:36 2011 +0900
     1.2 +++ b/yatex.el	Thu Dec 15 13:39:36 2011 +0900
     1.3 @@ -1,15 +1,15 @@
     1.4  ;;; -*- Emacs-Lisp -*-
     1.5  ;;; Yet Another tex-mode for emacs - //–ì’¹//
     1.6 -;;; yatex.el rev. 1.74.5
     1.7 +;;; yatex.el rev. 1.74.6
     1.8  ;;; (c)1991-2011 by HIROSE Yuuji.[yuuji@yatex.org]
     1.9 -;;; Last modified Thu Dec  1 23:00:13 2011 on firestorm
    1.10 +;;; Last modified Thu Dec 15 13:37:47 2011 on firestorm
    1.11  ;;; $Id$
    1.12  ;;; The latest version of this software is always available at;
    1.13  ;;; http://www.yatex.org/
    1.14  
    1.15  (require 'comment)
    1.16  (require 'yatexlib)
    1.17 -(defconst YaTeX-revision-number "1.74.5"
    1.18 +(defconst YaTeX-revision-number "1.74.6"
    1.19    "Revision number of running yatex.el")
    1.20  
    1.21  ;---------- Local variables ----------
     2.1 --- a/yatexlib.el	Thu Dec 01 23:02:36 2011 +0900
     2.2 +++ b/yatexlib.el	Thu Dec 15 13:39:36 2011 +0900
     2.3 @@ -2,7 +2,7 @@
     2.4  ;;; YaTeX and yahtml common libraries, general functions and definitions
     2.5  ;;; yatexlib.el
     2.6  ;;; (c)1994-2009 by HIROSE Yuuji.[yuuji@yatex.org]
     2.7 -;;; Last modified Thu Oct 13 09:36:20 2011 on firestorm
     2.8 +;;; Last modified Thu Dec 15 13:37:26 2011 on firestorm
     2.9  ;;; $Id$
    2.10  
    2.11  ;; General variables
    2.12 @@ -912,7 +912,7 @@
    2.13  		    (goto-char m0)
    2.14  		    (put 'YaTeX-inner-environment 'indent (current-column))
    2.15  		    (throw 'begin t)))))
    2.16 -	  (buffer-substring
    2.17 +	  (YaTeX-buffer-substring
    2.18  	   (progn (skip-chars-forward open) (1+ (point)))
    2.19  	   (progn (skip-chars-forward close) (point)))))))
    2.20  
    2.21 @@ -998,9 +998,16 @@
    2.22    (let ((env (YaTeX-inner-environment)))
    2.23      (if (not env) (error "No premature environment")
    2.24        (save-excursion
    2.25 -	(if (YaTeX-search-active-forward
    2.26 -	     (YaTeX-replace-format-args YaTeX-struct-end env "" "")
    2.27 -	     YaTeX-comment-prefix nil t)
    2.28 +	(if (and
    2.29 +	     (YaTeX-re-search-active-forward
    2.30 +	      (concat
    2.31 +	       "\\(" (YaTeX-replace-format-args
    2.32 +		      YaTeX-struct-end env "" "")
    2.33 +	       "\\)\\|\\(" (YaTeX-replace-format-args
    2.34 +		      YaTeX-struct-begin env "" "")
    2.35 +	       "\\)")
    2.36 +	      YaTeX-comment-prefix nil t)
    2.37 +	     (match-beginning 1))	;is closing struc.
    2.38  	    (if (y-or-n-p
    2.39  		 (concat "Environment `" env
    2.40  			 "' may be already closed. Force close?"))