diff options
| author | Jay Belanger | 2004-12-08 06:10:56 +0000 |
|---|---|---|
| committer | Jay Belanger | 2004-12-08 06:10:56 +0000 |
| commit | 19649cc93c33d33115b6a9761228b2aca40d9b02 (patch) | |
| tree | 701426c2e3344eef07627230f49bf801911b83fe | |
| parent | c59d10e073eaa01df6fd12204558fb01a01bb259 (diff) | |
| download | emacs-19649cc93c33d33115b6a9761228b2aca40d9b02.tar.gz emacs-19649cc93c33d33115b6a9761228b2aca40d9b02.zip | |
(math-read-replacement-list, math-read-superscripts): Move to
calc-aent.el.
(math-read-preprocess-string): Move to calc-aent.el.
| -rw-r--r-- | lisp/calc/calc-ext.el | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index d308a391a05..89588b4ea74 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el | |||
| @@ -2874,73 +2874,6 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 2874 | 2874 | ||
| 2875 | (defvar math-expr-data) | 2875 | (defvar math-expr-data) |
| 2876 | 2876 | ||
| 2877 | (defvar math-read-replacement-list | ||
| 2878 | '(;; Misc symbols | ||
| 2879 | ("±" "+/-") ; plus or minus | ||
| 2880 | ("×" "*") ; multiplication sign | ||
| 2881 | ("÷" ":") ; division sign | ||
| 2882 | ("−" "-") ; subtraction sign | ||
| 2883 | ("∕" "/") ; division sign | ||
| 2884 | ("∗" "*") ; asterisk multiplication | ||
| 2885 | ("∞" "inf") ; infinity symbol | ||
| 2886 | ("≤" "<=") | ||
| 2887 | ("≥" ">=") | ||
| 2888 | ("≦" "<=") | ||
| 2889 | ("≧" ">=") | ||
| 2890 | ;; fractions | ||
| 2891 | ("¼" "(1:4)") ; 1/4 | ||
| 2892 | ("½" "(1:2)") ; 1/2 | ||
| 2893 | ("¾" "(3:4)") ; 3/4 | ||
| 2894 | ("⅓" "(1:3)") ; 1/3 | ||
| 2895 | ("⅔" "(2:3)") ; 2/3 | ||
| 2896 | ("⅕" "(1:5)") ; 1/5 | ||
| 2897 | ("⅖" "(2:5)") ; 2/5 | ||
| 2898 | ("⅗" "(3:5)") ; 3/5 | ||
| 2899 | ("⅘" "(4:5)") ; 4/5 | ||
| 2900 | ("⅙" "(1:6)") ; 1/6 | ||
| 2901 | ("⅚" "(5:6)") ; 5/6 | ||
| 2902 | ("⅛" "(1:8)") ; 1/8 | ||
| 2903 | ("⅜" "(3:8)") ; 3/8 | ||
| 2904 | ("⅝" "(5:8)") ; 5/8 | ||
| 2905 | ("⅞" "(7:8)") ; 7/8 | ||
| 2906 | ("⅟" "1:") ; 1/... | ||
| 2907 | ;; superscripts | ||
| 2908 | ("⁰" "0") ; 0 | ||
| 2909 | ("¹" "1") ; 1 | ||
| 2910 | ("²" "2") ; 2 | ||
| 2911 | ("³" "3") ; 3 | ||
| 2912 | ("⁴" "4") ; 4 | ||
| 2913 | ("⁵" "5") ; 5 | ||
| 2914 | ("⁶" "6") ; 6 | ||
| 2915 | ("⁷" "7") ; 7 | ||
| 2916 | ("⁸" "8") ; 8 | ||
| 2917 | ("⁹" "9") ; 9 | ||
| 2918 | ("⁺" "+") ; + | ||
| 2919 | ("⁻" "-") ; - | ||
| 2920 | ("⁽" "(") ; ( | ||
| 2921 | ("⁾" ")") ; ) | ||
| 2922 | ("ⁿ" "n") ; n | ||
| 2923 | ("ⁱ" "i")) ; i | ||
| 2924 | "A list whose elements (old new) indicate replacements to make | ||
| 2925 | in Calc algebraic input.") | ||
| 2926 | |||
| 2927 | (defvar math-read-superscripts | ||
| 2928 | "⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁽⁾ⁿⁱ" ; 0123456789+-()ni | ||
| 2929 | "A string consisting of the superscripts allowed by Calc.") | ||
| 2930 | |||
| 2931 | (defun math-read-preprocess-string (str) | ||
| 2932 | "Replace some substrings of STR by Calc equivalents." | ||
| 2933 | (setq str | ||
| 2934 | (replace-regexp-in-string (concat "[" math-read-superscripts "]+") | ||
| 2935 | "^(\\&)" str)) | ||
| 2936 | (let ((rep-list math-read-replacement-list)) | ||
| 2937 | (while rep-list | ||
| 2938 | (setq str | ||
| 2939 | (replace-regexp-in-string (nth 0 (car rep-list)) | ||
| 2940 | (nth 1 (car rep-list)) str)) | ||
| 2941 | (setq rep-list (cdr rep-list)))) | ||
| 2942 | str) | ||
| 2943 | |||
| 2944 | (defun math-read-expr (math-exp-str) | 2877 | (defun math-read-expr (math-exp-str) |
| 2945 | (let ((math-exp-pos 0) | 2878 | (let ((math-exp-pos 0) |
| 2946 | (math-exp-old-pos 0) | 2879 | (math-exp-old-pos 0) |