aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/calc
diff options
context:
space:
mode:
authorJay Belanger2004-10-19 14:21:31 +0000
committerJay Belanger2004-10-19 14:21:31 +0000
commit4ebcaf0ef8d8501cb412ac4bab2c1ff4d689a5a3 (patch)
tree24ad8b78a67d191c647b0e3636f52176591b8453 /lisp/calc
parent8a41a04743578b39a0eba3e39b925a043c520bff (diff)
downloademacs-4ebcaf0ef8d8501cb412ac4bab2c1ff4d689a5a3.tar.gz
emacs-4ebcaf0ef8d8501cb412ac4bab2c1ff4d689a5a3.zip
(calc-init-extensions): Define `calc-alg-map' and `calc-alg-esc-map'
for current Emacs.
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calc-ext.el22
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 47c02bc285c..120a68c5e78 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -640,29 +640,27 @@
640 (define-key calc-mode-map (format "u%c" x) 'calc-quick-units))) 640 (define-key calc-mode-map (format "u%c" x) 'calc-quick-units)))
641 "0123456789") 641 "0123456789")
642 642
643 (or calc-emacs-type-19 (progn
644 (let ((i ?A)) 643 (let ((i ?A))
645 (while (and (<= i ?z) (vectorp calc-mode-map)) 644 (while (<= i ?z)
646 (if (eq (car-safe (aref calc-mode-map i)) 'keymap) 645 (if (eq (car-safe (aref (nth 1 calc-mode-map) i)) 'keymap)
647 (aset calc-mode-map i 646 (aset (nth 1 calc-mode-map) i
648 (cons 'keymap (cons (cons ?\e (aref calc-mode-map i)) 647 (cons 'keymap (cons (cons ?\e (aref (nth 1 calc-mode-map) i))
649 (cdr (aref calc-mode-map i)))))) 648 (cdr (aref (nth 1 calc-mode-map) i))))))
650 (setq i (1+ i)))) 649 (setq i (1+ i))))
651 650
652 (setq calc-alg-map (copy-sequence calc-mode-map) 651 (setq calc-alg-map (copy-keymap calc-mode-map)
653 calc-alg-esc-map (copy-sequence esc-map)) 652 calc-alg-esc-map (copy-keymap esc-map))
654 (let ((i 32)) 653 (let ((i 32))
655 (while (< i 127) 654 (while (< i 127)
656 (or (memq i '(?' ?` ?= ??)) 655 (or (memq i '(?' ?` ?= ??))
657 (aset calc-alg-map i 'calc-auto-algebraic-entry)) 656 (aset (nth 1 calc-alg-map) i 'calc-auto-algebraic-entry))
658 (or (memq i '(?# ?x ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)) 657 (or (memq i '(?# ?x ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9))
659 (aset calc-alg-esc-map i (aref calc-mode-map i))) 658 (aset (nth 1 calc-alg-esc-map) i (aref (nth 1 calc-mode-map) i)))
660 (setq i (1+ i)))) 659 (setq i (1+ i))))
661 (define-key calc-alg-map "\e" calc-alg-esc-map) 660 (define-key calc-alg-map "\e" calc-alg-esc-map)
662 (define-key calc-alg-map "\e\t" 'calc-roll-up) 661 (define-key calc-alg-map "\e\t" 'calc-roll-up)
663 (define-key calc-alg-map "\e\C-m" 'calc-last-args-stub) 662 (define-key calc-alg-map "\e\C-m" 'calc-last-args-stub)
664 (define-key calc-alg-map "\e\177" 'calc-pop-above) 663 (define-key calc-alg-map "\e\177" 'calc-pop-above)
665 ))
666 664
667 ;; The following is a relic for backward compatability only. 665 ;; The following is a relic for backward compatability only.
668 ;; The calc-define property list is now the recommended method. 666 ;; The calc-define property list is now the recommended method.