(not calc-is-keypad-press)
(if (boundp 'overriding-terminal-local-map)
(setq overriding-terminal-local-map calc-fancy-prefix-map)
- (let ((event (calc-read-key t)))
- (if (eq (setq last-command-event (car event)) ?\C-u)
+ (let ((event (read-event)))
+ (if (eq (setq last-command-event event) ?\C-u)
(universal-argument)
(if (or (not (integerp last-command-event))
(and (>= last-command-event 0) (< last-command-event ? )
(not (memq last-command-event '(?\e)))))
(calc-wrapper)) ; clear flags if not a Calc command.
- (setq last-command-event (cdr event))
+ (setq last-command-event event)
(if (or (not (integerp last-command-event))
(eq last-command-event ?-))
(calc-unread-command)
;;; User menu.
(defun calc-user-key-map ()
- (if (featurep 'xemacs)
- (error "User-defined keys are not supported in XEmacs"))
(let ((res (cdr (lookup-key calc-mode-map "z"))))
(if (eq (car (car res)) 27)
(cdr res)
(select-window (get-buffer-window "*Help*"))
(while (progn
(message "Calc Help options: Help, Info, ... press SPC, DEL to scroll, C-g to cancel")
- (memq (car (setq key (calc-read-key t)))
+ (memq (setq key (read-event))
'(? ?\C-h ?\C-? ?\C-v ?\M-v)))
(condition-case err
- (if (memq (car key) '(? ?\C-v))
+ (if (memq key '(? ?\C-v))
(scroll-up)
(scroll-down))
(error (beep)))))
- (calc-unread-command (cdr key))
+ (calc-unread-command key)
(calc-help-prefix nil))
(let ((calc-dispatch-help t))
(calc-help-prefix arg))))
msg
(if (equal notes "") ""
(format " (?=notes %s)" notes)))
- (let ((key (calc-read-key t)))
- (if (eq (car key) ??)
+ (let ((key (read-event)))
+ (if (eq key ??)
(if (equal notes "")
(message "No notes for this command")
(while (string-match "," notes)
(princ (buffer-substring pt (point))))
(setq notes (cdr notes)))
(help-print-return-message)))
- (calc-unread-command (cdr key)))))
+ (calc-unread-command key))))
(if (or (null defn) (integerp defn))
(message "%s is undefined" desc)
(message "%s runs the command %s"
(while (progn
(message "Calc options: Calc, Keypad, ... %s"
"press SPC, DEL to scroll, C-g to cancel")
- (memq (car (setq key (calc-read-key t)))
+ (memq (setq key (read-event))
'(? ?\C-h ?\C-? ?\C-v ?\M-v)))
(condition-case err
- (if (memq (car key) '(? ?\C-v))
+ (if (memq key '(? ?\C-v))
(scroll-up)
(scroll-down))
(error (beep))))
- (calc-unread-command (cdr key))))))
+ (calc-unread-command key)))))
(calc-do-dispatch nil))
(let ((calc-dispatch-help t))
(calc-do-dispatch arg))))
(ignore-errors
(define-key calc-digit-map x 'calcDigit-backspace)
(define-key calc-mode-map x 'calc-pop)
- (define-key calc-mode-map
- (if (and (vectorp x) (featurep 'xemacs))
- (if (= (length x) 1)
- (vector (if (consp (aref x 0))
- (cons 'meta (aref x 0))
- (list 'meta (aref x 0))))
- "\e\C-d")
- (vconcat "\e" x))
- 'calc-pop-above)))
+ (define-key calc-mode-map (vconcat "\e" x) 'calc-pop-above)))
(if calc-scan-for-dels
(append (where-is-internal 'delete-backward-char global-map)
(where-is-internal 'backward-delete-char global-map)
(let ((glob (current-global-map))
(loc (current-local-map)))
(or (input-pending-p) (message "%s" prompt))
- (let ((key (calc-read-key t))
+ (let ((key (read-event))
(input-method-function nil))
- (calc-unread-command (cdr key))
+ (calc-unread-command key)
(unwind-protect
(progn
(use-global-map map)
(calc-prev-char nil)
(calc-prev-prev-char nil)
(calc-buffer (current-buffer))
- (buf (if (featurep 'xemacs)
- (catch 'calc-foo
- (catch 'execute-kbd-macro
- (throw 'calc-foo
- (read-from-minibuffer
- "Calc: " "" calc-digit-map)))
- (error "XEmacs requires RET after %s"
- "digit entry in kbd macro"))
- (let ((old-esc (lookup-key global-map "\e")))
- (unwind-protect
- (progn
- (define-key global-map "\e" nil)
- (read-from-minibuffer
- "Calc: " (calc-digit-start-entry) calc-digit-map))
- (define-key global-map "\e" old-esc))))))
+ (buf
+ (let ((old-esc (lookup-key global-map "\e")))
+ (unwind-protect
+ (progn
+ (define-key global-map "\e" nil)
+ (read-from-minibuffer
+ "Calc: " (calc-digit-start-entry) calc-digit-map))
+ (define-key global-map "\e" old-esc)))))
(or calc-digit-value (setq calc-digit-value (math-read-number buf)))
(if (stringp calc-digit-value)
(calc-alg-entry calc-digit-value)
(require 'calc-ext)
(math-do-defmath func args body))
-;;; Functions needed for Lucid Emacs support.
-
-(defun calc-read-key (&optional optkey)
- (cond ((featurep 'xemacs)
- (let ((event (next-command-event)))
- (let ((key (event-to-character event t t)))
- (or key optkey (error "Expected a plain keystroke"))
- (cons key event))))
- (t
- (let ((key (read-event)))
- (cons key key)))))
+(defun calc-read-key (&optional _optkey)
+ (declare (obsolete read-event "27.1"))
+ (let ((key (read-event)))
+ (cons key key)))
(defun calc-unread-command (&optional input)
- (if (featurep 'xemacs)
- (setq unread-command-event
- (if (integerp input) (character-to-event input)
- (or input last-command-event)))
- (push (or input last-command-event) unread-command-events)))
+ (push (or input last-command-event) unread-command-events))
(defun calc-clear-unread-commands ()
- (if (featurep 'xemacs)
- (setq unread-command-event nil)
- (setq unread-command-events nil)))
+ (setq unread-command-events nil))
(defcalcmodevar math-2-word-size
(math-read-number-simple "4294967296")