changeset 216:c1edf0fbab32 dev

Leave `{}' after C-g at section-type completion.
author yuuji@gentei.org
date Fri, 13 Jan 2012 16:17:49 +0900
parents a67236df3199
children e59126447ee7
files yatex.el
diffstat 1 files changed, 18 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/yatex.el	Fri Jan 13 09:44:48 2012 +0900
+++ b/yatex.el	Fri Jan 13 16:17:49 2012 +0900
@@ -2,7 +2,7 @@
 ;;; Yet Another tex-mode for emacs - //–ì’¹//
 ;;; yatex.el rev. 1.75.1
 ;;; (c)1991-2012 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Fri Jan 13 08:22:46 2012 on firestorm
+;;; Last modified Fri Jan 13 16:16:58 2012 on firestorm
 ;;; $Id$
 ;;; The latest version of this software is always available at;
 ;;; http://www.yatex.org/
@@ -950,17 +950,17 @@
 	    (function
 	     (lambda (n)
 	       (while (<= j n)
-		 (insert
-		  (concat		;to allow nil return value
-		   "{"
-		   (setq title
-			 (cond
-			  (addin-args (funcall arg-reader j))
-			  (YaTeX-skip-default-reader "")
-			  (t
-			   (read-string
-			    (format "Argument %d of %s: " j section)))))
-		   "}"))
+		 (unwind-protect
+		     (setq title
+			   (cond
+			    (addin-args (funcall arg-reader j))
+			    (YaTeX-skip-default-reader "")
+			    (t
+			     (read-string
+			      (format "Argument %d of %s: " j section)))))
+		   (insert
+		    (concat		;to allow nil return value
+		     "{" title "}")))
 		 (setq j (1+ j))))))
 	   );;let
 	(setq YaTeX-section-name section)
@@ -972,10 +972,12 @@
 	      (insert "}")
 	      (set-marker e (point))
 	      (goto-char beg)
-	      (insert YaTeX-ec YaTeX-section-name
-		      (YaTeX-addin YaTeX-section-name))
-	      (if (> numarg 1) (funcall mkarg-func (1- numarg)))
-	      (insert "{")
+	      (unwind-protect
+		  (progn
+		    (insert YaTeX-ec YaTeX-section-name
+			    (YaTeX-addin YaTeX-section-name))
+		    (if (> numarg 1) (funcall mkarg-func (1- numarg))))
+		(insert "{"))
 	      (if arp (funcall ar2 (point) e))
 	      (goto-char e)
 	      (set-marker e nil))

yatex.org