summaryrefslogtreecommitdiff
path: root/lisp/calc
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2004-12-08 22:21:07 +0000
committerKaroly Lorentey <lorentey@elte.hu>2004-12-08 22:21:07 +0000
commitb3be62d4c924fd8aa8b6fdfa96b03a015c586285 (patch)
tree84d262494fc16e4a13f68dad39f2bbcd566a98d4 /lisp/calc
parentfad2f6858075f49c4c8fd16f0535c287e3f14ac3 (diff)
parent3073399bdafd5283661fae867983d0d30c7f2536 (diff)
downloademacs-b3be62d4c924fd8aa8b6fdfa96b03a015c586285.tar.gz
emacs-b3be62d4c924fd8aa8b6fdfa96b03a015c586285.tar.bz2
emacs-b3be62d4c924fd8aa8b6fdfa96b03a015c586285.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-715 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-717 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-718 RCS keyword removal * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-719 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-74 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-272
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calc-aent.el67
-rw-r--r--lisp/calc/calc-ext.el67
-rw-r--r--lisp/calc/calc.el2
3 files changed, 68 insertions, 68 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el
index 4c62e570349..c062a822e89 100644
--- a/lisp/calc/calc-aent.el
+++ b/lisp/calc/calc-aent.el
@@ -465,6 +465,73 @@ T means abort and give an error message.")
;;; Algebraic expression parsing. [Public]
+(defvar math-read-replacement-list
+ '(;; Misc symbols
+ ("±" "+/-") ; plus or minus
+ ("×" "*") ; multiplication sign
+ ("÷" ":") ; division sign
+ ("−" "-") ; subtraction sign
+ ("∕" "/") ; division sign
+ ("∗" "*") ; asterisk multiplication
+ ("∞" "inf") ; infinity symbol
+ ("≤" "<=")
+ ("≥" ">=")
+ ("≦" "<=")
+ ("≧" ">=")
+ ;; fractions
+ ("¼" "(1:4)") ; 1/4
+ ("½" "(1:2)") ; 1/2
+ ("¾" "(3:4)") ; 3/4
+ ("⅓" "(1:3)") ; 1/3
+ ("⅔" "(2:3)") ; 2/3
+ ("⅕" "(1:5)") ; 1/5
+ ("⅖" "(2:5)") ; 2/5
+ ("⅗" "(3:5)") ; 3/5
+ ("⅘" "(4:5)") ; 4/5
+ ("⅙" "(1:6)") ; 1/6
+ ("⅚" "(5:6)") ; 5/6
+ ("⅛" "(1:8)") ; 1/8
+ ("⅜" "(3:8)") ; 3/8
+ ("⅝" "(5:8)") ; 5/8
+ ("⅞" "(7:8)") ; 7/8
+ ("⅟" "1:") ; 1/...
+ ;; superscripts
+ ("⁰" "0") ; 0
+ ("¹" "1") ; 1
+ ("²" "2") ; 2
+ ("³" "3") ; 3
+ ("⁴" "4") ; 4
+ ("⁵" "5") ; 5
+ ("⁶" "6") ; 6
+ ("⁷" "7") ; 7
+ ("⁸" "8") ; 8
+ ("⁹" "9") ; 9
+ ("⁺" "+") ; +
+ ("⁻" "-") ; -
+ ("⁽" "(") ; (
+ ("⁾" ")") ; )
+ ("ⁿ" "n") ; n
+ ("ⁱ" "i")) ; i
+ "A list whose elements (old new) indicate replacements to make
+in Calc algebraic input.")
+
+(defvar math-read-superscripts
+ "⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁽⁾ⁿⁱ" ; 0123456789+-()ni
+ "A string consisting of the superscripts allowed by Calc.")
+
+(defun math-read-preprocess-string (str)
+ "Replace some substrings of STR by Calc equivalents."
+ (setq str
+ (replace-regexp-in-string (concat "[" math-read-superscripts "]+")
+ "^(\\&)" str))
+ (let ((rep-list math-read-replacement-list))
+ (while rep-list
+ (setq str
+ (replace-regexp-in-string (nth 0 (car rep-list))
+ (nth 1 (car rep-list)) str))
+ (setq rep-list (cdr rep-list))))
+ str)
+
;; The next few variables are local to math-read-exprs (and math-read-expr
;; in calc-ext.el), but are set in functions they call.
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))))
(defvar math-expr-data)
-(defvar math-read-replacement-list
- '(;; Misc symbols
- ("±" "+/-") ; plus or minus
- ("×" "*") ; multiplication sign
- ("÷" ":") ; division sign
- ("−" "-") ; subtraction sign
- ("∕" "/") ; division sign
- ("∗" "*") ; asterisk multiplication
- ("∞" "inf") ; infinity symbol
- ("≤" "<=")
- ("≥" ">=")
- ("≦" "<=")
- ("≧" ">=")
- ;; fractions
- ("¼" "(1:4)") ; 1/4
- ("½" "(1:2)") ; 1/2
- ("¾" "(3:4)") ; 3/4
- ("⅓" "(1:3)") ; 1/3
- ("⅔" "(2:3)") ; 2/3
- ("⅕" "(1:5)") ; 1/5
- ("⅖" "(2:5)") ; 2/5
- ("⅗" "(3:5)") ; 3/5
- ("⅘" "(4:5)") ; 4/5
- ("⅙" "(1:6)") ; 1/6
- ("⅚" "(5:6)") ; 5/6
- ("⅛" "(1:8)") ; 1/8
- ("⅜" "(3:8)") ; 3/8
- ("⅝" "(5:8)") ; 5/8
- ("⅞" "(7:8)") ; 7/8
- ("⅟" "1:") ; 1/...
- ;; superscripts
- ("⁰" "0") ; 0
- ("¹" "1") ; 1
- ("²" "2") ; 2
- ("³" "3") ; 3
- ("⁴" "4") ; 4
- ("⁵" "5") ; 5
- ("⁶" "6") ; 6
- ("⁷" "7") ; 7
- ("⁸" "8") ; 8
- ("⁹" "9") ; 9
- ("⁺" "+") ; +
- ("⁻" "-") ; -
- ("⁽" "(") ; (
- ("⁾" ")") ; )
- ("ⁿ" "n") ; n
- ("ⁱ" "i")) ; i
- "A list whose elements (old new) indicate replacements to make
-in Calc algebraic input.")
-
-(defvar math-read-superscripts
- "⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁽⁾ⁿⁱ" ; 0123456789+-()ni
- "A string consisting of the superscripts allowed by Calc.")
-
-(defun math-read-preprocess-string (str)
- "Replace some substrings of STR by Calc equivalents."
- (setq str
- (replace-regexp-in-string (concat "[" math-read-superscripts "]+")
- "^(\\&)" str))
- (let ((rep-list math-read-replacement-list))
- (while rep-list
- (setq str
- (replace-regexp-in-string (nth 0 (car rep-list))
- (nth 1 (car rep-list)) str))
- (setq rep-list (cdr rep-list))))
- str)
-
(defun math-read-expr (math-exp-str)
(let ((math-exp-pos 0)
(math-exp-old-pos 0)
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index a7e840594ec..d8e6eb3017c 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -890,7 +890,7 @@ If nil, selections displayed but ignored.")
calc-check-user-syntax calc-do-alg-entry calc-do-calc-eval
calc-do-quick-calc calc-match-user-syntax math-build-parse-table
math-find-user-tokens math-read-expr-list math-read-exprs math-read-if
- math-read-token math-remove-dashes)
+ math-read-token math-remove-dashes math-read-preprocess-string)
("calc-embed" calc-do-embedded-activate)