diff options
| author | Jay Belanger | 2010-05-14 23:50:25 -0500 |
|---|---|---|
| committer | Jay Belanger | 2010-05-14 23:50:25 -0500 |
| commit | ae6bc504c0f6676bc91420765e286b2bc4c1ed2c (patch) | |
| tree | d8b1fd909ad40c9813d81c8acc0ae96735791af2 | |
| parent | 7aefa4457f3017db6d6daee95841a2185c5113cd (diff) | |
| download | emacs-ae6bc504c0f6676bc91420765e286b2bc4c1ed2c.tar.gz emacs-ae6bc504c0f6676bc91420765e286b2bc4c1ed2c.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 17 | ||||
| -rw-r--r-- | lisp/calc/calc-aent.el | 21 | ||||
| -rw-r--r-- | lisp/calc/calc-ext.el | 2 | ||||
| -rw-r--r-- | lisp/calc/calc-lang.el | 24 | ||||
| -rw-r--r-- | lisp/calc/calc-store.el | 2 | ||||
| -rw-r--r-- | lisp/calc/calc-units.el | 22 | ||||
| -rw-r--r-- | lisp/calc/calc.el | 3 | ||||
| -rw-r--r-- | lisp/calc/calccomp.el | 8 |
8 files changed, 64 insertions, 35 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 047d0d640e6..aed1fbc64d0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2010-05-15 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc/calc-aent.el (math-read-token, math-find-user-tokens): | ||
| 4 | * calc/calc-lang.el (math-read-big-rec, math-lang-read-symbol): | ||
| 5 | (math-compose-tex-func): | ||
| 6 | * calc/calccomp.el (math-compose-expr): | ||
| 7 | * calc/calc-ext.el (math-format-flat-expr-fancy): | ||
| 8 | * calc/calc-store.el (calc-read-var-name): | ||
| 9 | * calc/calc-units.el (calc-explain-units-rec): Allow Greek letters. | ||
| 10 | |||
| 11 | * calc/calc.el (var-π, var-φ, var-γ): New variables. | ||
| 12 | * calc/calc-aent.el (math-read-replacement-list): Add "micro" symbol. | ||
| 13 | * calc/calc-units.el (math-unit-prefixes): Add mu for micro. | ||
| 14 | (math-standard-units): Add units. | ||
| 15 | |||
| 1 | 2010-05-15 Stefan Monnier <monnier@iro.umontreal.ca> | 16 | 2010-05-15 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 17 | ||
| 3 | * progmodes/asm-mode.el (asm-mode): | 18 | * progmodes/asm-mode.el (asm-mode): |
| @@ -14,7 +29,7 @@ | |||
| 14 | 29 | ||
| 15 | 2010-05-14 Jay Belanger <jay.p.belanger@gmail.com> | 30 | 2010-05-14 Jay Belanger <jay.p.belanger@gmail.com> |
| 16 | 31 | ||
| 17 | * calc-bin.el (math-format-twos-complement): Group digits when | 32 | * calc/calc-bin.el (math-format-twos-complement): Group digits when |
| 18 | appropriate. | 33 | appropriate. |
| 19 | 34 | ||
| 20 | 2010-05-14 Stefan Monnier <monnier@iro.umontreal.ca> | 35 | 2010-05-14 Stefan Monnier <monnier@iro.umontreal.ca> |
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 58e30a237f9..77a02b58c73 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.") | |||
| 510 | ("≥" ">=") | 510 | ("≥" ">=") |
| 511 | ("≦" "<=") | 511 | ("≦" "<=") |
| 512 | ("≧" ">=") | 512 | ("≧" ">=") |
| 513 | ("µ" "μ") | ||
| 513 | ;; fractions | 514 | ;; fractions |
| 514 | ("¼" "(1:4)") ; 1/4 | 515 | ("¼" "(1:4)") ; 1/4 |
| 515 | ("½" "(1:2)") ; 1/2 | 516 | ("½" "(1:2)") ; 1/2 |
| @@ -675,11 +676,11 @@ in Calc algebraic input.") | |||
| 675 | (cond ((and (stringp (car p)) | 676 | (cond ((and (stringp (car p)) |
| 676 | (or (> (length (car p)) 1) (equal (car p) "$") | 677 | (or (> (length (car p)) 1) (equal (car p) "$") |
| 677 | (equal (car p) "\"")) | 678 | (equal (car p) "\"")) |
| 678 | (string-match "[^a-zA-Z0-9]" (car p))) | 679 | (string-match "[^a-zA-Zα-ωΑ-Ω0-9]" (car p))) |
| 679 | (let ((s (regexp-quote (car p)))) | 680 | (let ((s (regexp-quote (car p)))) |
| 680 | (if (string-match "\\`[a-zA-Z0-9]" s) | 681 | (if (string-match "\\`[a-zA-Zα-ωΑ-Ω0-9]" s) |
| 681 | (setq s (concat "\\<" s))) | 682 | (setq s (concat "\\<" s))) |
| 682 | (if (string-match "[a-zA-Z0-9]\\'" s) | 683 | (if (string-match "[a-zA-Zα-ωΑ-Ω0-9]\\'" s) |
| 683 | (setq s (concat s "\\>"))) | 684 | (setq s (concat s "\\>"))) |
| 684 | (or (assoc s math-toks) | 685 | (or (assoc s math-toks) |
| 685 | (progn | 686 | (progn |
| @@ -718,15 +719,17 @@ in Calc algebraic input.") | |||
| 718 | math-expr-data (math-match-substring math-exp-str 0) | 719 | math-expr-data (math-match-substring math-exp-str 0) |
| 719 | math-exp-pos (match-end 0))) | 720 | math-exp-pos (match-end 0))) |
| 720 | ((or (and (>= ch ?a) (<= ch ?z)) | 721 | ((or (and (>= ch ?a) (<= ch ?z)) |
| 721 | (and (>= ch ?A) (<= ch ?Z))) | 722 | (and (>= ch ?A) (<= ch ?Z)) |
| 723 | (and (>= ch ?α) (<= ch ?ω)) | ||
| 724 | (and (>= ch ?Α) (<= ch ?Ω))) | ||
| 722 | (string-match | 725 | (string-match |
| 723 | (cond | 726 | (cond |
| 724 | ((and (memq calc-language calc-lang-allow-underscores) | 727 | ((and (memq calc-language calc-lang-allow-underscores) |
| 725 | (memq calc-language calc-lang-allow-percentsigns)) | 728 | (memq calc-language calc-lang-allow-percentsigns)) |
| 726 | "[a-zA-Z0-9_'#]*") | 729 | "[a-zA-Zα-ωΑ-Ω0-9_'#]*") |
| 727 | ((memq calc-language calc-lang-allow-underscores) | 730 | ((memq calc-language calc-lang-allow-underscores) |
| 728 | "[a-zA-Z0-9_#]*") | 731 | "[a-zA-Zα-ωΑ-Ω0-9_#]*") |
| 729 | (t "[a-zA-Z0-9'#]*")) | 732 | (t "[a-zA-Zα-ωΑ-Ω0-9'#]*")) |
| 730 | math-exp-str math-exp-pos) | 733 | math-exp-str math-exp-pos) |
| 731 | (setq math-exp-token 'symbol | 734 | (setq math-exp-token 'symbol |
| 732 | math-exp-pos (match-end 0) | 735 | math-exp-pos (match-end 0) |
| @@ -744,12 +747,12 @@ in Calc algebraic input.") | |||
| 744 | (or (eq math-exp-pos 0) | 747 | (or (eq math-exp-pos 0) |
| 745 | (and (not (memq calc-language | 748 | (and (not (memq calc-language |
| 746 | calc-lang-allow-underscores)) | 749 | calc-lang-allow-underscores)) |
| 747 | (eq (string-match "[^])}\"a-zA-Z0-9'$]_" | 750 | (eq (string-match "[^])}\"a-zA-Zα-ωΑ-Ω0-9'$]_" |
| 748 | math-exp-str (1- math-exp-pos)) | 751 | math-exp-str (1- math-exp-pos)) |
| 749 | (1- math-exp-pos)))))) | 752 | (1- math-exp-pos)))))) |
| 750 | (or (and (memq calc-language calc-lang-c-type-hex) | 753 | (or (and (memq calc-language calc-lang-c-type-hex) |
| 751 | (string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos)) | 754 | (string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos)) |
| 752 | (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]+\\)?\"?\\)?" | 755 | (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]+\\)?\"?\\)?" |
| 753 | math-exp-str math-exp-pos)) | 756 | math-exp-str math-exp-pos)) |
| 754 | (setq math-exp-token 'number | 757 | (setq math-exp-token 'number |
| 755 | math-expr-data (math-match-substring math-exp-str 0) | 758 | math-expr-data (math-match-substring math-exp-str 0) |
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index f6f8e3d03d9..c0b6a806372 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el | |||
| @@ -3283,7 +3283,7 @@ If X is not an error form, return 1." | |||
| 3283 | (concat "-" (math-format-flat-expr (nth 1 a) 1000))) | 3283 | (concat "-" (math-format-flat-expr (nth 1 a) 1000))) |
| 3284 | (t | 3284 | (t |
| 3285 | (concat (math-remove-dashes | 3285 | (concat (math-remove-dashes |
| 3286 | (if (string-match "\\`calcFunc-\\([a-zA-Z0-9']+\\)\\'" | 3286 | (if (string-match "\\`calcFunc-\\([a-zA-Zα-ωΑ-Ω0-9']+\\)\\'" |
| 3287 | (symbol-name (car a))) | 3287 | (symbol-name (car a))) |
| 3288 | (math-match-substring (symbol-name (car a)) 1) | 3288 | (math-match-substring (symbol-name (car a)) 1) |
| 3289 | (symbol-name (car a)))) | 3289 | (symbol-name (car a)))) |
diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index cd30232feee..0ebf1a18fef 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el | |||
| @@ -214,7 +214,7 @@ | |||
| 214 | (put 'pascal 'math-lang-read-symbol | 214 | (put 'pascal 'math-lang-read-symbol |
| 215 | '((?\$ | 215 | '((?\$ |
| 216 | (eq (string-match | 216 | (eq (string-match |
| 217 | "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Z]\\)" | 217 | "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Zα-ωΑ-Ω]\\)" |
| 218 | math-exp-str math-exp-pos) | 218 | math-exp-str math-exp-pos) |
| 219 | math-exp-pos) | 219 | math-exp-pos) |
| 220 | (setq math-exp-token 'number | 220 | (setq math-exp-token 'number |
| @@ -312,7 +312,7 @@ | |||
| 312 | 312 | ||
| 313 | (put 'fortran 'math-lang-read-symbol | 313 | (put 'fortran 'math-lang-read-symbol |
| 314 | '((?\. | 314 | '((?\. |
| 315 | (eq (string-match "\\.[a-zA-Z][a-zA-Z][a-zA-Z]?\\." | 315 | (eq (string-match "\\.[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω]?\\." |
| 316 | math-exp-str math-exp-pos) math-exp-pos) | 316 | math-exp-str math-exp-pos) math-exp-pos) |
| 317 | (setq math-exp-token 'punc | 317 | (setq math-exp-token 'punc |
| 318 | math-expr-data (upcase (math-match-substring math-exp-str 0)) | 318 | math-expr-data (upcase (math-match-substring math-exp-str 0)) |
| @@ -603,9 +603,9 @@ | |||
| 603 | '((?\\ | 603 | '((?\\ |
| 604 | (< math-exp-pos (1- (length math-exp-str))) | 604 | (< math-exp-pos (1- (length math-exp-str))) |
| 605 | (progn | 605 | (progn |
| 606 | (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}" | 606 | (or (string-match "\\\\hbox *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}" |
| 607 | math-exp-str math-exp-pos) | 607 | math-exp-str math-exp-pos) |
| 608 | (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)" | 608 | (string-match "\\(\\\\\\([a-zA-Zα-ωΑ-Ω]+\\|[^a-zA-Zα-ωΑ-Ω]\\)\\)" |
| 609 | math-exp-str math-exp-pos)) | 609 | math-exp-str math-exp-pos)) |
| 610 | (setq math-exp-token 'symbol | 610 | (setq math-exp-token 'symbol |
| 611 | math-exp-pos (match-end 0) | 611 | math-exp-pos (match-end 0) |
| @@ -691,7 +691,7 @@ | |||
| 691 | (defun math-compose-tex-var (a prec) | 691 | (defun math-compose-tex-var (a prec) |
| 692 | (if (and calc-language-option | 692 | (if (and calc-language-option |
| 693 | (not (= calc-language-option 0)) | 693 | (not (= calc-language-option 0)) |
| 694 | (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'" | 694 | (string-match "\\`[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω0-9]+\\'" |
| 695 | (symbol-name (nth 1 a)))) | 695 | (symbol-name (nth 1 a)))) |
| 696 | (if (eq calc-language 'latex) | 696 | (if (eq calc-language 'latex) |
| 697 | (format "\\text{%s}" (symbol-name (nth 1 a))) | 697 | (format "\\text{%s}" (symbol-name (nth 1 a))) |
| @@ -702,7 +702,7 @@ | |||
| 702 | (let (left right) | 702 | (let (left right) |
| 703 | (if (and calc-language-option | 703 | (if (and calc-language-option |
| 704 | (not (= calc-language-option 0)) | 704 | (not (= calc-language-option 0)) |
| 705 | (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'" func)) | 705 | (string-match "\\`[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω0-9]+\\'" func)) |
| 706 | (if (< (prefix-numeric-value calc-language-option) 0) | 706 | (if (< (prefix-numeric-value calc-language-option) 0) |
| 707 | (setq func (format "\\%s" func)) | 707 | (setq func (format "\\%s" func)) |
| 708 | (setq func (if (eq calc-language 'latex) | 708 | (setq func (if (eq calc-language 'latex) |
| @@ -824,11 +824,11 @@ | |||
| 824 | '((?\\ | 824 | '((?\\ |
| 825 | (< math-exp-pos (1- (length math-exp-str))) | 825 | (< math-exp-pos (1- (length math-exp-str))) |
| 826 | (progn | 826 | (progn |
| 827 | (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}" | 827 | (or (string-match "\\\\hbox *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}" |
| 828 | math-exp-str math-exp-pos) | 828 | math-exp-str math-exp-pos) |
| 829 | (string-match "\\\\text *{\\([a-zA-Z0-9]+\\)}" | 829 | (string-match "\\\\text *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}" |
| 830 | math-exp-str math-exp-pos) | 830 | math-exp-str math-exp-pos) |
| 831 | (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)" | 831 | (string-match "\\(\\\\\\([a-zA-Zα-ωΑ-Ω]+\\|[^a-zA-Zα-ωΑ-Ω]\\)\\)" |
| 832 | math-exp-str math-exp-pos)) | 832 | math-exp-str math-exp-pos)) |
| 833 | (setq math-exp-token 'symbol | 833 | (setq math-exp-token 'symbol |
| 834 | math-exp-pos (match-end 0) | 834 | math-exp-pos (match-end 0) |
| @@ -2301,9 +2301,11 @@ order to Calc's." | |||
| 2301 | 2301 | ||
| 2302 | ;; Variable name or function call. | 2302 | ;; Variable name or function call. |
| 2303 | ((or (and (>= other-char ?a) (<= other-char ?z)) | 2303 | ((or (and (>= other-char ?a) (<= other-char ?z)) |
| 2304 | (and (>= other-char ?A) (<= other-char ?Z))) | 2304 | (and (>= other-char ?A) (<= other-char ?Z)) |
| 2305 | (and (>= other-char ?α) (<= other-char ?ω)) | ||
| 2306 | (and (>= other-char ?Α) (<= other-char ?Ω))) | ||
| 2305 | (setq line (nth v math-read-big-lines)) | 2307 | (setq line (nth v math-read-big-lines)) |
| 2306 | (string-match "\\([a-zA-Z'_]+\\) *" line math-rb-h1) | 2308 | (string-match "\\([a-zA-Zα-ωΑ-Ω'_]+\\) *" line math-rb-h1) |
| 2307 | (setq h (match-end 1) | 2309 | (setq h (match-end 1) |
| 2308 | widest (match-end 0) | 2310 | widest (match-end 0) |
| 2309 | p (math-match-substring line 1)) | 2311 | p (math-match-substring line 1)) |
diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 5ec21eee887..8f73e71b0f9 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el | |||
| @@ -202,7 +202,7 @@ | |||
| 202 | 'calc-read-var-name-history))))) | 202 | 'calc-read-var-name-history))))) |
| 203 | (setq calc-aborted-prefix "") | 203 | (setq calc-aborted-prefix "") |
| 204 | (and (not (equal var "var-")) | 204 | (and (not (equal var "var-")) |
| 205 | (if (string-match "\\`\\([-a-zA-Z0-9]+\\) *:?=" var) | 205 | (if (string-match "\\`\\([-a-zA-Zα-ωΑ-Ω0-9]+\\) *:?=" var) |
| 206 | (if (null calc-given-value-flag) | 206 | (if (null calc-given-value-flag) |
| 207 | (error "Assignment is not allowed in this command") | 207 | (error "Assignment is not allowed in this command") |
| 208 | (let ((svar (intern (substring var 0 (match-end 1))))) | 208 | (let ((svar (intern (substring var 0 (match-end 1))))) |
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 6dd3e4911b7..6881db3fb12 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el | |||
| @@ -36,13 +36,13 @@ | |||
| 36 | 36 | ||
| 37 | ;;; Units table last updated 9-Jan-91 by Ulrich Mueller (ulm@vsnhd1.cern.ch) | 37 | ;;; Units table last updated 9-Jan-91 by Ulrich Mueller (ulm@vsnhd1.cern.ch) |
| 38 | ;;; with some additions by Przemek Klosowski (przemek@rrdstrad.nist.gov) | 38 | ;;; with some additions by Przemek Klosowski (przemek@rrdstrad.nist.gov) |
| 39 | ;;; Updated April 2002 by Jochen Küpper | 39 | ;;; Updated April 2002 by Jochen Küpper |
| 40 | 40 | ||
| 41 | ;;; Updated August 2007, using | 41 | ;;; Updated August 2007, using |
| 42 | ;;; CODATA (http://physics.nist.gov/cuu/Constants/index.html) | 42 | ;;; CODATA (http://physics.nist.gov/cuu/Constants/index.html) |
| 43 | ;;; NIST (http://physics.nist.gov/Pubs/SP811/appenB9.html) | 43 | ;;; NIST (http://physics.nist.gov/Pubs/SP811/appenB9.html) |
| 44 | ;;; ESUWM (Encyclopaedia of Scientific Units, Weights and | 44 | ;;; ESUWM (Encyclopaedia of Scientific Units, Weights and |
| 45 | ;;; Measures, by François Cardarelli) | 45 | ;;; Measures, by François Cardarelli) |
| 46 | ;;; All conversions are exact unless otherwise noted. | 46 | ;;; All conversions are exact unless otherwise noted. |
| 47 | 47 | ||
| 48 | (defvar math-standard-units | 48 | (defvar math-standard-units |
| @@ -210,6 +210,7 @@ | |||
| 210 | "1.602176487 10^-19 C (*)") ;;(approx) CODATA | 210 | "1.602176487 10^-19 C (*)") ;;(approx) CODATA |
| 211 | ( V "W/A" "Volt" ) | 211 | ( V "W/A" "Volt" ) |
| 212 | ( ohm "V/A" "Ohm" ) | 212 | ( ohm "V/A" "Ohm" ) |
| 213 | ( Ω "ohm" "Ohm" ) | ||
| 213 | ( mho "A/V" "Mho" ) | 214 | ( mho "A/V" "Mho" ) |
| 214 | ( S "A/V" "Siemens" ) | 215 | ( S "A/V" "Siemens" ) |
| 215 | ( F "C/V" "Farad" ) | 216 | ( F "C/V" "Farad" ) |
| @@ -259,7 +260,9 @@ | |||
| 259 | "6.62606896 10^-34 J s (*)") | 260 | "6.62606896 10^-34 J s (*)") |
| 260 | ( hbar "h / (2 pi)" "Planck's constant" ) ;; Exact | 261 | ( hbar "h / (2 pi)" "Planck's constant" ) ;; Exact |
| 261 | ( mu0 "4 pi 10^(-7) H/m" "Permeability of vacuum") ;; Exact | 262 | ( mu0 "4 pi 10^(-7) H/m" "Permeability of vacuum") ;; Exact |
| 263 | ( μ0 "mu0" "Permeability of vacuum") ;; Exact | ||
| 262 | ( eps0 "1 / (mu0 c^2)" "Permittivity of vacuum" ) | 264 | ( eps0 "1 / (mu0 c^2)" "Permittivity of vacuum" ) |
| 265 | ( ε0 "eps0" "Permittivity of vacuum" ) | ||
| 263 | ( G "6.67428*10^(-11) m^3/(kg s^2)" "Gravitational constant" nil | 266 | ( G "6.67428*10^(-11) m^3/(kg s^2)" "Gravitational constant" nil |
| 264 | "6.67428 10^-11 m^3/(kg s^2) (*)") | 267 | "6.67428 10^-11 m^3/(kg s^2) (*)") |
| 265 | ( Nav "6.02214179*10^(23) / mol" "Avogadro's constant" nil | 268 | ( Nav "6.02214179*10^(23) / mol" "Avogadro's constant" nil |
| @@ -272,12 +275,16 @@ | |||
| 272 | "1.674927211 10^-27 kg (*)") | 275 | "1.674927211 10^-27 kg (*)") |
| 273 | ( mmu "1.88353130*10^(-28) kg" "Muon rest mass" nil | 276 | ( mmu "1.88353130*10^(-28) kg" "Muon rest mass" nil |
| 274 | "1.88353130 10^-28 kg (*)") | 277 | "1.88353130 10^-28 kg (*)") |
| 278 | ( mμ "mmu" "Muon rest mass" nil | ||
| 279 | "1.88353130 10^-28 kg (*)") | ||
| 275 | ( Ryd "10973731.568527 /m" "Rydberg's constant" nil | 280 | ( Ryd "10973731.568527 /m" "Rydberg's constant" nil |
| 276 | "10973731.568527 /m (*)") | 281 | "10973731.568527 /m (*)") |
| 277 | ( k "1.3806504*10^(-23) J/K" "Boltzmann's constant" nil | 282 | ( k "1.3806504*10^(-23) J/K" "Boltzmann's constant" nil |
| 278 | "1.3806504 10^-23 J/K (*)") | 283 | "1.3806504 10^-23 J/K (*)") |
| 279 | ( alpha "7.2973525376*10^(-3)" "Fine structure constant" nil | 284 | ( alpha "7.2973525376*10^(-3)" "Fine structure constant" nil |
| 280 | "7.2973525376 10^-3 (*)") | 285 | "7.2973525376 10^-3 (*)") |
| 286 | ( α "alpha" "Fine structure constant" nil | ||
| 287 | "7.2973525376 10^-3 (*)") | ||
| 281 | ( muB "927.400915*10^(-26) J/T" "Bohr magneton" nil | 288 | ( muB "927.400915*10^(-26) J/T" "Bohr magneton" nil |
| 282 | "927.400915 10^-26 J/T (*)") | 289 | "927.400915 10^-26 J/T (*)") |
| 283 | ( muN "5.05078324*10^(-27) J/T" "Nuclear magneton" nil | 290 | ( muN "5.05078324*10^(-27) J/T" "Nuclear magneton" nil |
| @@ -316,6 +323,7 @@ that the combined units table will be rebuilt.") | |||
| 316 | ( ?c (^ 10 -2) "Centi" ) | 323 | ( ?c (^ 10 -2) "Centi" ) |
| 317 | ( ?m (^ 10 -3) "Milli" ) | 324 | ( ?m (^ 10 -3) "Milli" ) |
| 318 | ( ?u (^ 10 -6) "Micro" ) | 325 | ( ?u (^ 10 -6) "Micro" ) |
| 326 | ( ?μ (^ 10 -6) "Micro" ) | ||
| 319 | ( ?n (^ 10 -9) "Nano" ) | 327 | ( ?n (^ 10 -9) "Nano" ) |
| 320 | ( ?p (^ 10 -12) "Pico" ) | 328 | ( ?p (^ 10 -12) "Pico" ) |
| 321 | ( ?f (^ 10 -15) "Femto" ) | 329 | ( ?f (^ 10 -15) "Femto" ) |
| @@ -581,8 +589,8 @@ If EXPR is nil, return nil." | |||
| 581 | (let ((name (or (nth 2 u) (symbol-name (car u))))) | 589 | (let ((name (or (nth 2 u) (symbol-name (car u))))) |
| 582 | (if (eq (aref name 0) ?\*) | 590 | (if (eq (aref name 0) ?\*) |
| 583 | (setq name (substring name 1))) | 591 | (setq name (substring name 1))) |
| 584 | (if (string-match "[^a-zA-Z0-9']" name) | 592 | (if (string-match "[^a-zA-Zα-ωΑ-Ω0-9']" name) |
| 585 | (if (string-match "^[a-zA-Z0-9' ()]*$" name) | 593 | (if (string-match "^[a-zA-Zα-ωΑ-Ω0-9' ()]*$" name) |
| 586 | (while (setq pos (string-match "[ ()]" name)) | 594 | (while (setq pos (string-match "[ ()]" name)) |
| 587 | (setq name (concat (substring name 0 pos) | 595 | (setq name (concat (substring name 0 pos) |
| 588 | (if (eq (aref name pos) 32) "-" "") | 596 | (if (eq (aref name pos) 32) "-" "") |
| @@ -592,7 +600,7 @@ If EXPR is nil, return nil." | |||
| 592 | (setq name (concat (nth 2 (assq (aref (symbol-name | 600 | (setq name (concat (nth 2 (assq (aref (symbol-name |
| 593 | (nth 1 expr)) 0) | 601 | (nth 1 expr)) 0) |
| 594 | math-unit-prefixes)) | 602 | math-unit-prefixes)) |
| 595 | (if (and (string-match "[^a-zA-Z0-9']" name) | 603 | (if (and (string-match "[^a-zA-Zα-ωΑ-Ω0-9']" name) |
| 596 | (not (memq (car u) '(mHg gf)))) | 604 | (not (memq (car u) '(mHg gf)))) |
| 597 | (concat "-" name) | 605 | (concat "-" name) |
| 598 | (downcase name))))) | 606 | (downcase name))))) |
| @@ -1540,9 +1548,5 @@ If EXPR is nil, return nil." | |||
| 1540 | 1548 | ||
| 1541 | (provide 'calc-units) | 1549 | (provide 'calc-units) |
| 1542 | 1550 | ||
| 1543 | ;; Local Variables: | ||
| 1544 | ;; coding: iso-latin-1 | ||
| 1545 | ;; End: | ||
| 1546 | |||
| 1547 | ;; arch-tag: e993314f-3adc-4191-be61-4ef8874881c4 | 1551 | ;; arch-tag: e993314f-3adc-4191-be61-4ef8874881c4 |
| 1548 | ;;; calc-units.el ends here | 1552 | ;;; calc-units.el ends here |
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 07fa4414dda..73a865cab1a 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -999,9 +999,12 @@ Used by `calc-user-invocation'.") | |||
| 999 | (defvar math-working-step-2 nil) | 999 | (defvar math-working-step-2 nil) |
| 1000 | (defvar var-i '(special-const (math-imaginary 1))) | 1000 | (defvar var-i '(special-const (math-imaginary 1))) |
| 1001 | (defvar var-pi '(special-const (math-pi))) | 1001 | (defvar var-pi '(special-const (math-pi))) |
| 1002 | (defvar var-Ï€ '(special-const (math-pi))) | ||
| 1002 | (defvar var-e '(special-const (math-e))) | 1003 | (defvar var-e '(special-const (math-e))) |
| 1003 | (defvar var-phi '(special-const (math-phi))) | 1004 | (defvar var-phi '(special-const (math-phi))) |
| 1005 | (defvar var-φ '(special-const (math-phi))) | ||
| 1004 | (defvar var-gamma '(special-const (math-gamma-const))) | 1006 | (defvar var-gamma '(special-const (math-gamma-const))) |
| 1007 | (defvar var-γ '(special-const (math-gamma-const))) | ||
| 1005 | (defvar var-Modes '(special-const (math-get-modes-vec))) | 1008 | (defvar var-Modes '(special-const (math-get-modes-vec))) |
| 1006 | 1009 | ||
| 1007 | (mapc (lambda (v) (or (boundp v) (set v nil))) | 1010 | (mapc (lambda (v) (or (boundp v) (set v nil))) |
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index c7d3469abe0..c8efded9270 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el | |||
| @@ -663,6 +663,8 @@ | |||
| 663 | (and prevc nextc | 663 | (and prevc nextc |
| 664 | (or (and (>= nextc ?a) (<= nextc ?z)) | 664 | (or (and (>= nextc ?a) (<= nextc ?z)) |
| 665 | (and (>= nextc ?A) (<= nextc ?Z)) | 665 | (and (>= nextc ?A) (<= nextc ?Z)) |
| 666 | (and (>= nextc ?α) (<= nextc ?ω)) | ||
| 667 | (and (>= nextc ?Α) (<= nextc ?Ω)) | ||
| 666 | (and (>= nextc ?0) (<= nextc ?9)) | 668 | (and (>= nextc ?0) (<= nextc ?9)) |
| 667 | (memq nextc '(?. ?_ ?# | 669 | (memq nextc '(?. ?_ ?# |
| 668 | ?\( ?\[ ?\{)) | 670 | ?\( ?\[ ?\{)) |
| @@ -732,7 +734,7 @@ | |||
| 732 | (not (math-tex-expr-is-flat (nth 1 a)))))) | 734 | (not (math-tex-expr-is-flat (nth 1 a)))))) |
| 733 | (list 'horiz | 735 | (list 'horiz |
| 734 | (if lr "\\left" "") | 736 | (if lr "\\left" "") |
| 735 | (if (string-match "\\`u\\([^a-zA-Z]\\)\\'" (car op)) | 737 | (if (string-match "\\`u\\([^a-zA-Zα-ωΑ-Ω]\\)\\'" (car op)) |
| 736 | (substring (car op) 1) | 738 | (substring (car op) 1) |
| 737 | (car op)) | 739 | (car op)) |
| 738 | (if (or lr (> (length (car op)) 2)) " " "") | 740 | (if (or lr (> (length (car op)) 2)) " " "") |
| @@ -758,7 +760,7 @@ | |||
| 758 | (t | 760 | (t |
| 759 | (let ((rhs (math-compose-expr (nth 1 a) (nth 3 op)))) | 761 | (let ((rhs (math-compose-expr (nth 1 a) (nth 3 op)))) |
| 760 | (list 'horiz | 762 | (list 'horiz |
| 761 | (let ((ops (if (string-match "\\`u\\([^a-zA-Z]\\)\\'" | 763 | (let ((ops (if (string-match "\\`u\\([^a-zA-Zα-ωΑ-Ω]\\)\\'" |
| 762 | (car op)) | 764 | (car op)) |
| 763 | (substring (car op) 1) | 765 | (substring (car op) 1) |
| 764 | (car op)))) | 766 | (car op)))) |
| @@ -806,7 +808,7 @@ | |||
| 806 | (setq func (car func2))) | 808 | (setq func (car func2))) |
| 807 | (setq func (math-remove-dashes | 809 | (setq func (math-remove-dashes |
| 808 | (if (string-match | 810 | (if (string-match |
| 809 | "\\`calcFunc-\\([a-zA-Z0-9']+\\)\\'" | 811 | "\\`calcFunc-\\([a-zA-Zα-ωΑ-Ω0-9']+\\)\\'" |
| 810 | (symbol-name func)) | 812 | (symbol-name func)) |
| 811 | (math-match-substring (symbol-name func) 1) | 813 | (math-match-substring (symbol-name func) 1) |
| 812 | (symbol-name func)))) | 814 | (symbol-name func)))) |