656 |
|
|
657 |
|
|
658 |
;; Verify that Calc is running on the right kind of system. |
;; Verify that Calc is running on the right kind of system. |
|
(defconst calc-emacs-type-epoch (and (fboundp 'epoch::version) epoch::version)) |
|
|
(defvar calc-emacs-type-19 (not (or calc-emacs-type-epoch |
|
|
(string-lessp emacs-version "19")))) |
|
659 |
(defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version)))) |
(defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version)))) |
|
(defvar calc-emacs-type-gnu19 (and calc-emacs-type-19 |
|
|
(not calc-emacs-type-lucid))) |
|
660 |
|
|
661 |
;; Set up the standard keystroke (M-#) to run the Calculator, if that key |
;; Set up the standard keystroke (M-#) to run the Calculator, if that key |
662 |
;; has not yet been bound to anything. For best results, the user should |
;; has not yet been bound to anything. For best results, the user should |
822 |
(if (eq bind 'undefined) |
(if (eq bind 'undefined) |
823 |
'undefined 'calcDigit-nondigit)))) |
'undefined 'calcDigit-nondigit)))) |
824 |
calc-mode-map) |
calc-mode-map) |
825 |
(let ((cmap (if calc-emacs-type-19 (nth 1 calc-mode-map) calc-mode-map)) |
(let ((cmap (nth 1 calc-mode-map)) |
826 |
(dmap (if calc-emacs-type-19 (nth 1 map) map)) |
(dmap (nth 1 map)) |
827 |
(i 0)) |
(i 0)) |
828 |
(while (< i 128) |
(while (< i 128) |
829 |
(aset dmap i |
(aset dmap i |
993 |
(use-global-map map) |
(use-global-map map) |
994 |
(use-local-map nil) |
(use-local-map nil) |
995 |
(read-key-sequence |
(read-key-sequence |
996 |
(if (commandp (key-binding (if calc-emacs-type-19 |
(if (commandp (key-binding (vector (cdr key)))) |
|
(vector (cdr key)) |
|
|
(char-to-string (cdr key))))) |
|
997 |
"" prompt2))) |
"" prompt2))) |
998 |
(use-global-map glob) |
(use-global-map glob) |
999 |
(use-local-map loc))))) |
(use-local-map loc))))) |
3418 |
(let ((key (event-to-character event t t))) |
(let ((key (event-to-character event t t))) |
3419 |
(or key optkey (error "Expected a plain keystroke")) |
(or key optkey (error "Expected a plain keystroke")) |
3420 |
(cons key event)))) |
(cons key event)))) |
|
(calc-emacs-type-gnu19 |
|
|
(let ((key (read-event))) |
|
|
(cons key key))) |
|
3421 |
(t |
(t |
3422 |
(let ((key (read-char))) |
(let ((key (read-event))) |
3423 |
(cons key key))))) |
(cons key key))))) |
3424 |
|
|
3425 |
(defun calc-unread-command (&optional input) |
(defun calc-unread-command (&optional input) |