diff --git a/yatexadd.el b/yatexadd.el index 2f0ac91..e895092 100644 --- a/yatexadd.el +++ b/yatexadd.el @@ -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 diff --git a/yatexlib.el b/yatexlib.el index 4696b94..74f3646 100644 --- a/yatexlib.el +++ b/yatexlib.el @@ -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