aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-06-19 22:56:26 +0200
committerLars Ingebrigtsen2019-06-19 22:56:26 +0200
commit8e9ff8b115bda364f30654589160fb702a511e9c (patch)
tree0b86e2b2609fa064e43ae892dbe9dbb5fffa4131
parenta97ba6eb305c9db8641c0e65748907cd53dbfa5e (diff)
downloademacs-8e9ff8b115bda364f30654589160fb702a511e9c.tar.gz
emacs-8e9ff8b115bda364f30654589160fb702a511e9c.zip
Remove XEmacs compat code from calc
* lisp/calc/calc.el (calc-read-key-sequence) (calcDigit-start, calc-read-key, calc-unread-command) (calc-clear-unread-commands): * lisp/calc/calc-misc.el (calc-dispatch-help): * lisp/calc/calc-help.el (calc-help-for-help) (calc-describe-key): * lisp/calc/calc-ext.el (calc-fancy-prefix, calc-user-key-map): Remove XEmacs compat code.
-rw-r--r--lisp/calc/calc-ext.el8
-rw-r--r--lisp/calc/calc-help.el12
-rw-r--r--lisp/calc/calc-misc.el6
-rw-r--r--lisp/calc/calc.el62
4 files changed, 29 insertions, 59 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 1456fb28570..4cc6b224226 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1487,14 +1487,14 @@ calc-kill calc-kill-region calc-yank))))
1487 (not calc-is-keypad-press) 1487 (not calc-is-keypad-press)
1488 (if (boundp 'overriding-terminal-local-map) 1488 (if (boundp 'overriding-terminal-local-map)
1489 (setq overriding-terminal-local-map calc-fancy-prefix-map) 1489 (setq overriding-terminal-local-map calc-fancy-prefix-map)
1490 (let ((event (calc-read-key t))) 1490 (let ((event (read-event)))
1491 (if (eq (setq last-command-event (car event)) ?\C-u) 1491 (if (eq (setq last-command-event event) ?\C-u)
1492 (universal-argument) 1492 (universal-argument)
1493 (if (or (not (integerp last-command-event)) 1493 (if (or (not (integerp last-command-event))
1494 (and (>= last-command-event 0) (< last-command-event ? ) 1494 (and (>= last-command-event 0) (< last-command-event ? )
1495 (not (memq last-command-event '(?\e))))) 1495 (not (memq last-command-event '(?\e)))))
1496 (calc-wrapper)) ; clear flags if not a Calc command. 1496 (calc-wrapper)) ; clear flags if not a Calc command.
1497 (setq last-command-event (cdr event)) 1497 (setq last-command-event event)
1498 (if (or (not (integerp last-command-event)) 1498 (if (or (not (integerp last-command-event))
1499 (eq last-command-event ?-)) 1499 (eq last-command-event ?-))
1500 (calc-unread-command) 1500 (calc-unread-command)
@@ -1915,8 +1915,6 @@ calc-kill calc-kill-region calc-yank))))
1915;;; User menu. 1915;;; User menu.
1916 1916
1917(defun calc-user-key-map () 1917(defun calc-user-key-map ()
1918 (if (featurep 'xemacs)
1919 (error "User-defined keys are not supported in XEmacs"))
1920 (let ((res (cdr (lookup-key calc-mode-map "z")))) 1918 (let ((res (cdr (lookup-key calc-mode-map "z"))))
1921 (if (eq (car (car res)) 27) 1919 (if (eq (car (car res)) 27)
1922 (cdr res) 1920 (cdr res)
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index d9e8fe779bf..3b8bfda4a02 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -77,14 +77,14 @@ C-w Describe how there is no warranty for Calc."
77 (select-window (get-buffer-window "*Help*")) 77 (select-window (get-buffer-window "*Help*"))
78 (while (progn 78 (while (progn
79 (message "Calc Help options: Help, Info, ... press SPC, DEL to scroll, C-g to cancel") 79 (message "Calc Help options: Help, Info, ... press SPC, DEL to scroll, C-g to cancel")
80 (memq (car (setq key (calc-read-key t))) 80 (memq (setq key (read-event))
81 '(? ?\C-h ?\C-? ?\C-v ?\M-v))) 81 '(? ?\C-h ?\C-? ?\C-v ?\M-v)))
82 (condition-case err 82 (condition-case err
83 (if (memq (car key) '(? ?\C-v)) 83 (if (memq key '(? ?\C-v))
84 (scroll-up) 84 (scroll-up)
85 (scroll-down)) 85 (scroll-down))
86 (error (beep))))) 86 (error (beep)))))
87 (calc-unread-command (cdr key)) 87 (calc-unread-command key)
88 (calc-help-prefix nil)) 88 (calc-help-prefix nil))
89 (let ((calc-dispatch-help t)) 89 (let ((calc-dispatch-help t))
90 (calc-help-prefix arg)))) 90 (calc-help-prefix arg))))
@@ -255,8 +255,8 @@ C-w Describe how there is no warranty for Calc."
255 msg 255 msg
256 (if (equal notes "") "" 256 (if (equal notes "") ""
257 (format " (?=notes %s)" notes))) 257 (format " (?=notes %s)" notes)))
258 (let ((key (calc-read-key t))) 258 (let ((key (read-event)))
259 (if (eq (car key) ??) 259 (if (eq key ??)
260 (if (equal notes "") 260 (if (equal notes "")
261 (message "No notes for this command") 261 (message "No notes for this command")
262 (while (string-match "," notes) 262 (while (string-match "," notes)
@@ -280,7 +280,7 @@ C-w Describe how there is no warranty for Calc."
280 (princ (buffer-substring pt (point)))) 280 (princ (buffer-substring pt (point))))
281 (setq notes (cdr notes))) 281 (setq notes (cdr notes)))
282 (help-print-return-message))) 282 (help-print-return-message)))
283 (calc-unread-command (cdr key))))) 283 (calc-unread-command key))))
284 (if (or (null defn) (integerp defn)) 284 (if (or (null defn) (integerp defn))
285 (message "%s is undefined" desc) 285 (message "%s is undefined" desc)
286 (message "%s runs the command %s" 286 (message "%s runs the command %s"
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el
index aedb68726a5..5fd8d07da57 100644
--- a/lisp/calc/calc-misc.el
+++ b/lisp/calc/calc-misc.el
@@ -116,14 +116,14 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
116 (while (progn 116 (while (progn
117 (message "Calc options: Calc, Keypad, ... %s" 117 (message "Calc options: Calc, Keypad, ... %s"
118 "press SPC, DEL to scroll, C-g to cancel") 118 "press SPC, DEL to scroll, C-g to cancel")
119 (memq (car (setq key (calc-read-key t))) 119 (memq (setq key (read-event))
120 '(? ?\C-h ?\C-? ?\C-v ?\M-v))) 120 '(? ?\C-h ?\C-? ?\C-v ?\M-v)))
121 (condition-case err 121 (condition-case err
122 (if (memq (car key) '(? ?\C-v)) 122 (if (memq key '(? ?\C-v))
123 (scroll-up) 123 (scroll-up)
124 (scroll-down)) 124 (scroll-down))
125 (error (beep)))) 125 (error (beep))))
126 (calc-unread-command (cdr key)))))) 126 (calc-unread-command key)))))
127 (calc-do-dispatch nil)) 127 (calc-do-dispatch nil))
128 (let ((calc-dispatch-help t)) 128 (let ((calc-dispatch-help t))
129 (calc-do-dispatch arg)))) 129 (calc-do-dispatch arg))))
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 1496a741abd..2136a099eed 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1113,15 +1113,7 @@ Used by `calc-user-invocation'.")
1113 (ignore-errors 1113 (ignore-errors
1114 (define-key calc-digit-map x 'calcDigit-backspace) 1114 (define-key calc-digit-map x 'calcDigit-backspace)
1115 (define-key calc-mode-map x 'calc-pop) 1115 (define-key calc-mode-map x 'calc-pop)
1116 (define-key calc-mode-map 1116 (define-key calc-mode-map (vconcat "\e" x) 'calc-pop-above)))
1117 (if (and (vectorp x) (featurep 'xemacs))
1118 (if (= (length x) 1)
1119 (vector (if (consp (aref x 0))
1120 (cons 'meta (aref x 0))
1121 (list 'meta (aref x 0))))
1122 "\e\C-d")
1123 (vconcat "\e" x))
1124 'calc-pop-above)))
1125 (if calc-scan-for-dels 1117 (if calc-scan-for-dels
1126 (append (where-is-internal 'delete-backward-char global-map) 1118 (append (where-is-internal 'delete-backward-char global-map)
1127 (where-is-internal 'backward-delete-char global-map) 1119 (where-is-internal 'backward-delete-char global-map)
@@ -1230,9 +1222,9 @@ Used by `calc-user-invocation'.")
1230 (let ((glob (current-global-map)) 1222 (let ((glob (current-global-map))
1231 (loc (current-local-map))) 1223 (loc (current-local-map)))
1232 (or (input-pending-p) (message "%s" prompt)) 1224 (or (input-pending-p) (message "%s" prompt))
1233 (let ((key (calc-read-key t)) 1225 (let ((key (read-event))
1234 (input-method-function nil)) 1226 (input-method-function nil))
1235 (calc-unread-command (cdr key)) 1227 (calc-unread-command key)
1236 (unwind-protect 1228 (unwind-protect
1237 (progn 1229 (progn
1238 (use-global-map map) 1230 (use-global-map map)
@@ -2333,21 +2325,14 @@ the United States."
2333 (calc-prev-char nil) 2325 (calc-prev-char nil)
2334 (calc-prev-prev-char nil) 2326 (calc-prev-prev-char nil)
2335 (calc-buffer (current-buffer)) 2327 (calc-buffer (current-buffer))
2336 (buf (if (featurep 'xemacs) 2328 (buf
2337 (catch 'calc-foo 2329 (let ((old-esc (lookup-key global-map "\e")))
2338 (catch 'execute-kbd-macro 2330 (unwind-protect
2339 (throw 'calc-foo 2331 (progn
2340 (read-from-minibuffer 2332 (define-key global-map "\e" nil)
2341 "Calc: " "" calc-digit-map))) 2333 (read-from-minibuffer
2342 (error "XEmacs requires RET after %s" 2334 "Calc: " (calc-digit-start-entry) calc-digit-map))
2343 "digit entry in kbd macro")) 2335 (define-key global-map "\e" old-esc)))))
2344 (let ((old-esc (lookup-key global-map "\e")))
2345 (unwind-protect
2346 (progn
2347 (define-key global-map "\e" nil)
2348 (read-from-minibuffer
2349 "Calc: " (calc-digit-start-entry) calc-digit-map))
2350 (define-key global-map "\e" old-esc))))))
2351 (or calc-digit-value (setq calc-digit-value (math-read-number buf))) 2336 (or calc-digit-value (setq calc-digit-value (math-read-number buf)))
2352 (if (stringp calc-digit-value) 2337 (if (stringp calc-digit-value)
2353 (calc-alg-entry calc-digit-value) 2338 (calc-alg-entry calc-digit-value)
@@ -3883,29 +3868,16 @@ See Info node `(calc)Defining Functions'."
3883 (require 'calc-ext) 3868 (require 'calc-ext)
3884 (math-do-defmath func args body)) 3869 (math-do-defmath func args body))
3885 3870
3886;;; Functions needed for Lucid Emacs support. 3871(defun calc-read-key (&optional _optkey)
3887 3872 (declare (obsolete read-event "27.1"))
3888(defun calc-read-key (&optional optkey) 3873 (let ((key (read-event)))
3889 (cond ((featurep 'xemacs) 3874 (cons key key)))
3890 (let ((event (next-command-event)))
3891 (let ((key (event-to-character event t t)))
3892 (or key optkey (error "Expected a plain keystroke"))
3893 (cons key event))))
3894 (t
3895 (let ((key (read-event)))
3896 (cons key key)))))
3897 3875
3898(defun calc-unread-command (&optional input) 3876(defun calc-unread-command (&optional input)
3899 (if (featurep 'xemacs) 3877 (push (or input last-command-event) unread-command-events))
3900 (setq unread-command-event
3901 (if (integerp input) (character-to-event input)
3902 (or input last-command-event)))
3903 (push (or input last-command-event) unread-command-events)))
3904 3878
3905(defun calc-clear-unread-commands () 3879(defun calc-clear-unread-commands ()
3906 (if (featurep 'xemacs) 3880 (setq unread-command-events nil))
3907 (setq unread-command-event nil)
3908 (setq unread-command-events nil)))
3909 3881
3910(defcalcmodevar math-2-word-size 3882(defcalcmodevar math-2-word-size
3911 (math-read-number-simple "4294967296") 3883 (math-read-number-simple "4294967296")