changeset 101001:14b421290b2f

Replace last-command-char with last-command-event.
author Glenn Morris <rgm@gnu.org>
date Fri, 09 Jan 2009 03:57:12 +0000
parents ee5456efd63c
children 3b3c7e10cd97
files lisp/ChangeLog lisp/calc/calc-aent.el lisp/calc/calc-ext.el lisp/calc/calc-incom.el lisp/calc/calc-keypd.el lisp/calc/calc-misc.el lisp/calc/calc-prog.el lisp/calc/calc-sel.el lisp/calc/calc-store.el lisp/calc/calc-stuff.el lisp/calc/calc-units.el lisp/calc/calc-yank.el lisp/calc/calc.el
diffstat 13 files changed, 67 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/ChangeLog	Fri Jan 09 03:57:12 2009 +0000
@@ -3,6 +3,12 @@
 	* subr.el (last-input-char, last-command-char):
 	Move here from src/keyboard.c.
 
+	* calc/calc-aent.el, calc/calc-ext.el, calc/calc-incom.el:
+	* calc/calc-keypd.el, calc/calc-misc.el, calc/calc-prog.el:
+	* calc/calc-sel.el, calc/calc-store.el, calc/calc-stuff.el:
+	* calc/calc-units.el, calc/calc-yank.el, calc/calc.el:
+	Replace last-command-char with last-command-event.
+
 2009-01-09  Dave Love  <fx@gnu.org>
 
 	* calendar/time-date.el: Require cl for `declare'.
--- a/lisp/calc/calc-aent.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-aent.el	Fri Jan 09 03:57:12 2009 +0000
@@ -109,7 +109,7 @@
 		    (setq buf long))))
 	  (calc-handle-whys)
 	  (message "Result: %s" buf)))
-      (if (eq last-command-char 10)
+      (if (eq last-command-event 10)
 	  (insert shortbuf)
         (kill-new shortbuf)))))
 
@@ -279,7 +279,7 @@
   (calc-wrapper
    (let ((calc-language (if prefix nil calc-language))
 	 (math-expr-opers (if prefix (math-standard-ops) (math-expr-ops))))
-     (calc-alg-entry (and auto (char-to-string last-command-char))))))
+     (calc-alg-entry (and auto (char-to-string last-command-event))))))
 
 (defvar calc-alg-entry-history nil
   "History for algebraic entry.")
@@ -296,7 +296,7 @@
 	(progn
 	  (require 'calc-ext)
 	  (calc-alg-edit alg-exp))
-      (let* ((calc-simplify-mode (if (eq last-command-char ?\C-j)
+      (let* ((calc-simplify-mode (if (eq last-command-event ?\C-j)
 				     'none
 				   calc-simplify-mode))
 	     (nvals (mapcar 'calc-normalize alg-exp)))
@@ -468,12 +468,12 @@
 ;;;###autoload
 (defun calc-alg-digit-entry ()
   (calc-alg-entry
-   (cond ((eq last-command-char ?e)
+   (cond ((eq last-command-event ?e)
 	  (if (> calc-number-radix 14) (format "%d.^" calc-number-radix) "1e"))
-	 ((eq last-command-char ?#) (format "%d#" calc-number-radix))
-	 ((eq last-command-char ?_) "-")
-	 ((eq last-command-char ?@) "0@ ")
-	 (t (char-to-string last-command-char)))))
+	 ((eq last-command-event ?#) (format "%d#" calc-number-radix))
+	 ((eq last-command-event ?_) "-")
+	 ((eq last-command-event ?@) "0@ ")
+	 (t (char-to-string last-command-event)))))
 
 ;; The variable calc-digit-value is initially declared in calc.el,
 ;; but can be set by calcDigit-algebraic and calcDigit-edit.
--- a/lisp/calc/calc-ext.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-ext.el	Fri Jan 09 03:57:12 2009 +0000
@@ -1446,26 +1446,26 @@
 	 (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-char (car event)) ?\C-u)
+	     (if (eq (setq last-command-event (car event)) ?\C-u)
 		 (universal-argument)
-	       (if (or (not (integerp last-command-char))
-		       (and (>= last-command-char 0) (< last-command-char ? )
-			    (not (memq last-command-char '(?\e)))))
+	       (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))
-	       (if (or (not (integerp last-command-char))
-		       (eq last-command-char ?-))
+	       (if (or (not (integerp last-command-event))
+		       (eq last-command-event ?-))
 		   (calc-unread-command)
 		 (digit-argument n))))))))
 
 (defun calc-fancy-prefix-other-key (arg)
   (interactive "P")
   (if (and
-       (not (eq last-command-char 'tab))
-       (not (eq last-command-char 'M-tab))
-       (or (not (integerp last-command-char))
-           (and (>= last-command-char 0) (< last-command-char ? )
-                (not (eq last-command-char meta-prefix-char)))))
+       (not (eq last-command-event 'tab))
+       (not (eq last-command-event 'M-tab))
+       (or (not (integerp last-command-event))
+           (and (>= last-command-event 0) (< last-command-event ? )
+                (not (eq last-command-event meta-prefix-char)))))
      (calc-wrapper))  ; clear flags if not a Calc command.
   (setq prefix-arg arg)
   (calc-unread-command)
--- a/lisp/calc/calc-incom.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-incom.el	Fri Jan 09 03:57:12 2009 +0000
@@ -180,7 +180,7 @@
 	(if (calc-minibuffer-contains ".*\\.\\'")
 	    (delete-backward-char 1))
 	(setq calc-prev-char 'dots
-	      last-command-char 32)
+	      last-command-event 32)
 	(if calc-prev-prev-char
 	    (calcDigit-nondigit)
 	  (setq calc-digit-value nil)
--- a/lisp/calc/calc-keypd.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-keypd.el	Fri Jan 09 03:57:12 2009 +0000
@@ -608,7 +608,7 @@
 				   negative-argument))
 		       (and prefix (string-match "\\`\e?[-0-9]\\'" keys)))
 		   (progn
-		     (setq last-command-char (aref keys (1- (length keys))))
+		     (setq last-command-event (aref keys (1- (length keys))))
 		     (command-execute cmd)
 		     (setq flush 'not-any-more
 			   prefix t
--- a/lisp/calc/calc-misc.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-misc.el	Fri Jan 09 03:57:12 2009 +0000
@@ -472,8 +472,8 @@
 loaded and the keystroke automatically re-typed."
   (interactive "P")
   (require 'calc-ext)
-  (if (keymapp (key-binding (char-to-string last-command-char)))
-      (message "%s%c-" (calc-num-prefix-name n) last-command-char))
+  (if (keymapp (key-binding (char-to-string last-command-event)))
+      (message "%s%c-" (calc-num-prefix-name n) last-command-event))
   (calc-unread-command)
   (setq prefix-arg n))
 
@@ -491,7 +491,7 @@
   (interactive)
   (if (calc-minibuffer-contains "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*")
       (progn
-	(setq last-command-char (upcase last-command-char))
+	(setq last-command-event (upcase last-command-event))
 	(calcDigit-key))
     (calcDigit-nondigit)))
 
--- a/lisp/calc/calc-prog.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-prog.el	Fri Jan 09 03:57:12 2009 +0000
@@ -1285,7 +1285,7 @@
   (let* ((count 0)
 	 (parts nil)
 	 (body "")
-	 (open last-command-char)
+	 (open last-command-event)
 	 (counter initial)
 	 ch)
     (or executing-kbd-macro
--- a/lisp/calc/calc-sel.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-sel.el	Fri Jan 09 03:57:12 2009 +0000
@@ -132,7 +132,7 @@
 
 (defun calc-select-part (num)
   (interactive "P")
-  (or num (setq num (- last-command-char ?0)))
+  (or num (setq num (- last-command-event ?0)))
   (calc-wrapper
    (calc-prepare-selection)
    (let ((sel (calc-find-nth-part (or (nth 2 calc-selection-cache-entry)
--- a/lisp/calc/calc-store.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-store.el	Fri Jan 09 03:57:12 2009 +0000
@@ -381,15 +381,15 @@
 
 (defun calc-store-quick ()
   (interactive)
-  (calc-store (intern (format "var-q%c" last-command-char))))
+  (calc-store (intern (format "var-q%c" last-command-event))))
 
 (defun calc-store-into-quick ()
   (interactive)
-  (calc-store-into (intern (format "var-q%c" last-command-char))))
+  (calc-store-into (intern (format "var-q%c" last-command-event))))
 
 (defun calc-recall-quick ()
   (interactive)
-  (calc-recall (intern (format "var-q%c" last-command-char))))
+  (calc-recall (intern (format "var-q%c" last-command-event))))
 
 (defun calc-copy-special-constant (&optional sconst var)
   (interactive)
--- a/lisp/calc/calc-stuff.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-stuff.el	Fri Jan 09 03:57:12 2009 +0000
@@ -210,9 +210,9 @@
   (interactive "P")
   (calc-clean (- (if num
 		     (prefix-numeric-value num)
-		   (if (and (>= last-command-char ?0)
-			    (<= last-command-char ?9))
-		       (- last-command-char ?0)
+		   (if (and (>= last-command-event ?0)
+			    (<= last-command-event ?9))
+		       (- last-command-event ?0)
 		     (error "Number required"))))))
 
 
--- a/lisp/calc/calc-units.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-units.el	Fri Jan 09 03:57:12 2009 +0000
@@ -349,7 +349,7 @@
 (defun calc-quick-units ()
   (interactive)
   (calc-slow-wrapper
-   (let* ((num (- last-command-char ?0))
+   (let* ((num (- last-command-event ?0))
 	  (pos (if (= num 0) 10 num))
 	  (units (calc-var-value 'var-Units))
 	  (expr (calc-top-n 1)))
--- a/lisp/calc/calc-yank.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc-yank.el	Fri Jan 09 03:57:12 2009 +0000
@@ -489,7 +489,7 @@
 	(insert str))
     (let ((i 0))
       (while (< i (length str))
-	(if (= (setq last-command-char (aref str i)) ?\n)
+	(if (= (setq last-command-event (aref str i)) ?\n)
 	    (or (= i (1- (length str)))
 		(let ((pt (point)))
 		  (end-of-line)
@@ -702,7 +702,7 @@
 	 (if calc-edit-disp-trail
 	     (calc-trail-display 1 t))
 	 (and vals
-	      (let ((calc-simplify-mode (if (eq last-command-char ?\C-j)
+	      (let ((calc-simplify-mode (if (eq last-command-event ?\C-j)
 					    'none
 					  calc-simplify-mode)))
 		(if (>= num 0)
--- a/lisp/calc/calc.el	Fri Jan 09 03:30:02 2009 +0000
+++ b/lisp/calc/calc.el	Fri Jan 09 03:57:12 2009 +0000
@@ -2147,7 +2147,7 @@
   (interactive)
   (calc-wrapper
    (if (or calc-algebraic-mode
-	   (and (> calc-number-radix 14) (eq last-command-char ?e)))
+	   (and (> calc-number-radix 14) (eq last-command-event ?e)))
        (calc-alg-digit-entry)
      (calc-unread-command)
      (setq calc-aborted-prefix nil)
@@ -2196,9 +2196,9 @@
       (progn
 	(beep)
 	(calc-temp-minibuffer-message " [Bad format]"))
-    (or (memq last-command-char '(32 13))
+    (or (memq last-command-event '(32 13))
 	(progn (setq prefix-arg current-prefix-arg)
-	       (calc-unread-command (if (and (eq last-command-char 27)
+	       (calc-unread-command (if (and (eq last-command-event 27)
 					     (>= last-input-char 128))
 					last-input-char
 				      nil))))
@@ -2213,38 +2213,38 @@
 (defun calcDigit-key ()
   (interactive)
   (goto-char (point-max))
-  (if (or (and (memq last-command-char '(?+ ?-))
+  (if (or (and (memq last-command-event '(?+ ?-))
 	       (> (buffer-size) 0)
 	       (/= (preceding-char) ?e))
-	  (and (memq last-command-char '(?m ?s))
+	  (and (memq last-command-event '(?m ?s))
 	       (not (calc-minibuffer-contains "[-+]?[0-9]+\\.?0*[@oh].*"))
 	       (not (calc-minibuffer-contains "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*"))))
       (calcDigit-nondigit)
     (if (calc-minibuffer-contains "\\([-+]?\\|.* \\)\\'")
-	(cond ((memq last-command-char '(?. ?@)) (insert "0"))
-	      ((and (memq last-command-char '(?o ?h ?m))
+	(cond ((memq last-command-event '(?. ?@)) (insert "0"))
+	      ((and (memq last-command-event '(?o ?h ?m))
 		    (not (calc-minibuffer-contains ".*#.*"))) (insert "0"))
-	      ((memq last-command-char '(?: ?e)) (insert "1"))
-	      ((eq last-command-char ?#)
+	      ((memq last-command-event '(?: ?e)) (insert "1"))
+	      ((eq last-command-event ?#)
 	       (insert (int-to-string calc-number-radix)))))
     (if (and (calc-minibuffer-contains "\\([-+]?[0-9]+#\\|[^:]*:\\)\\'")
-	     (eq last-command-char ?:))
+	     (eq last-command-event ?:))
 	(insert "1"))
     (if (and (calc-minibuffer-contains "[-+]?[0-9]+#\\'")
-	     (eq last-command-char ?.))
+	     (eq last-command-event ?.))
 	(insert "0"))
     (if (and (calc-minibuffer-contains "[-+]?0*\\([2-9]\\|1[0-4]\\)#\\'")
-	     (eq last-command-char ?e))
+	     (eq last-command-event ?e))
 	(insert "1"))
-    (if (or (and (memq last-command-char '(?h ?o ?m ?s ?p))
+    (if (or (and (memq last-command-event '(?h ?o ?m ?s ?p))
 		 (calc-minibuffer-contains ".*#.*"))
-	    (and (eq last-command-char ?e)
+	    (and (eq last-command-event ?e)
 		 (calc-minibuffer-contains "[-+]?\\(1[5-9]\\|[2-9][0-9]\\)#.*"))
-	    (and (eq last-command-char ?n)
+	    (and (eq last-command-event ?n)
 		 (calc-minibuffer-contains "[-+]?\\(2[4-9]\\|[3-9][0-9]\\)#.*")))
-	(setq last-command-char (upcase last-command-char)))
+	(setq last-command-event (upcase last-command-event)))
     (cond
-     ((memq last-command-char '(?_ ?n))
+     ((memq last-command-event '(?_ ?n))
       (goto-char (minibuffer-prompt-end))
       (if (and (search-forward " +/- " nil t)
 	       (not (search-forward "e" nil t)))
@@ -2257,7 +2257,7 @@
 	    (delete-char 1)
 	  (insert "-")))
       (goto-char (point-max)))
-     ((eq last-command-char ?p)
+     ((eq last-command-event ?p)
       (if (or (calc-minibuffer-contains ".*\\+/-.*")
 	      (calc-minibuffer-contains ".*mod.*")
 	      (calc-minibuffer-contains ".*#.*")
@@ -2266,7 +2266,7 @@
 	(if (not (calc-minibuffer-contains ".* \\'"))
 	    (insert " "))
 	(insert "+/- ")))
-     ((and (eq last-command-char ?M)
+     ((and (eq last-command-event ?M)
 	   (not (calc-minibuffer-contains
 		 "[-+]?\\(2[3-9]\\|[3-9][0-9]\\)#.*")))
       (if (or (calc-minibuffer-contains ".*\\+/-.*")
@@ -2281,25 +2281,25 @@
 	      (insert " "))
 	  (insert "mod "))))
      (t
-      (insert (char-to-string last-command-char))
+      (insert (char-to-string last-command-event))
       (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]*\\)?\\)?\\'")
 		   (let ((radix (string-to-number
 				 (buffer-substring
 				  (match-beginning 2) (match-end 2)))))
 		     (and (>= radix 2)
 			  (<= radix 36)
-			  (or (memq last-command-char '(?# ?: ?. ?e ?+ ?-))
+			  (or (memq last-command-event '(?# ?: ?. ?e ?+ ?-))
 			      (let ((dig (math-read-radix-digit
-					  (upcase last-command-char))))
+					  (upcase last-command-event))))
 				(and dig
 				     (< dig radix)))))))
 	      (calc-minibuffer-contains
 	       "[-+]?\\(.*\\+/- *\\|.*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]?\\'"))
-	  (if (and (memq last-command-char '(?@ ?o ?h ?\' ?m))
+	  (if (and (memq last-command-event '(?@ ?o ?h ?\' ?m))
 		   (string-match " " calc-hms-format))
 	      (insert " "))
 	(if (and (eq this-command last-command)
-		 (eq last-command-char ?.))
+		 (eq last-command-event ?.))
 	    (progn
 	      (require 'calc-ext)
 	      (calc-digit-dots))
@@ -2307,7 +2307,7 @@
 	  (beep)
 	  (calc-temp-minibuffer-message " [Bad format]"))))))
   (setq calc-prev-prev-char calc-prev-char
-	calc-prev-char last-command-char))
+	calc-prev-char last-command-event))
 
 
 (defun calcDigit-backspace ()
@@ -2324,7 +2324,7 @@
 	(t (backward-delete-char 1)))
   (if (= (calc-minibuffer-size) 0)
       (progn
-	(setq last-command-char 13)
+	(setq last-command-event 13)
 	(calcDigit-nondigit))))