mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
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.
This commit is contained in:
parent
7aefa4457f
commit
ae6bc504c0
8 changed files with 64 additions and 35 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue