yatex
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 diff
1.1 --- a/yatexadd.el Sat Jan 28 22:32:30 2012 +0900 1.2 +++ b/yatexadd.el Sun Jan 29 16:09:22 2012 +0900 1.3 @@ -2,7 +2,7 @@ 1.4 ;;; YaTeX add-in functions. 1.5 ;;; yatexadd.el rev.20 1.6 ;;; (c)1991-2012 by HIROSE Yuuji.[yuuji@yatex.org] 1.7 -;;; Last modified Sat Jan 28 11:03:05 2012 on firestorm 1.8 +;;; Last modified Sun Jan 29 15:56:28 2012 on firestorm 1.9 ;;; $Id$ 1.10 1.11 ;;; 1.12 @@ -111,13 +111,11 @@ 1.13 (tl (or type "Figure")) 1.14 (heremsg (format "%% %s here" tl)) 1.15 (pos (YaTeX:read-position "htbp"))) 1.16 - (setq label (or (YaTeX-skip-next-reader-p) 1.17 - (read-string (concat tl " Label: ")))) 1.18 + (setq label (YaTeX-read-string-or-skip (concat tl " Label: "))) 1.19 (if (string= "" label) 1.20 (setq YaTeX-section-name "label") 1.21 (setq opts (format "\n\\label{%s}" label))) 1.22 - (setq caption (or (YaTeX-skip-next-reader-p) 1.23 - (read-string (concat tl " Caption: ")))) 1.24 + (setq caption (YaTeX-read-string-or-skip (concat tl " Caption: "))) 1.25 (if (string= "" caption) 1.26 (setq YaTeX-section-name "caption") 1.27 (setq caption (format "\\caption{%s}" caption) 1.28 @@ -1890,11 +1888,11 @@ 1.29 (defun YaTeX:includegraphics () 1.30 "Add-in for \\includegraphics's option" 1.31 (let (width height (scale "") angle str) 1.32 - (setq width (read-string "Width: ") 1.33 - height (read-string "Height: ")) 1.34 + (setq width (YaTeX-read-string-or-skip "Width: ") 1.35 + height (YaTeX-read-string-or-skip "Height: ")) 1.36 (or (string< width "") (string< "" height) 1.37 - (setq scale (read-string "Scale: "))) 1.38 - (setq angle (read-string "Angle(0-359): ")) 1.39 + (setq scale (YaTeX-read-string-or-skip "Scale: "))) 1.40 + (setq angle (YaTeX-read-string-or-skip "Angle(0-359): ")) 1.41 (setq str 1.42 (mapconcat 1.43 'concat
2.1 --- a/yatexlib.el Sat Jan 28 22:32:30 2012 +0900 2.2 +++ b/yatexlib.el Sun Jan 29 16:09:22 2012 +0900 2.3 @@ -2,7 +2,7 @@ 2.4 ;;; YaTeX and yahtml common libraries, general functions and definitions 2.5 ;;; yatexlib.el 2.6 ;;; (c)1994-2012 by HIROSE Yuuji.[yuuji@yatex.org] 2.7 -;;; Last modified Sat Jan 28 11:02:48 2012 on firestorm 2.8 +;;; Last modified Sun Jan 29 13:17:21 2012 on firestorm 2.9 ;;; $Id$ 2.10 2.11 ;; General variables 2.12 @@ -753,10 +753,11 @@ 2.13 (t (read-string prompt init)))) 2.14 2.15 (defvar YaTeX-skip-next-reader-char ?\C-j) 2.16 -(defun YaTeX-skip-next-reader-p () 2.17 - "Check if the next string-reader should be skip." 2.18 +(defun YaTeX-read-string-or-skip (&rest args) 2.19 + "Read string, or skip if last input char is \C-j." 2.20 (if (equal last-input-char YaTeX-skip-next-reader-char) 2.21 - "" nil)) 2.22 + "" 2.23 + (apply 'read-string args))) 2.24 2.25 ;;;###autoload 2.26 (fset 'YaTeX-rassoc