aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/calc/calc-aent.el
diff options
context:
space:
mode:
authorJay Belanger <[email protected]>2010-05-14 23:50:25 -0500
committerJay Belanger <[email protected]>2010-05-14 23:50:25 -0500
commitae6bc504c0f6676bc91420765e286b2bc4c1ed2c (patch)
treed8b1fd909ad40c9813d81c8acc0ae96735791af2 /lisp/calc/calc-aent.el
parent7aefa4457f3017db6d6daee95841a2185c5113cd (diff)
calc-aent.el (math-read-token, math-find-user-tokens):
calc-lang.el (math-read-big-rec, math-lang-read-symbol) (math-compose-tex-func): calccomp.el (math-compose-expr): calc-ext.el (math-format-flat-expr-fancy): calc-store.el (calc-read-var-name): calc-units.el (calc-explain-units-rec): Allow Greek letters. calc.el (var-π, var-φ, var-γ): New variables. calc-aent.el (math-read-replacement-list): Add "micro" symbol. calc-units.el (math-unit-prefixes): Add mu for micro. (math-standard-units): Add units.
Diffstat (limited to 'lisp/calc/calc-aent.el')
-rw-r--r--lisp/calc/calc-aent.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el
index 58e30a237f..77a02b58c7 100644
--- a/lisp/calc/calc-aent.el
+++ b/lisp/calc/calc-aent.el
@@ -510,6 +510,7 @@ The value t means abort and give an error message.")
("≥" ">=")
("≦" "<=")
("≧" ">=")
+ ("µ" "μ")
;; fractions
("¼" "(1:4)") ; 1/4
("½" "(1:2)") ; 1/2
@@ -675,11 +676,11 @@ in Calc algebraic input.")
(cond ((and (stringp (car p))
(or (> (length (car p)) 1) (equal (car p) "$")
(equal (car p) "\""))
- (string-match "[^a-zA-Z0-9]" (car p)))
+ (string-match "[^a-zA-Zα-ωΑ-Ω0-9]" (car p)))
(let ((s (regexp-quote (car p))))
- (if (string-match "\\`[a-zA-Z0-9]" s)
+ (if (string-match "\\`[a-zA-Zα-ωΑ-Ω0-9]" s)
(setq s (concat "\\<" s)))
- (if (string-match "[a-zA-Z0-9]\\'" s)
+ (if (string-match "[a-zA-Zα-ωΑ-Ω0-9]\\'" s)
(setq s (concat s "\\>")))
(or (assoc s math-toks)
(progn
@@ -718,15 +719,17 @@ in Calc algebraic input.")
math-expr-data (math-match-substring math-exp-str 0)
math-exp-pos (match-end 0)))
((or (and (>= ch ?a) (<= ch ?z))
- (and (>= ch ?A) (<= ch ?Z)))
+ (and (>= ch ?A) (<= ch ?Z))
+ (and (>= ch ?α) (<= ch ?ω))
+ (and (>= ch ?Α) (<= ch ?Ω)))
(string-match
(cond
((and (memq calc-language calc-lang-allow-underscores)
(memq calc-language calc-lang-allow-percentsigns))
- "[a-zA-Z0-9_'#]*")
+ "[a-zA-Zα-ωΑ-Ω0-9_'#]*")
((memq calc-language calc-lang-allow-underscores)
- "[a-zA-Z0-9_#]*")
- (t "[a-zA-Z0-9'#]*"))
+ "[a-zA-Zα-ωΑ-Ω0-9_#]*")
+ (t "[a-zA-Zα-ωΑ-Ω0-9'#]*"))
math-exp-str math-exp-pos)
(setq math-exp-token 'symbol
math-exp-pos (match-end 0)
@@ -744,12 +747,12 @@ in Calc algebraic input.")
(or (eq math-exp-pos 0)
(and (not (memq calc-language
calc-lang-allow-underscores))
- (eq (string-match "[^])}\"a-zA-Z0-9'$]_"
+ (eq (string-match "[^])}\"a-zA-Zα-ωΑ-Ω0-9'$]_"
math-exp-str (1- math-exp-pos))
(1- math-exp-pos))))))
(or (and (memq calc-language calc-lang-c-type-hex)
(string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos))
- (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Z:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
+ (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
math-exp-str math-exp-pos))
(setq math-exp-token 'number
math-expr-data (math-match-substring math-exp-str 0)