summaryrefslogtreecommitdiff
path: root/lisp/calc
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2005-04-09 02:16:29 +0000
committerMiles Bader <miles@gnu.org>2005-04-09 02:16:29 +0000
commit768d4533ce51d61ce065b28f63aae43c7be0d1cc (patch)
treefb2d103d5c9354b3a15550b160bba0ff2e22c418 /lisp/calc
parent918bcc18650840562677f841aa0bcaa34a069be5 (diff)
parent2a9e192d3815d2c34fdd41d52590027805bc9055 (diff)
downloademacs-768d4533ce51d61ce065b28f63aae43c7be0d1cc.tar.gz
emacs-768d4533ce51d61ce065b28f63aae43c7be0d1cc.tar.bz2
emacs-768d4533ce51d61ce065b28f63aae43c7be0d1cc.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-35
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 228-240) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 53-58) - Merge from emacs--cvs-trunk--0 - Update from CVS - Collapse feature addition/removal within single ChangeLog entry
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calc-aent.el24
-rw-r--r--lisp/calc/calc.el3
2 files changed, 25 insertions, 2 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el
index e174d81c41d..a2d6e9dc88c 100644
--- a/lisp/calc/calc-aent.el
+++ b/lisp/calc/calc-aent.el
@@ -519,7 +519,22 @@ T means abort and give an error message.")
("⁽" "(") ; (
("⁾" ")") ; )
("ⁿ" "n") ; n
- ("ⁱ" "i")) ; i
+ ("ⁱ" "i") ; i
+ ;; subscripts
+ ("₀" "0") ; 0
+ ("₁" "1") ; 1
+ ("₂" "2") ; 2
+ ("₃" "3") ; 3
+ ("₄" "4") ; 4
+ ("₅" "5") ; 5
+ ("₆" "6") ; 6
+ ("₇" "7") ; 7
+ ("₈" "8") ; 8
+ ("₉" "9") ; 9
+ ("₊" "+") ; +
+ ("₋" "-") ; -
+ ("₍" "(") ; (
+ ("₎" ")")) ; )
"A list whose elements (old new) indicate replacements to make
in Calc algebraic input.")
@@ -527,11 +542,18 @@ in Calc algebraic input.")
"⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁽⁾ⁿⁱ" ; 0123456789+-()ni
"A string consisting of the superscripts allowed by Calc.")
+(defvar math-read-subscripts
+ "₀₁₂₃₄₅₆₇₈₉₊₋₍₎" ; 0123456789+-()
+ "A string consisting of the subscripts 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))
+ (setq str
+ (replace-regexp-in-string (concat "[" math-read-subscripts "]+")
+ "_(\\&)" str))
(let ((rep-list math-read-replacement-list))
(while rep-list
(setq str
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 3d78599ecc1..ceee013e493 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -231,7 +231,8 @@
(f90-mode . fortran))
"*Alist of major modes with appropriate Calc languages."
:group 'calc
- :type '(alist :key-type symbol :value-type symbol))
+ :type '(alist :key-type (symbol :tag "Major mode")
+ :value-type (symbol :tag "Calc language")))
(defcustom calc-embedded-announce-formula
"%Embed\n\\(% .*\n\\)*"