diff options
| author | Glenn Morris | 2009-01-09 03:57:12 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-01-09 03:57:12 +0000 |
| commit | e93c003eb15f85f744a39c28a8fb43b8c6da9904 (patch) | |
| tree | 3a9d6acabbc4bd35bdb1b1680eb16e12b4761651 /lisp | |
| parent | 4b09796d423bb241d597f147ce0d53567ce10b3f (diff) | |
| download | emacs-e93c003eb15f85f744a39c28a8fb43b8c6da9904.tar.gz emacs-e93c003eb15f85f744a39c28a8fb43b8c6da9904.zip | |
Replace last-command-char with last-command-event.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/calc/calc-aent.el | 16 | ||||
| -rw-r--r-- | lisp/calc/calc-ext.el | 22 | ||||
| -rw-r--r-- | lisp/calc/calc-incom.el | 2 | ||||
| -rw-r--r-- | lisp/calc/calc-keypd.el | 2 | ||||
| -rw-r--r-- | lisp/calc/calc-misc.el | 6 | ||||
| -rw-r--r-- | lisp/calc/calc-prog.el | 2 | ||||
| -rw-r--r-- | lisp/calc/calc-sel.el | 2 | ||||
| -rw-r--r-- | lisp/calc/calc-store.el | 6 | ||||
| -rw-r--r-- | lisp/calc/calc-stuff.el | 6 | ||||
| -rw-r--r-- | lisp/calc/calc-units.el | 2 | ||||
| -rw-r--r-- | lisp/calc/calc-yank.el | 4 | ||||
| -rw-r--r-- | lisp/calc/calc.el | 52 |
13 files changed, 67 insertions, 61 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db149e7d739..8bf962d368f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -3,6 +3,12 @@ | |||
| 3 | * subr.el (last-input-char, last-command-char): | 3 | * subr.el (last-input-char, last-command-char): |
| 4 | Move here from src/keyboard.c. | 4 | Move here from src/keyboard.c. |
| 5 | 5 | ||
| 6 | * calc/calc-aent.el, calc/calc-ext.el, calc/calc-incom.el: | ||
| 7 | * calc/calc-keypd.el, calc/calc-misc.el, calc/calc-prog.el: | ||
| 8 | * calc/calc-sel.el, calc/calc-store.el, calc/calc-stuff.el: | ||
| 9 | * calc/calc-units.el, calc/calc-yank.el, calc/calc.el: | ||
| 10 | Replace last-command-char with last-command-event. | ||
| 11 | |||
| 6 | 2009-01-09 Dave Love <fx@gnu.org> | 12 | 2009-01-09 Dave Love <fx@gnu.org> |
| 7 | 13 | ||
| 8 | * calendar/time-date.el: Require cl for `declare'. | 14 | * calendar/time-date.el: Require cl for `declare'. |
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index bccc873e47e..22afd43a34e 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el | |||
| @@ -109,7 +109,7 @@ | |||
| 109 | (setq buf long)))) | 109 | (setq buf long)))) |
| 110 | (calc-handle-whys) | 110 | (calc-handle-whys) |
| 111 | (message "Result: %s" buf))) | 111 | (message "Result: %s" buf))) |
| 112 | (if (eq last-command-char 10) | 112 | (if (eq last-command-event 10) |
| 113 | (insert shortbuf) | 113 | (insert shortbuf) |
| 114 | (kill-new shortbuf))))) | 114 | (kill-new shortbuf))))) |
| 115 | 115 | ||
| @@ -279,7 +279,7 @@ The value t means abort and give an error message.") | |||
| 279 | (calc-wrapper | 279 | (calc-wrapper |
| 280 | (let ((calc-language (if prefix nil calc-language)) | 280 | (let ((calc-language (if prefix nil calc-language)) |
| 281 | (math-expr-opers (if prefix (math-standard-ops) (math-expr-ops)))) | 281 | (math-expr-opers (if prefix (math-standard-ops) (math-expr-ops)))) |
| 282 | (calc-alg-entry (and auto (char-to-string last-command-char)))))) | 282 | (calc-alg-entry (and auto (char-to-string last-command-event)))))) |
| 283 | 283 | ||
| 284 | (defvar calc-alg-entry-history nil | 284 | (defvar calc-alg-entry-history nil |
| 285 | "History for algebraic entry.") | 285 | "History for algebraic entry.") |
| @@ -296,7 +296,7 @@ The value t means abort and give an error message.") | |||
| 296 | (progn | 296 | (progn |
| 297 | (require 'calc-ext) | 297 | (require 'calc-ext) |
| 298 | (calc-alg-edit alg-exp)) | 298 | (calc-alg-edit alg-exp)) |
| 299 | (let* ((calc-simplify-mode (if (eq last-command-char ?\C-j) | 299 | (let* ((calc-simplify-mode (if (eq last-command-event ?\C-j) |
| 300 | 'none | 300 | 'none |
| 301 | calc-simplify-mode)) | 301 | calc-simplify-mode)) |
| 302 | (nvals (mapcar 'calc-normalize alg-exp))) | 302 | (nvals (mapcar 'calc-normalize alg-exp))) |
| @@ -468,12 +468,12 @@ The value t means abort and give an error message.") | |||
| 468 | ;;;###autoload | 468 | ;;;###autoload |
| 469 | (defun calc-alg-digit-entry () | 469 | (defun calc-alg-digit-entry () |
| 470 | (calc-alg-entry | 470 | (calc-alg-entry |
| 471 | (cond ((eq last-command-char ?e) | 471 | (cond ((eq last-command-event ?e) |
| 472 | (if (> calc-number-radix 14) (format "%d.^" calc-number-radix) "1e")) | 472 | (if (> calc-number-radix 14) (format "%d.^" calc-number-radix) "1e")) |
| 473 | ((eq last-command-char ?#) (format "%d#" calc-number-radix)) | 473 | ((eq last-command-event ?#) (format "%d#" calc-number-radix)) |
| 474 | ((eq last-command-char ?_) "-") | 474 | ((eq last-command-event ?_) "-") |
| 475 | ((eq last-command-char ?@) "0@ ") | 475 | ((eq last-command-event ?@) "0@ ") |
| 476 | (t (char-to-string last-command-char))))) | 476 | (t (char-to-string last-command-event))))) |
| 477 | 477 | ||
| 478 | ;; The variable calc-digit-value is initially declared in calc.el, | 478 | ;; The variable calc-digit-value is initially declared in calc.el, |
| 479 | ;; but can be set by calcDigit-algebraic and calcDigit-edit. | 479 | ;; but can be set by calcDigit-algebraic and calcDigit-edit. |
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 6294d7680e5..d97cd7971ea 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el | |||
| @@ -1446,26 +1446,26 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 1446 | (if (boundp 'overriding-terminal-local-map) | 1446 | (if (boundp 'overriding-terminal-local-map) |
| 1447 | (setq overriding-terminal-local-map calc-fancy-prefix-map) | 1447 | (setq overriding-terminal-local-map calc-fancy-prefix-map) |
| 1448 | (let ((event (calc-read-key t))) | 1448 | (let ((event (calc-read-key t))) |
| 1449 | (if (eq (setq last-command-char (car event)) ?\C-u) | 1449 | (if (eq (setq last-command-event (car event)) ?\C-u) |
| 1450 | (universal-argument) | 1450 | (universal-argument) |
| 1451 | (if (or (not (integerp last-command-char)) | 1451 | (if (or (not (integerp last-command-event)) |
| 1452 | (and (>= last-command-char 0) (< last-command-char ? ) | 1452 | (and (>= last-command-event 0) (< last-command-event ? ) |
| 1453 | (not (memq last-command-char '(?\e))))) | 1453 | (not (memq last-command-event '(?\e))))) |
| 1454 | (calc-wrapper)) ; clear flags if not a Calc command. | 1454 | (calc-wrapper)) ; clear flags if not a Calc command. |
| 1455 | (setq last-command-event (cdr event)) | 1455 | (setq last-command-event (cdr event)) |
| 1456 | (if (or (not (integerp last-command-char)) | 1456 | (if (or (not (integerp last-command-event)) |
| 1457 | (eq last-command-char ?-)) | 1457 | (eq last-command-event ?-)) |
| 1458 | (calc-unread-command) | 1458 | (calc-unread-command) |
| 1459 | (digit-argument n)))))))) | 1459 | (digit-argument n)))))))) |
| 1460 | 1460 | ||
| 1461 | (defun calc-fancy-prefix-other-key (arg) | 1461 | (defun calc-fancy-prefix-other-key (arg) |
| 1462 | (interactive "P") | 1462 | (interactive "P") |
| 1463 | (if (and | 1463 | (if (and |
| 1464 | (not (eq last-command-char 'tab)) | 1464 | (not (eq last-command-event 'tab)) |
| 1465 | (not (eq last-command-char 'M-tab)) | 1465 | (not (eq last-command-event 'M-tab)) |
| 1466 | (or (not (integerp last-command-char)) | 1466 | (or (not (integerp last-command-event)) |
| 1467 | (and (>= last-command-char 0) (< last-command-char ? ) | 1467 | (and (>= last-command-event 0) (< last-command-event ? ) |
| 1468 | (not (eq last-command-char meta-prefix-char))))) | 1468 | (not (eq last-command-event meta-prefix-char))))) |
| 1469 | (calc-wrapper)) ; clear flags if not a Calc command. | 1469 | (calc-wrapper)) ; clear flags if not a Calc command. |
| 1470 | (setq prefix-arg arg) | 1470 | (setq prefix-arg arg) |
| 1471 | (calc-unread-command) | 1471 | (calc-unread-command) |
diff --git a/lisp/calc/calc-incom.el b/lisp/calc/calc-incom.el index 7d426f7331e..06fada40e5a 100644 --- a/lisp/calc/calc-incom.el +++ b/lisp/calc/calc-incom.el | |||
| @@ -180,7 +180,7 @@ | |||
| 180 | (if (calc-minibuffer-contains ".*\\.\\'") | 180 | (if (calc-minibuffer-contains ".*\\.\\'") |
| 181 | (delete-backward-char 1)) | 181 | (delete-backward-char 1)) |
| 182 | (setq calc-prev-char 'dots | 182 | (setq calc-prev-char 'dots |
| 183 | last-command-char 32) | 183 | last-command-event 32) |
| 184 | (if calc-prev-prev-char | 184 | (if calc-prev-prev-char |
| 185 | (calcDigit-nondigit) | 185 | (calcDigit-nondigit) |
| 186 | (setq calc-digit-value nil) | 186 | (setq calc-digit-value nil) |
diff --git a/lisp/calc/calc-keypd.el b/lisp/calc/calc-keypd.el index a9407941ee0..56d6b507f0d 100644 --- a/lisp/calc/calc-keypd.el +++ b/lisp/calc/calc-keypd.el | |||
| @@ -608,7 +608,7 @@ | |||
| 608 | negative-argument)) | 608 | negative-argument)) |
| 609 | (and prefix (string-match "\\`\e?[-0-9]\\'" keys))) | 609 | (and prefix (string-match "\\`\e?[-0-9]\\'" keys))) |
| 610 | (progn | 610 | (progn |
| 611 | (setq last-command-char (aref keys (1- (length keys)))) | 611 | (setq last-command-event (aref keys (1- (length keys)))) |
| 612 | (command-execute cmd) | 612 | (command-execute cmd) |
| 613 | (setq flush 'not-any-more | 613 | (setq flush 'not-any-more |
| 614 | prefix t | 614 | prefix t |
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index b64f20d4748..7637a9e3260 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el | |||
| @@ -472,8 +472,8 @@ When this key is used, calc-ext (the Calculator extensions module) will be | |||
| 472 | loaded and the keystroke automatically re-typed." | 472 | loaded and the keystroke automatically re-typed." |
| 473 | (interactive "P") | 473 | (interactive "P") |
| 474 | (require 'calc-ext) | 474 | (require 'calc-ext) |
| 475 | (if (keymapp (key-binding (char-to-string last-command-char))) | 475 | (if (keymapp (key-binding (char-to-string last-command-event))) |
| 476 | (message "%s%c-" (calc-num-prefix-name n) last-command-char)) | 476 | (message "%s%c-" (calc-num-prefix-name n) last-command-event)) |
| 477 | (calc-unread-command) | 477 | (calc-unread-command) |
| 478 | (setq prefix-arg n)) | 478 | (setq prefix-arg n)) |
| 479 | 479 | ||
| @@ -491,7 +491,7 @@ loaded and the keystroke automatically re-typed." | |||
| 491 | (interactive) | 491 | (interactive) |
| 492 | (if (calc-minibuffer-contains "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*") | 492 | (if (calc-minibuffer-contains "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*") |
| 493 | (progn | 493 | (progn |
| 494 | (setq last-command-char (upcase last-command-char)) | 494 | (setq last-command-event (upcase last-command-event)) |
| 495 | (calcDigit-key)) | 495 | (calcDigit-key)) |
| 496 | (calcDigit-nondigit))) | 496 | (calcDigit-nondigit))) |
| 497 | 497 | ||
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 52626ce1daf..6de8613e13b 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el | |||
| @@ -1285,7 +1285,7 @@ Redefine the corresponding command." | |||
| 1285 | (let* ((count 0) | 1285 | (let* ((count 0) |
| 1286 | (parts nil) | 1286 | (parts nil) |
| 1287 | (body "") | 1287 | (body "") |
| 1288 | (open last-command-char) | 1288 | (open last-command-event) |
| 1289 | (counter initial) | 1289 | (counter initial) |
| 1290 | ch) | 1290 | ch) |
| 1291 | (or executing-kbd-macro | 1291 | (or executing-kbd-macro |
diff --git a/lisp/calc/calc-sel.el b/lisp/calc/calc-sel.el index 5a3e4333471..179d1e1abfe 100644 --- a/lisp/calc/calc-sel.el +++ b/lisp/calc/calc-sel.el | |||
| @@ -132,7 +132,7 @@ | |||
| 132 | 132 | ||
| 133 | (defun calc-select-part (num) | 133 | (defun calc-select-part (num) |
| 134 | (interactive "P") | 134 | (interactive "P") |
| 135 | (or num (setq num (- last-command-char ?0))) | 135 | (or num (setq num (- last-command-event ?0))) |
| 136 | (calc-wrapper | 136 | (calc-wrapper |
| 137 | (calc-prepare-selection) | 137 | (calc-prepare-selection) |
| 138 | (let ((sel (calc-find-nth-part (or (nth 2 calc-selection-cache-entry) | 138 | (let ((sel (calc-find-nth-part (or (nth 2 calc-selection-cache-entry) |
diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index dcd5fb68348..32ba169f658 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el | |||
| @@ -381,15 +381,15 @@ | |||
| 381 | 381 | ||
| 382 | (defun calc-store-quick () | 382 | (defun calc-store-quick () |
| 383 | (interactive) | 383 | (interactive) |
| 384 | (calc-store (intern (format "var-q%c" last-command-char)))) | 384 | (calc-store (intern (format "var-q%c" last-command-event)))) |
| 385 | 385 | ||
| 386 | (defun calc-store-into-quick () | 386 | (defun calc-store-into-quick () |
| 387 | (interactive) | 387 | (interactive) |
| 388 | (calc-store-into (intern (format "var-q%c" last-command-char)))) | 388 | (calc-store-into (intern (format "var-q%c" last-command-event)))) |
| 389 | 389 | ||
| 390 | (defun calc-recall-quick () | 390 | (defun calc-recall-quick () |
| 391 | (interactive) | 391 | (interactive) |
| 392 | (calc-recall (intern (format "var-q%c" last-command-char)))) | 392 | (calc-recall (intern (format "var-q%c" last-command-event)))) |
| 393 | 393 | ||
| 394 | (defun calc-copy-special-constant (&optional sconst var) | 394 | (defun calc-copy-special-constant (&optional sconst var) |
| 395 | (interactive) | 395 | (interactive) |
diff --git a/lisp/calc/calc-stuff.el b/lisp/calc/calc-stuff.el index fc2ba7884a5..e6f68fd7be2 100644 --- a/lisp/calc/calc-stuff.el +++ b/lisp/calc/calc-stuff.el | |||
| @@ -210,9 +210,9 @@ With a prefix, push that prefix as a number onto the stack." | |||
| 210 | (interactive "P") | 210 | (interactive "P") |
| 211 | (calc-clean (- (if num | 211 | (calc-clean (- (if num |
| 212 | (prefix-numeric-value num) | 212 | (prefix-numeric-value num) |
| 213 | (if (and (>= last-command-char ?0) | 213 | (if (and (>= last-command-event ?0) |
| 214 | (<= last-command-char ?9)) | 214 | (<= last-command-event ?9)) |
| 215 | (- last-command-char ?0) | 215 | (- last-command-event ?0) |
| 216 | (error "Number required")))))) | 216 | (error "Number required")))))) |
| 217 | 217 | ||
| 218 | 218 | ||
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 1366d57adf3..5d16f84694a 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el | |||
| @@ -349,7 +349,7 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") | |||
| 349 | (defun calc-quick-units () | 349 | (defun calc-quick-units () |
| 350 | (interactive) | 350 | (interactive) |
| 351 | (calc-slow-wrapper | 351 | (calc-slow-wrapper |
| 352 | (let* ((num (- last-command-char ?0)) | 352 | (let* ((num (- last-command-event ?0)) |
| 353 | (pos (if (= num 0) 10 num)) | 353 | (pos (if (= num 0) 10 num)) |
| 354 | (units (calc-var-value 'var-Units)) | 354 | (units (calc-var-value 'var-Units)) |
| 355 | (expr (calc-top-n 1))) | 355 | (expr (calc-top-n 1))) |
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 7618e271c9b..208372a31fd 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el | |||
| @@ -489,7 +489,7 @@ With prefix arg, also delete the region." | |||
| 489 | (insert str)) | 489 | (insert str)) |
| 490 | (let ((i 0)) | 490 | (let ((i 0)) |
| 491 | (while (< i (length str)) | 491 | (while (< i (length str)) |
| 492 | (if (= (setq last-command-char (aref str i)) ?\n) | 492 | (if (= (setq last-command-event (aref str i)) ?\n) |
| 493 | (or (= i (1- (length str))) | 493 | (or (= i (1- (length str))) |
| 494 | (let ((pt (point))) | 494 | (let ((pt (point))) |
| 495 | (end-of-line) | 495 | (end-of-line) |
| @@ -702,7 +702,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer." | |||
| 702 | (if calc-edit-disp-trail | 702 | (if calc-edit-disp-trail |
| 703 | (calc-trail-display 1 t)) | 703 | (calc-trail-display 1 t)) |
| 704 | (and vals | 704 | (and vals |
| 705 | (let ((calc-simplify-mode (if (eq last-command-char ?\C-j) | 705 | (let ((calc-simplify-mode (if (eq last-command-event ?\C-j) |
| 706 | 'none | 706 | 'none |
| 707 | calc-simplify-mode))) | 707 | calc-simplify-mode))) |
| 708 | (if (>= num 0) | 708 | (if (>= num 0) |
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 7a169dd75f1..0d372ce1959 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -2147,7 +2147,7 @@ See calc-keypad for details." | |||
| 2147 | (interactive) | 2147 | (interactive) |
| 2148 | (calc-wrapper | 2148 | (calc-wrapper |
| 2149 | (if (or calc-algebraic-mode | 2149 | (if (or calc-algebraic-mode |
| 2150 | (and (> calc-number-radix 14) (eq last-command-char ?e))) | 2150 | (and (> calc-number-radix 14) (eq last-command-event ?e))) |
| 2151 | (calc-alg-digit-entry) | 2151 | (calc-alg-digit-entry) |
| 2152 | (calc-unread-command) | 2152 | (calc-unread-command) |
| 2153 | (setq calc-aborted-prefix nil) | 2153 | (setq calc-aborted-prefix nil) |
| @@ -2196,9 +2196,9 @@ See calc-keypad for details." | |||
| 2196 | (progn | 2196 | (progn |
| 2197 | (beep) | 2197 | (beep) |
| 2198 | (calc-temp-minibuffer-message " [Bad format]")) | 2198 | (calc-temp-minibuffer-message " [Bad format]")) |
| 2199 | (or (memq last-command-char '(32 13)) | 2199 | (or (memq last-command-event '(32 13)) |
| 2200 | (progn (setq prefix-arg current-prefix-arg) | 2200 | (progn (setq prefix-arg current-prefix-arg) |
| 2201 | (calc-unread-command (if (and (eq last-command-char 27) | 2201 | (calc-unread-command (if (and (eq last-command-event 27) |
| 2202 | (>= last-input-char 128)) | 2202 | (>= last-input-char 128)) |
| 2203 | last-input-char | 2203 | last-input-char |
| 2204 | nil)))) | 2204 | nil)))) |
| @@ -2213,38 +2213,38 @@ See calc-keypad for details." | |||
| 2213 | (defun calcDigit-key () | 2213 | (defun calcDigit-key () |
| 2214 | (interactive) | 2214 | (interactive) |
| 2215 | (goto-char (point-max)) | 2215 | (goto-char (point-max)) |
| 2216 | (if (or (and (memq last-command-char '(?+ ?-)) | 2216 | (if (or (and (memq last-command-event '(?+ ?-)) |
| 2217 | (> (buffer-size) 0) | 2217 | (> (buffer-size) 0) |
| 2218 | (/= (preceding-char) ?e)) | 2218 | (/= (preceding-char) ?e)) |
| 2219 | (and (memq last-command-char '(?m ?s)) | 2219 | (and (memq last-command-event '(?m ?s)) |
| 2220 | (not (calc-minibuffer-contains "[-+]?[0-9]+\\.?0*[@oh].*")) | 2220 | (not (calc-minibuffer-contains "[-+]?[0-9]+\\.?0*[@oh].*")) |
| 2221 | (not (calc-minibuffer-contains "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*")))) | 2221 | (not (calc-minibuffer-contains "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*")))) |
| 2222 | (calcDigit-nondigit) | 2222 | (calcDigit-nondigit) |
| 2223 | (if (calc-minibuffer-contains "\\([-+]?\\|.* \\)\\'") | 2223 | (if (calc-minibuffer-contains "\\([-+]?\\|.* \\)\\'") |
| 2224 | (cond ((memq last-command-char '(?. ?@)) (insert "0")) | 2224 | (cond ((memq last-command-event '(?. ?@)) (insert "0")) |
| 2225 | ((and (memq last-command-char '(?o ?h ?m)) | 2225 | ((and (memq last-command-event '(?o ?h ?m)) |
| 2226 | (not (calc-minibuffer-contains ".*#.*"))) (insert "0")) | 2226 | (not (calc-minibuffer-contains ".*#.*"))) (insert "0")) |
| 2227 | ((memq last-command-char '(?: ?e)) (insert "1")) | 2227 | ((memq last-command-event '(?: ?e)) (insert "1")) |
| 2228 | ((eq last-command-char ?#) | 2228 | ((eq last-command-event ?#) |
| 2229 | (insert (int-to-string calc-number-radix))))) | 2229 | (insert (int-to-string calc-number-radix))))) |
| 2230 | (if (and (calc-minibuffer-contains "\\([-+]?[0-9]+#\\|[^:]*:\\)\\'") | 2230 | (if (and (calc-minibuffer-contains "\\([-+]?[0-9]+#\\|[^:]*:\\)\\'") |
| 2231 | (eq last-command-char ?:)) | 2231 | (eq last-command-event ?:)) |
| 2232 | (insert "1")) | 2232 | (insert "1")) |
| 2233 | (if (and (calc-minibuffer-contains "[-+]?[0-9]+#\\'") | 2233 | (if (and (calc-minibuffer-contains "[-+]?[0-9]+#\\'") |
| 2234 | (eq last-command-char ?.)) | 2234 | (eq last-command-event ?.)) |
| 2235 | (insert "0")) | 2235 | (insert "0")) |
| 2236 | (if (and (calc-minibuffer-contains "[-+]?0*\\([2-9]\\|1[0-4]\\)#\\'") | 2236 | (if (and (calc-minibuffer-contains "[-+]?0*\\([2-9]\\|1[0-4]\\)#\\'") |
| 2237 | (eq last-command-char ?e)) | 2237 | (eq last-command-event ?e)) |
| 2238 | (insert "1")) | 2238 | (insert "1")) |
| 2239 | (if (or (and (memq last-command-char '(?h ?o ?m ?s ?p)) | 2239 | (if (or (and (memq last-command-event '(?h ?o ?m ?s ?p)) |
| 2240 | (calc-minibuffer-contains ".*#.*")) | 2240 | (calc-minibuffer-contains ".*#.*")) |
| 2241 | (and (eq last-command-char ?e) | 2241 | (and (eq last-command-event ?e) |
| 2242 | (calc-minibuffer-contains "[-+]?\\(1[5-9]\\|[2-9][0-9]\\)#.*")) | 2242 | (calc-minibuffer-contains "[-+]?\\(1[5-9]\\|[2-9][0-9]\\)#.*")) |
| 2243 | (and (eq last-command-char ?n) | 2243 | (and (eq last-command-event ?n) |
| 2244 | (calc-minibuffer-contains "[-+]?\\(2[4-9]\\|[3-9][0-9]\\)#.*"))) | 2244 | (calc-minibuffer-contains "[-+]?\\(2[4-9]\\|[3-9][0-9]\\)#.*"))) |
| 2245 | (setq last-command-char (upcase last-command-char))) | 2245 | (setq last-command-event (upcase last-command-event))) |
| 2246 | (cond | 2246 | (cond |
| 2247 | ((memq last-command-char '(?_ ?n)) | 2247 | ((memq last-command-event '(?_ ?n)) |
| 2248 | (goto-char (minibuffer-prompt-end)) | 2248 | (goto-char (minibuffer-prompt-end)) |
| 2249 | (if (and (search-forward " +/- " nil t) | 2249 | (if (and (search-forward " +/- " nil t) |
| 2250 | (not (search-forward "e" nil t))) | 2250 | (not (search-forward "e" nil t))) |
| @@ -2257,7 +2257,7 @@ See calc-keypad for details." | |||
| 2257 | (delete-char 1) | 2257 | (delete-char 1) |
| 2258 | (insert "-"))) | 2258 | (insert "-"))) |
| 2259 | (goto-char (point-max))) | 2259 | (goto-char (point-max))) |
| 2260 | ((eq last-command-char ?p) | 2260 | ((eq last-command-event ?p) |
| 2261 | (if (or (calc-minibuffer-contains ".*\\+/-.*") | 2261 | (if (or (calc-minibuffer-contains ".*\\+/-.*") |
| 2262 | (calc-minibuffer-contains ".*mod.*") | 2262 | (calc-minibuffer-contains ".*mod.*") |
| 2263 | (calc-minibuffer-contains ".*#.*") | 2263 | (calc-minibuffer-contains ".*#.*") |
| @@ -2266,7 +2266,7 @@ See calc-keypad for details." | |||
| 2266 | (if (not (calc-minibuffer-contains ".* \\'")) | 2266 | (if (not (calc-minibuffer-contains ".* \\'")) |
| 2267 | (insert " ")) | 2267 | (insert " ")) |
| 2268 | (insert "+/- "))) | 2268 | (insert "+/- "))) |
| 2269 | ((and (eq last-command-char ?M) | 2269 | ((and (eq last-command-event ?M) |
| 2270 | (not (calc-minibuffer-contains | 2270 | (not (calc-minibuffer-contains |
| 2271 | "[-+]?\\(2[3-9]\\|[3-9][0-9]\\)#.*"))) | 2271 | "[-+]?\\(2[3-9]\\|[3-9][0-9]\\)#.*"))) |
| 2272 | (if (or (calc-minibuffer-contains ".*\\+/-.*") | 2272 | (if (or (calc-minibuffer-contains ".*\\+/-.*") |
| @@ -2281,25 +2281,25 @@ See calc-keypad for details." | |||
| 2281 | (insert " ")) | 2281 | (insert " ")) |
| 2282 | (insert "mod ")))) | 2282 | (insert "mod ")))) |
| 2283 | (t | 2283 | (t |
| 2284 | (insert (char-to-string last-command-char)) | 2284 | (insert (char-to-string last-command-event)) |
| 2285 | (if (or (and (calc-minibuffer-contains "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9][0-9]?\\)#[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\)?\\|.[0-9a-zA-Z]*\\(e[-+]?[0-9]*\\)?\\)?\\'") | 2285 | (if (or (and (calc-minibuffer-contains "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9][0-9]?\\)#[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\)?\\|.[0-9a-zA-Z]*\\(e[-+]?[0-9]*\\)?\\)?\\'") |
| 2286 | (let ((radix (string-to-number | 2286 | (let ((radix (string-to-number |
| 2287 | (buffer-substring | 2287 | (buffer-substring |
| 2288 | (match-beginning 2) (match-end 2))))) | 2288 | (match-beginning 2) (match-end 2))))) |
| 2289 | (and (>= radix 2) | 2289 | (and (>= radix 2) |
| 2290 | (<= radix 36) | 2290 | (<= radix 36) |
| 2291 | (or (memq last-command-char '(?# ?: ?. ?e ?+ ?-)) | 2291 | (or (memq last-command-event '(?# ?: ?. ?e ?+ ?-)) |
| 2292 | (let ((dig (math-read-radix-digit | 2292 | (let ((dig (math-read-radix-digit |
| 2293 | (upcase last-command-char)))) | 2293 | (upcase last-command-event)))) |
| 2294 | (and dig | 2294 | (and dig |
| 2295 | (< dig radix))))))) | 2295 | (< dig radix))))))) |
| 2296 | (calc-minibuffer-contains | 2296 | (calc-minibuffer-contains |
| 2297 | "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9]+\\.?0*[@oh] *\\)?\\([0-9]+\\.?0*['m] *\\)?[0-9]*\\(\\.?[0-9]*\\(e[-+]?[0-3]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?\\)?\\|[0-9]:\\([0-9]+:\\)?[0-9]*\\)?[\"s]?\\'")) | 2297 | "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9]+\\.?0*[@oh] *\\)?\\([0-9]+\\.?0*['m] *\\)?[0-9]*\\(\\.?[0-9]*\\(e[-+]?[0-3]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?\\)?\\|[0-9]:\\([0-9]+:\\)?[0-9]*\\)?[\"s]?\\'")) |
| 2298 | (if (and (memq last-command-char '(?@ ?o ?h ?\' ?m)) | 2298 | (if (and (memq last-command-event '(?@ ?o ?h ?\' ?m)) |
| 2299 | (string-match " " calc-hms-format)) | 2299 | (string-match " " calc-hms-format)) |
| 2300 | (insert " ")) | 2300 | (insert " ")) |
| 2301 | (if (and (eq this-command last-command) | 2301 | (if (and (eq this-command last-command) |
| 2302 | (eq last-command-char ?.)) | 2302 | (eq last-command-event ?.)) |
| 2303 | (progn | 2303 | (progn |
| 2304 | (require 'calc-ext) | 2304 | (require 'calc-ext) |
| 2305 | (calc-digit-dots)) | 2305 | (calc-digit-dots)) |
| @@ -2307,7 +2307,7 @@ See calc-keypad for details." | |||
| 2307 | (beep) | 2307 | (beep) |
| 2308 | (calc-temp-minibuffer-message " [Bad format]")))))) | 2308 | (calc-temp-minibuffer-message " [Bad format]")))))) |
| 2309 | (setq calc-prev-prev-char calc-prev-char | 2309 | (setq calc-prev-prev-char calc-prev-char |
| 2310 | calc-prev-char last-command-char)) | 2310 | calc-prev-char last-command-event)) |
| 2311 | 2311 | ||
| 2312 | 2312 | ||
| 2313 | (defun calcDigit-backspace () | 2313 | (defun calcDigit-backspace () |
| @@ -2324,7 +2324,7 @@ See calc-keypad for details." | |||
| 2324 | (t (backward-delete-char 1))) | 2324 | (t (backward-delete-char 1))) |
| 2325 | (if (= (calc-minibuffer-size) 0) | 2325 | (if (= (calc-minibuffer-size) 0) |
| 2326 | (progn | 2326 | (progn |
| 2327 | (setq last-command-char 13) | 2327 | (setq last-command-event 13) |
| 2328 | (calcDigit-nondigit)))) | 2328 | (calcDigit-nondigit)))) |
| 2329 | 2329 | ||
| 2330 | 2330 | ||