changeset 192:7cf62e088eb5 dev

Refine guidance after manual input of \end{}.
author yuuji@gentei.org
date Mon, 09 Jan 2012 14:02:38 +0900
parents af2098da767b
children e216f9f347fa
files yatex.el
diffstat 1 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/yatex.el	Sat Dec 17 13:07:38 2011 +0900
+++ b/yatex.el	Mon Jan 09 14:02:38 2012 +0900
@@ -2,7 +2,7 @@
 ;;; Yet Another tex-mode for emacs - //野鳥//
 ;;; yatex.el rev. 1.74.6
 ;;; (c)1991-2011 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Thu Dec 15 13:37:47 2011 on firestorm
+;;; Last modified Mon Jan  9 11:29:44 2012 on firestorm
 ;;; $Id$
 ;;; The latest version of this software is always available at;
 ;;; http://www.yatex.org/
@@ -1236,15 +1236,19 @@
 	   (save-excursion (backward-char 4) (looking-at "\\\\end"))
 	   (not (YaTeX-literal-p))
 	   (setq env (YaTeX-inner-environment)))
-      (momentary-string-display
-       (concat
-	"{"
-	(cond
-	 (YaTeX-japan
-	  (format "今度からはちゃんと %s b を使いましょう" YaTeX-prefix))
-	 (t (format "You don't understand Zen of `%s b':p" YaTeX-prefix)))
-	"}")
-       (point))
+      (if (equal (get 'YaTeX-insert-braces 'begend-guide) 2)
+	  nil				;if triggered thrice, do nothing
+	(momentary-string-display
+	 (format
+	  (cond
+	   (YaTeX-japan "{begin/end入力には %s を使いましょう}")
+	   (t "{You don't understand Zen of `%s'!}"))
+	  (key-description (car (where-is-internal 'YaTeX-make-begin-end))))
+	 (point))
+	(put 'YaTeX-insert-braces 'begend-guide
+	     (+ 1 (string-to-int	;increment counter of beg-end guidance
+		   (prin1-to-string
+		    (get 'YaTeX-insert-braces 'begend-guide))))))
       (insert (or open "{") env (or close "}")))
      (t
       (insert (or open "{") (or close "}"))

yatex.org