yatex
changeset 394:67fa6d791bc9 dev
Workaround for `Same buffer in multiple frames' applied to yahtml
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Fri, 16 Jan 2015 10:13:08 +0900 |
parents | 318841b09570 |
children | 5aa8208fbef0 |
files | yahtml.el yatex.el yatexadd.el |
diffstat | 3 files changed, 102 insertions(+), 88 deletions(-) [+] |
line diff
1.1 --- a/yahtml.el Fri Jan 16 08:58:20 2015 +0900 1.2 +++ b/yahtml.el Fri Jan 16 10:13:08 2015 +0900 1.3 @@ -1,6 +1,6 @@ 1.4 ;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*- 1.5 ;;; (c) 1994-2013 by HIROSE Yuuji [yuuji(@)yatex.org] 1.6 -;;; Last modified Thu Jan 15 11:34:59 2015 on firestorm 1.7 +;;; Last modified Fri Jan 16 10:00:10 2015 on firestorm 1.8 ;;; $Id$ 1.9 1.10 (defconst yahtml-revision-number "1.77" 1.11 @@ -898,7 +898,7 @@ 1.12 (defun yahtml-read-css (alist) 1.13 (let ((completion-ignore-case t) (delim " ") 1.14 (minibuffer-completion-table alist)) 1.15 - (read-from-minibuffer 1.16 + (read-from-minibuffer-with-history 1.17 (substitute-command-keys 1.18 (if YaTeX-japan 1.19 "クラス(複数指定は\\[quoted-insert] SPCで区切る): " 1.20 @@ -1125,12 +1125,13 @@ 1.21 (setq yahtml-completing-buffer (current-buffer) 1.22 yahtml-urls (append yahtml-urls-private yahtml-urls-local) 1.23 href (yahtml-escape-chars-string 1.24 - (read-from-minibuffer "href: " "" yahtml-url-completion-map))) 1.25 + (read-from-minibuffer-with-history 1.26 + "href: " "" yahtml-url-completion-map))) 1.27 (prog1 1.28 (concat (yahtml-make-optional-argument 1.29 "href" href) 1.30 (yahtml-make-optional-argument 1.31 - "name" (read-string "name: "))) 1.32 + "name" (read-string-with-history "name: "))) 1.33 (if (and (string-match "^http://" href) 1.34 (null (assoc href yahtml-urls-private)) 1.35 (null (assoc href yahtml-urls-local))) 1.36 @@ -1179,13 +1180,14 @@ 1.37 ((eq alist 'command) 1.38 (if (fboundp 'read-shell-command) 1.39 (read-shell-command prompt) 1.40 - (read-string prompt))) 1.41 + (read-string-with-history prompt))) 1.42 ((and alist (symbolp alist)) 1.43 - (completing-read prompt (symbol-value alist) nil nil default)) 1.44 + (completing-read-with-history 1.45 + prompt (symbol-value alist) nil nil default)) 1.46 (alist 1.47 - (completing-read prompt alist nil nil default)) 1.48 + (completing-read-with-history prompt alist nil nil default)) 1.49 (t 1.50 - (read-string prompt default))))) 1.51 + (read-string-with-history prompt default))))) 1.52 1.53 (defun yahtml-make-optional-argument (opt arg) 1.54 "Make optional argument string." 1.55 @@ -1211,11 +1213,11 @@ 1.56 (cond 1.57 (yahtml-html4-strict nil) 1.58 (t 1.59 - (let ((b (read-string "bgcolor=")) 1.60 + (let ((b (read-string-with-history "bgcolor=")) 1.61 (bg (yahtml-read-parameter "background" "")) 1.62 - (x (read-string "text color=")) 1.63 - (l (read-string "link color=")) 1.64 - (v (read-string "vlink color="))) 1.65 + (x (read-string-with-history "text color=")) 1.66 + (l (read-string-with-history "link color=")) 1.67 + (v (read-string-with-history "vlink color="))) 1.68 (concat 1.69 (yahtml-make-optional-argument "bgcolor" b) 1.70 (yahtml-make-optional-argument "background" bg) 1.71 @@ -1236,7 +1238,7 @@ 1.72 (let ((src (yahtml-read-parameter "src")) 1.73 (alg (yahtml-read-parameter "align")) 1.74 alt 1.75 - (brd (read-string "border=")) 1.76 + (brd (read-string-with-history "border=")) 1.77 (l yahtml-prefer-upcase-attributes) 1.78 info width height bytes comments) 1.79 (and (stringp src) (string< "" src) (file-exists-p src) 1.80 @@ -1394,21 +1396,21 @@ 1.81 "Add-in function `form' input format" 1.82 (concat 1.83 " " (if yahtml-prefer-upcase-attributes "METHOD" "method") "=\"" 1.84 - (completing-read "Method: " '(("POST") ("GET")) nil t) 1.85 + (completing-read-with-history "Method: " '(("POST") ("GET")) nil t) 1.86 "\"" 1.87 (yahtml-make-optional-argument 1.88 (if yahtml-prefer-upcase-attributes "ENCTYPE" "enctype") 1.89 - (completing-read 1.90 + (completing-read-with-history 1.91 "Enctype: " 1.92 '(("application/x-www-form-urlencoded") ("multipart/form-data")))) 1.93 " " (if yahtml-prefer-upcase-attributes "ACTION" "action") "=\"" 1.94 - (read-string "Action: ") "\"")) 1.95 + (read-string-with-history "Action: ") "\"")) 1.96 1.97 (defun yahtml:select () 1.98 "Add-in function for `select' input format" 1.99 (setq yahtml-last-single-cmd "option") 1.100 (concat " " (if yahtml-prefer-upcase-attributes "NAME" "name") "=\"" 1.101 - (read-string "name: ") "\"")) 1.102 + (read-string-with-history "name: ") "\"")) 1.103 1.104 (defun yahtml:ol () 1.105 "Add-in function for <ol>" 1.106 @@ -1439,7 +1441,7 @@ 1.107 "Add-in function for `input' form" 1.108 (let ((size "") name type value checked (maxlength "") 1.109 (l yahtml-prefer-upcase-attributes)) 1.110 - (setq name (read-string "name: ") 1.111 + (setq name (read-string-with-history "name: ") 1.112 type (YaTeX-completing-read-or-skip "type (default=text): " 1.113 yahtml-input-types nil t) 1.114 value (YaTeX-read-string-or-skip "value: ")) 1.115 @@ -1457,9 +1459,9 @@ 1.116 "Add-in function for `textarea'" 1.117 (interactive) 1.118 (let (name rows cols) 1.119 - (setq name (read-string "Name: ") 1.120 - cols (read-string "Columns: ") 1.121 - rows (read-string "Rows: ")) 1.122 + (setq name (read-string-with-history "Name: ") 1.123 + cols (read-string-with-history "Columns: ") 1.124 + rows (read-string-with-history "Rows: ")) 1.125 (concat 1.126 (concat (if yahtml-prefer-upcase-attributes "NAME=" "name=") 1.127 "\"" name "\"") 1.128 @@ -1468,7 +1470,7 @@ 1.129 1.130 (defun yahtml:table () 1.131 "Add-in function for `table'" 1.132 - (let ((b (read-string "border=")) 1.133 + (let ((b (read-string-with-history "border=")) 1.134 (a (yahtml-read-parameter 1.135 "align" nil '(("align" ("right")("center")))))) 1.136 (if yahtml-html4-strict 1.137 @@ -1506,13 +1508,13 @@ 1.138 (defun yahtml:font () 1.139 "Add-in function for `font'" 1.140 (concat 1.141 - (yahtml-make-optional-argument "color" (read-string "color=")) 1.142 - (yahtml-make-optional-argument "size" (read-string "size=")))) 1.143 + (yahtml-make-optional-argument "color" (read-string-with-history "color=")) 1.144 + (yahtml-make-optional-argument "size" (read-string-with-history "size=")))) 1.145 1.146 (defun yahtml:style () 1.147 "Add-in function for `style'" 1.148 (yahtml-make-optional-argument 1.149 - "type" (read-string "type=" "text/css"))) 1.150 + "type" (read-string-with-history "type=" "text/css"))) 1.151 1.152 (defun yahtml:script () 1.153 "Add-in function for `script'" 1.154 @@ -1547,7 +1549,8 @@ 1.155 "type" (yahtml-read-parameter "type" "text/css")) 1.156 (progn 1.157 (setq href 1.158 - (read-from-minibuffer "href: " "" yahtml-url-completion-map)) 1.159 + (read-from-minibuffer-with-history 1.160 + "href: " "" yahtml-url-completion-map)) 1.161 (if (string< "" href) 1.162 (progn 1.163 (if (and (file-exists-p (yahtml-url-to-path href)) 1.164 @@ -1564,7 +1567,8 @@ 1.165 "type" (yahtml-read-parameter "type" "text/css")) 1.166 (yahtml-make-optional-argument 1.167 "href" 1.168 - (read-from-minibuffer "href: " "" yahtml-url-completion-map))))))) 1.169 + (read-from-minibuffer-with-history 1.170 + "href: " "" yahtml-url-completion-map))))))) 1.171 1.172 (defvar yahtml:meta-names 1.173 '(("name" ("keywords")("author")("copyright")("date")("GENERATOR")))) 1.174 @@ -1591,18 +1595,19 @@ 1.175 "content" 1.176 (cond 1.177 ((string-match "date" name) 1.178 - (read-string "Date: " (current-time-string))) 1.179 + (read-string-with-history "Date: " (current-time-string))) 1.180 ((string-match "author" name) 1.181 - (read-string "Author: " 1.182 + (read-string-with-history "Author: " 1.183 (if (and (user-full-name) (string< "" (user-full-name))) 1.184 (user-full-name) 1.185 (user-login-name)))) 1.186 ((string-match "GENERATOR" name) 1.187 - (setq content (read-string "Generator: " "User-agent: ")) 1.188 + (setq content (read-string-with-history 1.189 + "Generator: " "User-agent: ")) 1.190 (if (string-match "yahtml" content) 1.191 (message "Thank you!")) 1.192 content) 1.193 - (t (read-string (concat name ": "))))))))) 1.194 + (t (read-string-with-history (concat name ": "))))))))) 1.195 1.196 (defun yahtml:br () 1.197 (yahtml-make-optional-argument "clear" (yahtml-read-parameter "clear"))) 1.198 @@ -2376,7 +2381,8 @@ 1.199 (let ((e (cond 1.200 ((null e) "td") 1.201 ((stringp e) e) 1.202 - (t (read-string "Enclose with(`thd' means th td td..): " "th")))) 1.203 + (t (read-string-with-history 1.204 + "Enclose with(`thd' means th td td..): " "th")))) 1.205 (ws "[ \t]") 1.206 elm p i) 1.207 (if (string= delim "") (setq delim " \t\n")) 1.208 @@ -2408,8 +2414,8 @@ 1.209 "Enclose lines in a form tab-sv/csv with <tr><td>..</td></tr>." 1.210 (interactive "P\nsDelimiter(s): \nr") 1.211 (setq e (if (and e (listp e)) 1.212 - (read-string "Enclose with(td or th, `thd' -> th td td td...: " 1.213 - "th"))) 1.214 + (read-string-with-history 1.215 + "Enclose with(td or th, `thd' -> th td td td...: " "th"))) 1.216 (save-excursion 1.217 (save-restriction 1.218 (narrow-to-region (point) (mark)) 1.219 @@ -2866,7 +2872,7 @@ 1.220 (YaTeX-reindent c)))) 1.221 1.222 (defun yahtml-intelligent-newline-head () 1.223 - (let ((title (read-string "Document title: ")) 1.224 + (let ((title (read-string-with-history "Document title: ")) 1.225 (b "<title>") (e "</title>") p) 1.226 (yahtml-indent-line) 1.227 (insert (format "%s" (if yahtml-prefer-upcases (upcase b) b))) 1.228 @@ -2927,7 +2933,8 @@ 1.229 (setq line (concat line (if (and (= i 0) th) "<th></th>" 1.230 "<td></td>")) 1.231 th nil i (1+ i))) 1.232 - (setq fmt (read-string "`th' or `td' format: " "th td td")) 1.233 + (setq fmt (read-string-with-history 1.234 + "`th' or `td' format: " "th td td")) 1.235 (while (string-match "t\\(h\\)\\|td" fmt i) 1.236 (setq line (concat line (if (match-beginning 1) "<th></th>" 1.237 "<td></td>"))
2.1 --- a/yatex.el Fri Jan 16 08:58:20 2015 +0900 2.2 +++ b/yatex.el Fri Jan 16 10:13:08 2015 +0900 2.3 @@ -1,6 +1,6 @@ 2.4 ;;; yatex.el --- Yet Another tex-mode for emacs //野鳥// -*- coding: sjis -*- 2.5 ;;; (c)1991-2015 by HIROSE Yuuji.[yuuji@yatex.org] 2.6 -;;; Last modified Fri Jan 16 08:38:34 2015 on firestorm 2.7 +;;; Last modified Fri Jan 16 09:19:57 2015 on firestorm 2.8 ;;; $Id$ 2.9 ;;; The latest version of this software is always available at; 2.10 ;;; http://www.yatex.org/ 2.11 @@ -972,7 +972,7 @@ 2.12 (addin-args (funcall arg-reader j)) 2.13 (YaTeX-skip-default-reader "") 2.14 (t 2.15 - (read-string 2.16 + (read-string-with-history 2.17 (format "Argument %d of %s: " j section))))) 2.18 (insert 2.19 (concat ;to allow nil return value 2.20 @@ -2209,7 +2209,7 @@ 2.21 (if (not (YaTeX-on-begin-end-p)) 2.22 (comment-out-region 2.23 (if alt-prefix 2.24 - (read-string "Insert prefix: ") 2.25 + (read-string-with-history "Insert prefix: ") 2.26 YaTeX-comment-prefix)) 2.27 (YaTeX-comment-uncomment-env 'comment-out-region))) 2.28 2.29 @@ -2218,7 +2218,7 @@ 2.30 (interactive "P") 2.31 (if (not (YaTeX-on-begin-end-p)) 2.32 (uncomment-out-region 2.33 - (if alt-prefix (read-string "Remove prefix: ") 2.34 + (if alt-prefix (read-string-with-history "Remove prefix: ") 2.35 YaTeX-comment-prefix) 2.36 (region-beginning) (region-end) YaTeX-uncomment-once) 2.37 (YaTeX-comment-uncomment-env 'uncomment-out-region)))
3.1 --- a/yatexadd.el Fri Jan 16 08:58:20 2015 +0900 3.2 +++ b/yatexadd.el Fri Jan 16 10:13:08 2015 +0900 3.3 @@ -1,7 +1,7 @@ 3.4 ;;; yatexadd.el --- YaTeX add-in functions 3.5 ;;; yatexadd.el rev.21 3.6 ;;; (c)1991-2015 by HIROSE Yuuji.[yuuji@yatex.org] 3.7 -;;; Last modified Tue Jan 6 08:53:41 2015 on firestorm 3.8 +;;; Last modified Fri Jan 16 09:33:05 2015 on firestorm 3.9 ;;; $Id$ 3.10 3.11 ;;; Code: 3.12 @@ -27,7 +27,8 @@ 3.13 (setq width (concat "{" (YaTeX:read-length "Width: ") "}"))) 3.14 (setq loc (YaTeX:read-position "tb") 3.15 bars (string-to-int 3.16 - (read-string "Number of columns(0 for default format): " "3"))) 3.17 + (read-string-with-history 3.18 + "Number of columns(0 for default format): " "3"))) 3.19 (if (<= bars 0) 3.20 (setq ;if 0, simple format 3.21 rule YaTeX:tabular-default-rule 3.22 @@ -41,7 +42,7 @@ 3.23 (setq ans (read-char)) 3.24 (cond 3.25 ((or (equal ans ?t) (equal ans ?T)) 3.26 - (setq ans (read-string "Rule width: " "1pt") 3.27 + (setq ans (read-string-with-history "Rule width: " "1pt") 3.28 rule (concat 3.29 "@{" (format YaTeX:tabular-thick-vrule ans) "}" 3.30 rule 3.31 @@ -50,7 +51,7 @@ 3.32 (t (setq rule (concat "|" rule "|") 3.33 hline "\\hline")))) 3.34 3.35 - (setq rule (read-string "rule format: " rule)) 3.36 + (setq rule (read-string-with-history "rule format: " rule)) 3.37 (setq YaTeX-single-command "hline") 3.38 3.39 (format "%s%s{%s}" width loc rule))) 3.40 @@ -58,10 +59,10 @@ 3.41 (fset 'YaTeX:tabular* 'YaTeX:tabular) 3.42 (fset 'YaTeX:supertabular 'YaTeX:tabular) 3.43 (defun YaTeX:alignat () 3.44 - (concat "{" (read-string "Number of columns: ") "}")) 3.45 + (concat "{" (read-string-with-history "Number of columns: ") "}")) 3.46 (defun YaTeX:array () 3.47 (concat (YaTeX:read-position "tb") 3.48 - "{" (read-string "Column format: ") "}")) 3.49 + "{" (read-string-with-history "Column format: ") "}")) 3.50 (defun YaTeX:subequations () 3.51 (message (if YaTeX-japan "分かりやすいコメントに変えるとref補完が楽よ" 3.52 "Changing comment string reduces effort at `ref' completion")) 3.53 @@ -178,7 +179,7 @@ 3.54 3.55 (defun YaTeX:alignat () 3.56 (YaTeX:equation) 3.57 - (concat "{" (read-string "Number of cols: ") "}")) 3.58 + (concat "{" (read-string-with-history "Number of cols: ") "}")) 3.59 3.60 3.61 3.62 @@ -191,10 +192,10 @@ 3.63 3.64 (defun YaTeX:thebibliography () 3.65 (setq YaTeX-section-name "bibitem") 3.66 - (concat "{" (read-string "Longest label: ") "}")) 3.67 + (concat "{" (read-string-with-history "Longest label: ") "}")) 3.68 3.69 (defun YaTeX:multicols () 3.70 - (concat "{" (read-string "Number of columns: ") "}")) 3.71 + (concat "{" (read-string-with-history "Number of columns: ") "}")) 3.72 3.73 3.74 ;; wrapfig.sty 3.75 @@ -214,7 +215,7 @@ 3.76 (defun YaTeX:multiput () 3.77 (concat (YaTeX:read-coordinates "Pos") 3.78 (YaTeX:read-coordinates "Step") 3.79 - "{" (read-string "How many times: ") "}")) 3.80 + "{" (read-string-with-history "How many times: ") "}")) 3.81 3.82 (defun YaTeX:put () 3.83 (YaTeX:read-coordinates "Pos")) 3.84 @@ -243,16 +244,16 @@ 3.85 (defun YaTeX::parbox (argp) 3.86 (cond 3.87 ((= argp 1) (YaTeX:read-length "Width: ")) 3.88 - ((= argp 2) (read-string "Text: ")))) 3.89 + ((= argp 2) (read-string-with-history "Text: ")))) 3.90 3.91 (defun YaTeX::dashbox () 3.92 - (concat "{" (read-string "Dash dimension: ") "}" 3.93 + (concat "{" (read-string-with-history "Dash dimension: ") "}" 3.94 (YaTeX:read-coordinates "Dimension"))) 3.95 3.96 (defun YaTeX::savebox (argp) 3.97 (cond 3.98 - ((= argp 1) (read-string "Saved into name: " "\\")) 3.99 - ((= argp 2) (read-string "Text: ")))) 3.100 + ((= argp 1) (read-string-with-history "Saved into name: " "\\")) 3.101 + ((= argp 2) (read-string-with-history "Text: ")))) 3.102 3.103 (defvar YaTeX-minibuffer-quick-map nil) 3.104 (if YaTeX-minibuffer-quick-map nil 3.105 @@ -301,13 +302,15 @@ 3.106 (defun YaTeX:read-coordinates (&optional mes varX varY) 3.107 (concat 3.108 "(" 3.109 - (read-string (format "%s %s: " (or mes "Dimension") (or varX "X"))) 3.110 + (read-string-with-history 3.111 + (format "%s %s: " (or mes "Dimension") (or varX "X"))) 3.112 "," 3.113 - (read-string (format "%s %s: " (or mes "Dimension") (or varY "Y"))) 3.114 + (read-string-with-history 3.115 + (format "%s %s: " (or mes "Dimension") (or varY "Y"))) 3.116 ")")) 3.117 3.118 (defun YaTeX:itembox () 3.119 - (concat "{" (read-string "Item heading string: ") "}")) 3.120 + (concat "{" (read-string-with-history "Item heading string: ") "}")) 3.121 3.122 ;;; 3.123 ;;Sample functions for maketitle-type command. 3.124 @@ -322,9 +325,9 @@ 3.125 (defun YaTeX:lim () 3.126 "Insert limit notation of \\lim." 3.127 (YaTeX:check-completion-type 'maketitle) 3.128 - (let ((var (read-string "Variable: ")) limit) 3.129 + (let ((var (read-string-with-history "Variable: ")) limit) 3.130 (if (string= "" var) "" 3.131 - (setq limit (read-string "Limit ($ means infinity): ")) 3.132 + (setq limit (read-string-with-history "Limit ($ means infinity): ")) 3.133 (if (string= "$" limit) (setq limit "\\infty")) 3.134 (concat "_{" var " \\rightarrow " limit "}")))) 3.135 3.136 @@ -335,15 +338,16 @@ 3.137 3.138 (defun YaTeX:read-boundary (ULchar) 3.139 "Read boundary usage by _ or ^. _ or ^ is indicated by argument ULchar." 3.140 - (let ((bndry (read-string (concat ULchar "{???} ($ for infinity): ")))) 3.141 + (let ((bndry (read-string-with-history 3.142 + (concat ULchar "{???} ($ for infinity): ")))) 3.143 (if (string= bndry "") "" 3.144 (if (string= bndry "$") (setq bndry "\\infty")) 3.145 (concat ULchar "{" bndry "}")))) 3.146 3.147 (defun YaTeX:verb () 3.148 "Enclose \\verb's contents with the same characters." 3.149 - (let ((quote-char (read-string "Quoting char: " "|")) 3.150 - (contents (read-string "Quoted contents: "))) 3.151 + (let ((quote-char (read-string-with-history "Quoting char: " "|")) 3.152 + (contents (read-string-with-history "Quoted contents: "))) 3.153 (concat quote-char contents quote-char))) 3.154 3.155 (fset 'YaTeX:verb* 'YaTeX:verb) 3.156 @@ -353,12 +357,12 @@ 3.157 nil) 3.158 3.159 (defun YaTeX:cite () 3.160 - (let ((comment (read-string "Comment for citation: "))) 3.161 + (let ((comment (read-string-with-history "Comment for citation: "))) 3.162 (if (string= comment "") "" 3.163 (concat "[" comment "]")))) 3.164 3.165 (defun YaTeX:bibitem () 3.166 - (let ((label (read-string "Citation label for bibitem: "))) 3.167 + (let ((label (read-string-with-history "Citation label for bibitem: "))) 3.168 (if (string= label "") "" 3.169 (concat "[" label "]")))) 3.170 3.171 @@ -609,7 +613,7 @@ 3.172 (let ((default (condition-case nil 3.173 (YaTeX::ref-default-label) 3.174 (error (substring (current-time-string) 4))))) 3.175 - (read-string "Give a label for this line: " 3.176 + (read-string-with-history "Give a label for this line: " 3.177 (if YaTeX-emacs-19 (cons default 1) default)))) 3.178 3.179 (defun YaTeX::ref-getset-label (buffer point &optional noset) 3.180 @@ -1256,7 +1260,7 @@ 3.181 (let*((chmode (boundp (intern-soft "old"))) 3.182 (dlab (if chmode old ;if called via YaTeX-change-section (tricky...) 3.183 (YaTeX::ref-default-label))) 3.184 - (label (read-string 3.185 + (label (read-string-with-history 3.186 (format "New %s name: " (or labname "label")) 3.187 (cons dlab 1)))) 3.188 (if (string< "" label) 3.189 @@ -1400,7 +1404,7 @@ 3.190 (hilit-auto-highlight nil) 3.191 (pcnt (regexp-quote YaTeX-comment-prefix)) 3.192 (bibrx (concat YaTeX-ec-regexp "bibliography{\\([^}]+\\)}")) 3.193 - (bibptn (read-string "Pattern: ")) 3.194 + (bibptn (read-string-with-history "Pattern: ")) 3.195 (bbuf (get-buffer-create " *bibitems*")) 3.196 (standard-output bbuf) 3.197 (me 'YaTeX::cite) ;shuld set this for using YaTeX::ref 3.198 @@ -1507,13 +1511,14 @@ 3.199 (defun YaTeX::newcommand (&optional argp) 3.200 (cond 3.201 ((= argp 1) 3.202 - (let ((command (read-string "Define newcommand: " "\\"))) 3.203 + (let ((command (read-string-with-history "Define newcommand: " "\\"))) 3.204 (put 'YaTeX::newcommand 'command (substring command 1)) 3.205 command)) 3.206 ((= argp 2) 3.207 (let ((argc 3.208 - (string-to-int (read-string "Number of arguments(Default 0): "))) 3.209 - (def (read-string "Definition: ")) 3.210 + (string-to-int 3.211 + (read-string-with-history "Number of arguments(Default 0): "))) 3.212 + (def (read-string-with-history "Definition: ")) 3.213 (command (get 'YaTeX::newcommand 'command))) 3.214 ;;!!! It's illegal to insert string in the add-in function !!! 3.215 (if (> argc 0) (insert (format "[%d]" argc))) 3.216 @@ -1540,7 +1545,7 @@ 3.217 (defun YaTeX::newcounter (&optional argp) 3.218 (cond 3.219 ((= argp 1) 3.220 - (read-string "New counter name: ")) 3.221 + (read-string-with-history "New counter name: ")) 3.222 (t ""))) 3.223 3.224 ;; 3.225 @@ -1638,13 +1643,13 @@ 3.226 'YaTeX:style-parameters-local 3.227 nil nil "\\")) 3.228 ((equal 2 argp) 3.229 - (read-string "Text: ")))) 3.230 + (read-string-with-history "Text: ")))) 3.231 3.232 (defun YaTeX::newlength (&optional argp) 3.233 "YaTeX add-in function for arguments of \\newlength" 3.234 (cond 3.235 ((equal argp 1) 3.236 - (let ((length (read-string "Length variable: " "\\"))) 3.237 + (let ((length (read-string-with-history "Length variable: " "\\"))) 3.238 (if (string< "" length) 3.239 (YaTeX-update-table 3.240 (list length) 3.241 @@ -1658,11 +1663,11 @@ 3.242 "YaTeX add-in function for arguments of \\multicolumn." 3.243 (cond 3.244 ((equal 1 argp) 3.245 - (read-string "Number of columns: ")) 3.246 + (read-string-with-history "Number of columns: ")) 3.247 ((equal 2 argp) 3.248 (YaTeX:read-oneof "|lrc" nil t)) 3.249 ((equal 3 argp) 3.250 - (read-string "Item: ")))) 3.251 + (read-string-with-history "Item: ")))) 3.252 3.253 (defvar YaTeX:documentstyles-default 3.254 '(("article") ("jarticle") ("j-article") 3.255 @@ -1809,12 +1814,12 @@ 3.256 YaTeX-default-documentclass sname))))) 3.257 3.258 (defun YaTeX::title (&optional argp) 3.259 - (prog1 (read-string "Document Title: ") 3.260 + (prog1 (read-string-with-history "Document Title: ") 3.261 (setq YaTeX-section-name "author" 3.262 YaTeX-single-command "maketitle"))) 3.263 3.264 (defun YaTeX::author (&optional argp) 3.265 - (prog1 (read-string "Document Author: ") 3.266 + (prog1 (read-string-with-history "Document Author: ") 3.267 (setq YaTeX-section-name "date" 3.268 YaTeX-single-command "maketitle"))) 3.269 3.270 @@ -1868,7 +1873,7 @@ 3.271 "Add-in for \\color's argument" 3.272 (cond 3.273 ((= argp 1) (YaTeX::color-completing-read "Color: ")) 3.274 - ((= argp 2) (read-string "Colored string: ")))) 3.275 + ((= argp 2) (read-string-with-history "Colored string: ")))) 3.276 3.277 (fset 'YaTeX:color 'YaTeX:textcolor) 3.278 (fset 'YaTeX::color 'YaTeX::textcolor) 3.279 @@ -1882,14 +1887,14 @@ 3.280 (cond 3.281 ((= argp 1) (YaTeX::color-completing-read "Frame color: ")) 3.282 ((= argp 2) (YaTeX::color-completing-read "Inner color: ")) 3.283 - ((= argp 3) (read-string "Colored string: ")))) 3.284 + ((= argp 3) (read-string-with-history "Colored string: ")))) 3.285 3.286 (defun YaTeX:scalebox () 3.287 "Add-in for \\scalebox" 3.288 (let ((vmag (read-string 3.289 (if YaTeX-japan "倍率(負で反転): " 3.290 "Magnification(Negative for flipped): "))) 3.291 - (hmag (read-string (if YaTeX-japan "縦倍率(省略可): " 3.292 + (hmag (read-string-with-history (if YaTeX-japan "縦倍率(省略可): " 3.293 "Vertical magnification(Optional): ")))) 3.294 (if (and hmag (string< "" hmag)) 3.295 (format "{%s}[%s]" vmag hmag) 3.296 @@ -1904,9 +1909,11 @@ 3.297 (if (string< "" (setq r (YaTeX:read-oneof "htbpB"))) 3.298 (concat "[origin=" r "]"))) 3.299 ((memq c '(?X ?x ?Y ?y)) 3.300 - (setq r (read-string "" (if YaTeX-emacs-19 (cons defx 3) defx)) 3.301 + (setq r (read-string-with-history 3.302 + "" (if YaTeX-emacs-19 (cons defx 3) defx)) 3.303 x (if (string< "x=" r) r) 3.304 - r (read-string "" (if YaTeX-emacs-19 (cons defy 3) defy)) 3.305 + r (read-string-with-history 3.306 + "" (if YaTeX-emacs-19 (cons defy 3) defy)) 3.307 y (if (string< "y=" r) r) 3.308 something (or x y)) 3.309 (format "%s%s%s%s%s" 3.310 @@ -1920,10 +1927,10 @@ 3.311 "Argument add-in for \\rotatebox" 3.312 (cond 3.313 ((= argp 1) 3.314 - (read-string (if YaTeX-japan "回転角(度; 左回り): " 3.315 + (read-string-with-history (if YaTeX-japan "回転角(度; 左回り): " 3.316 "Angle in degree(unclockwise): "))) 3.317 ((= argp 2) 3.318 - (read-string (if YaTeX-japan "テキスト: " "Text: "))))) 3.319 + (read-string-with-history (if YaTeX-japan "テキスト: " "Text: "))))) 3.320 3.321 (defun YaTeX:includegraphics () 3.322 "Add-in for \\includegraphics's option" 3.323 @@ -2058,7 +2065,7 @@ 3.324 (defun YaTeX::mask (argp) 3.325 (cond 3.326 ((equal argp 1) 3.327 - (read-string "String: ")) 3.328 + (read-string-with-history "String: ")) 3.329 ((equal argp 2) 3.330 (let (c) 3.331 (while (not (memq c '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K))) 3.332 @@ -2081,12 +2088,12 @@ 3.333 ((equal argp 4) 3.334 (YaTeX:read-oneof "lcr" 'quick)) 3.335 ((equal argp 5) 3.336 - (read-string "String: ")))) 3.337 + (read-string-with-history "String: ")))) 3.338 3.339 (defun YaTeX::textcircled (argp) 3.340 (cond 3.341 ((equal argp 1) 3.342 - (let ((char (read-string "Circled char: ")) 3.343 + (let ((char (read-string-with-history "Circled char: ")) 3.344 (left "") (right "") c) 3.345 (setq c (read-char 3.346 "Enclose also with (s)mall (t)iny s(C)riptsize (N)one:")) 3.347 @@ -2183,7 +2190,7 @@ 3.348 (defun YaTeX::DeclareMathOperator (argp) 3.349 (cond 3.350 ((equal argp 1) 3.351 - (read-string "Operator: " "\\")))) 3.352 + (read-string-with-history "Operator: " "\\")))) 3.353 3.354 ;;; 3.355 ;; Add-in functions for large-type command.