Mercurial > emacs
comparison lisp/calc/calc-graph.el @ 62037:3947739eeeb9
(calc-graph-plot, calc-graph-set-styles, calc-graph-num-points)
(calc-graph-init): Replace string-to-int by string-to-number.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Mon, 02 May 2005 19:44:07 +0000 |
parents | d727bdc30df2 |
children | b63a162aa98e 08185296b491 |
comparison
equal
deleted
inserted
replaced
62036:e0224a91347d | 62037:3947739eeeb9 |
---|---|
405 (if (equal output "STDOUT") | 405 (if (equal output "STDOUT") |
406 "" | 406 "" |
407 (prin1-to-string output))))) | 407 (prin1-to-string output))))) |
408 (setq calc-graph-resolution (calc-graph-find-command "samples")) | 408 (setq calc-graph-resolution (calc-graph-find-command "samples")) |
409 (if calc-graph-resolution | 409 (if calc-graph-resolution |
410 (setq calc-graph-resolution (string-to-int calc-graph-resolution)) | 410 (setq calc-graph-resolution (string-to-number calc-graph-resolution)) |
411 (setq calc-graph-resolution (if calc-graph-is-splot | 411 (setq calc-graph-resolution (if calc-graph-is-splot |
412 calc-graph-default-resolution-3d | 412 calc-graph-default-resolution-3d |
413 calc-graph-default-resolution))) | 413 calc-graph-default-resolution))) |
414 (setq precision (calc-graph-find-command "precision")) | 414 (setq precision (calc-graph-find-command "precision")) |
415 (if precision | 415 (if precision |
416 (setq precision (string-to-int precision)) | 416 (setq precision (string-to-number precision)) |
417 (setq precision calc-graph-default-precision)) | 417 (setq precision calc-graph-default-precision)) |
418 (calc-graph-set-command "terminal") | 418 (calc-graph-set-command "terminal") |
419 (calc-graph-set-command "output") | 419 (calc-graph-set-command "output") |
420 (calc-graph-set-command "samples") | 420 (calc-graph-set-command "samples") |
421 (calc-graph-set-command "precision")) | 421 (calc-graph-set-command "precision")) |
1076 (goto-char (match-end 0)) | 1076 (goto-char (match-end 0)) |
1077 (if (looking-at "[ \t]+\\([a-z]+\\)") | 1077 (if (looking-at "[ \t]+\\([a-z]+\\)") |
1078 (setq mode (buffer-substring (match-beginning 1) | 1078 (setq mode (buffer-substring (match-beginning 1) |
1079 (match-end 1)))) | 1079 (match-end 1)))) |
1080 (if (looking-at "[ \ta-z]+\\([0-9]+\\)") | 1080 (if (looking-at "[ \ta-z]+\\([0-9]+\\)") |
1081 (setq lstyle (string-to-int | 1081 (setq lstyle (string-to-number |
1082 (buffer-substring (match-beginning 1) | 1082 (buffer-substring (match-beginning 1) |
1083 (match-end 1))))) | 1083 (match-end 1))))) |
1084 (if (looking-at "[ \ta-z]+[0-9]+[ \t]+\\([0-9]+\\)") | 1084 (if (looking-at "[ \ta-z]+[0-9]+[ \t]+\\([0-9]+\\)") |
1085 (setq pstyle (string-to-int | 1085 (setq pstyle (string-to-number |
1086 (buffer-substring (match-beginning 1) | 1086 (buffer-substring (match-beginning 1) |
1087 (match-end 1))))))) | 1087 (match-end 1))))))) |
1088 (setq lenbl (or (equal mode "lines") (equal mode "linespoints")) | 1088 (setq lenbl (or (equal mode "lines") (equal mode "linespoints")) |
1089 penbl (or (equal mode "points") (equal mode "linespoints"))) | 1089 penbl (or (equal mode "points") (equal mode "linespoints"))) |
1090 (if lines | 1090 (if lines |
1193 (if flag | 1193 (if flag |
1194 (if (> (prefix-numeric-value flag) 0) | 1194 (if (> (prefix-numeric-value flag) 0) |
1195 (if (equal res "") | 1195 (if (equal res "") |
1196 (message "Default resolution is %d" | 1196 (message "Default resolution is %d" |
1197 calc-graph-default-resolution) | 1197 calc-graph-default-resolution) |
1198 (setq calc-graph-default-resolution (string-to-int res))) | 1198 (setq calc-graph-default-resolution (string-to-number res))) |
1199 (if (equal res "") | 1199 (if (equal res "") |
1200 (message "Default 3D resolution is %d" | 1200 (message "Default 3D resolution is %d" |
1201 calc-graph-default-resolution-3d) | 1201 calc-graph-default-resolution-3d) |
1202 (setq calc-graph-default-resolution-3d (string-to-int res)))) | 1202 (setq calc-graph-default-resolution-3d (string-to-number res)))) |
1203 (calc-graph-set-command "samples" (if (not (equal res "")) res)))) | 1203 (calc-graph-set-command "samples" (if (not (equal res "")) res)))) |
1204 | 1204 |
1205 (defun calc-graph-device (name flag) | 1205 (defun calc-graph-device (name flag) |
1206 (interactive "sDevice name: \nP") | 1206 (interactive "sDevice name: \nP") |
1207 (if (equal name "?") | 1207 (if (equal name "?") |
1454 (error "Unable to start GNUPLOT process")) | 1454 (error "Unable to start GNUPLOT process")) |
1455 (if (save-excursion | 1455 (if (save-excursion |
1456 (goto-char origin) | 1456 (goto-char origin) |
1457 (re-search-forward | 1457 (re-search-forward |
1458 "G N U P L O T.*\n.*version \\([0-9]+\\)\\." nil t)) | 1458 "G N U P L O T.*\n.*version \\([0-9]+\\)\\." nil t)) |
1459 (setq calc-gnuplot-version (string-to-int (buffer-substring | 1459 (setq calc-gnuplot-version (string-to-number (buffer-substring |
1460 (match-beginning 1) | 1460 (match-beginning 1) |
1461 (match-end 1)))) | 1461 (match-end 1)))) |
1462 (setq calc-gnuplot-version 1)) | 1462 (setq calc-gnuplot-version 1)) |
1463 (goto-char (point-max))))) | 1463 (goto-char (point-max))))) |
1464 (save-excursion | 1464 (save-excursion |