changeset 237:af1e6c48eac0 dev

YaTeX-skip-next-reader-p turns to YaTeX-read-string-or-skip.
author yuuji@gentei.org
date Sun, 29 Jan 2012 16:09:22 +0900
parents 328a212a2160
children 5260b7ee9fdf
files yatexadd.el yatexlib.el
diffstat 2 files changed, 12 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/yatexadd.el	Sat Jan 28 22:32:30 2012 +0900
+++ b/yatexadd.el	Sun Jan 29 16:09:22 2012 +0900
@@ -2,7 +2,7 @@
 ;;; YaTeX add-in functions.
 ;;; yatexadd.el rev.20
 ;;; (c)1991-2012 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Sat Jan 28 11:03:05 2012 on firestorm
+;;; Last modified Sun Jan 29 15:56:28 2012 on firestorm
 ;;; $Id$
 
 ;;;
@@ -111,13 +111,11 @@
 	(tl (or type "Figure"))
 	(heremsg (format "%% %s here" tl))
 	(pos (YaTeX:read-position "htbp")))
-    (setq label (or (YaTeX-skip-next-reader-p)
-		    (read-string (concat tl " Label: "))))
+    (setq label (YaTeX-read-string-or-skip (concat tl " Label: ")))
     (if (string= "" label)
 	(setq YaTeX-section-name "label")
       (setq opts (format "\n\\label{%s}" label)))
-    (setq caption (or (YaTeX-skip-next-reader-p)
-		      (read-string (concat tl " Caption: "))))
+    (setq caption (YaTeX-read-string-or-skip (concat tl " Caption: ")))
     (if (string= "" caption)
 	(setq YaTeX-section-name "caption")
       (setq caption (format "\\caption{%s}" caption)
@@ -1890,11 +1888,11 @@
 (defun YaTeX:includegraphics ()
   "Add-in for \\includegraphics's option"
   (let (width height (scale "") angle str)
-    (setq width (read-string "Width: ")
-	  height (read-string "Height: "))
+    (setq width (YaTeX-read-string-or-skip "Width: ")
+	  height (YaTeX-read-string-or-skip "Height: "))
     (or (string< width "") (string< "" height)
-	(setq scale (read-string "Scale: ")))
-    (setq angle (read-string "Angle(0-359): "))
+	(setq scale (YaTeX-read-string-or-skip "Scale: ")))
+    (setq angle (YaTeX-read-string-or-skip "Angle(0-359): "))
     (setq str
 	  (mapconcat
 	   'concat
--- a/yatexlib.el	Sat Jan 28 22:32:30 2012 +0900
+++ b/yatexlib.el	Sun Jan 29 16:09:22 2012 +0900
@@ -2,7 +2,7 @@
 ;;; YaTeX and yahtml common libraries, general functions and definitions
 ;;; yatexlib.el
 ;;; (c)1994-2012 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Sat Jan 28 11:02:48 2012 on firestorm
+;;; Last modified Sun Jan 29 13:17:21 2012 on firestorm
 ;;; $Id$
 
 ;; General variables
@@ -753,10 +753,11 @@
    (t (read-string prompt init))))
 
 (defvar YaTeX-skip-next-reader-char ?\C-j)
-(defun YaTeX-skip-next-reader-p ()
-  "Check if the next string-reader should be skip."
+(defun YaTeX-read-string-or-skip (&rest args)
+  "Read string, or skip if last input char is \C-j."
   (if (equal last-input-char YaTeX-skip-next-reader-char)
-      "" nil))
+      ""
+    (apply 'read-string args)))
 
 ;;;###autoload
 (fset 'YaTeX-rassoc

yatex.org