# HG changeset patch # User yuuji@gentei.org # Date 1323923976 -32400 # Node ID 2f91947a43a186e20194803c1d7f37246f3d30aa # Parent 61996cd558165f8c074505edf51f2febf19cf4b7 YaTeX-end-environment should not warn if opening structure is coming before closing one. diff -r 61996cd55816 -r 2f91947a43a1 yatex.el --- a/yatex.el Thu Dec 01 23:02:36 2011 +0900 +++ b/yatex.el Thu Dec 15 13:39:36 2011 +0900 @@ -1,15 +1,15 @@ ;;; -*- Emacs-Lisp -*- ;;; Yet Another tex-mode for emacs - //–ì’¹// -;;; yatex.el rev. 1.74.5 +;;; yatex.el rev. 1.74.6 ;;; (c)1991-2011 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Dec 1 23:00:13 2011 on firestorm +;;; Last modified Thu Dec 15 13:37:47 2011 on firestorm ;;; $Id$ ;;; The latest version of this software is always available at; ;;; http://www.yatex.org/ (require 'comment) (require 'yatexlib) -(defconst YaTeX-revision-number "1.74.5" +(defconst YaTeX-revision-number "1.74.6" "Revision number of running yatex.el") ;---------- Local variables ---------- diff -r 61996cd55816 -r 2f91947a43a1 yatexlib.el --- a/yatexlib.el Thu Dec 01 23:02:36 2011 +0900 +++ b/yatexlib.el Thu Dec 15 13:39:36 2011 +0900 @@ -2,7 +2,7 @@ ;;; YaTeX and yahtml common libraries, general functions and definitions ;;; yatexlib.el ;;; (c)1994-2009 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Oct 13 09:36:20 2011 on firestorm +;;; Last modified Thu Dec 15 13:37:26 2011 on firestorm ;;; $Id$ ;; General variables @@ -912,7 +912,7 @@ (goto-char m0) (put 'YaTeX-inner-environment 'indent (current-column)) (throw 'begin t))))) - (buffer-substring + (YaTeX-buffer-substring (progn (skip-chars-forward open) (1+ (point))) (progn (skip-chars-forward close) (point))))))) @@ -998,9 +998,16 @@ (let ((env (YaTeX-inner-environment))) (if (not env) (error "No premature environment") (save-excursion - (if (YaTeX-search-active-forward - (YaTeX-replace-format-args YaTeX-struct-end env "" "") - YaTeX-comment-prefix nil t) + (if (and + (YaTeX-re-search-active-forward + (concat + "\\(" (YaTeX-replace-format-args + YaTeX-struct-end env "" "") + "\\)\\|\\(" (YaTeX-replace-format-args + YaTeX-struct-begin env "" "") + "\\)") + YaTeX-comment-prefix nil t) + (match-beginning 1)) ;is closing struc. (if (y-or-n-p (concat "Environment `" env "' may be already closed. Force close?"))