]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calc-aent.el
Replace last-command-char with last-command-event.
[gnu-emacs] / lisp / calc / calc-aent.el
index 22022d8b0ce1912d424c70ff5a8c64e5232c8529..22afd43a34e90f99f1b72d675b92040c3cbe7d04 100644 (file)
@@ -1,17 +1,17 @@
 ;;; calc-aent.el --- algebraic entry functions for Calc
 
 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +19,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -54,6 +52,7 @@
 (defvar calc-quick-calc-history nil
   "The history list for quick-calc.")
 
+;;;###autoload
 (defun calc-do-quick-calc ()
   (require 'calc-ext)
   (calc-check-defines)
                    (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)))))
 
+;;;###autoload
 (defun calc-do-calc-eval (str separator args)
   (calc-check-defines)
   (catch 'calc-error
@@ -268,20 +268,23 @@ The value t means abort and give an error message.")
 
 ;;;; Reading an expression in algebraic form.
 
+;;;###autoload
 (defun calc-auto-algebraic-entry (&optional prefix)
   (interactive "P")
   (calc-algebraic-entry prefix t))
 
+;;;###autoload
 (defun calc-algebraic-entry (&optional prefix auto)
   (interactive "P")
   (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.")
 
+;;;###autoload
 (defun calc-alg-entry (&optional initial prompt)
   (let* ((sel-mode nil)
         (calc-dollar-values (mapcar 'calc-get-stack-element
@@ -293,7 +296,7 @@ The value t means abort and give an error message.")
        (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)))
@@ -319,6 +322,7 @@ The value t means abort and give an error message.")
 
 (defvar calc-alg-exp)
 
+;;;###autoload
 (defun calc-do-alg-entry (&optional initial prompt no-normalize history)
   (let* ((calc-buffer (current-buffer))
         (blink-paren-function 'calcAlg-blink-matching-open)
@@ -461,19 +465,21 @@ The value t means abort and give an error message.")
             (aset (syntax-table) rightchar rightsaved)))
       (blink-matching-open))))
 
+;;;###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.
 (defvar calc-digit-value)
 
+;;;###autoload
 (defun calcDigit-algebraic ()
   (interactive)
   (if (calc-minibuffer-contains ".*[@oh] *[^'m ]+[^'m]*\\'")
@@ -481,6 +487,7 @@ The value t means abort and give an error message.")
     (setq calc-digit-value (minibuffer-contents))
     (exit-minibuffer)))
 
+;;;###autoload
 (defun calcDigit-edit ()
   (interactive)
   (calc-unread-command)
@@ -563,6 +570,7 @@ in Calc algebraic input.")
   "₀₁₂₃₄₅₆₇₈₉₊₋₍₎" ; 0123456789+-()
   "A string consisting of the subscripts allowed by Calc.")
 
+;;;###autoload
 (defun math-read-preprocess-string (str)
   "Replace some substrings of STR by Calc equivalents."
   (setq str
@@ -589,6 +597,7 @@ in Calc algebraic input.")
 (defvar math-exp-keep-spaces)
 (defvar math-expr-data)
 
+;;;###autoload
 (defun math-read-exprs (math-exp-str)
   (let ((math-exp-pos 0)
        (math-exp-old-pos 0)
@@ -613,6 +622,7 @@ in Calc algebraic input.")
            val
          (list 'error math-exp-old-pos "Syntax error"))))))
 
+;;;###autoload
 (defun math-read-expr-list ()
   (let* ((math-exp-keep-spaces nil)
         (val (list (math-read-expr-level 0)))
@@ -634,6 +644,7 @@ in Calc algebraic input.")
 (defvar math-toks nil
   "Tokens to pass between math-build-parse-table and math-find-user-tokens.")
 
+;;;###autoload
 (defun math-build-parse-table ()
   (let ((mtab (cdr (assq nil calc-user-parse-tables)))
        (ltab (cdr (assq calc-language calc-user-parse-tables)))
@@ -658,6 +669,7 @@ in Calc algebraic input.")
                calc-last-user-lang-parse-table ltab
                 calc-last-lang-parse-table lltab)))))
 
+;;;###autoload
 (defun math-find-user-tokens (p)
   (while p
     (cond ((and (stringp (car p))
@@ -682,6 +694,7 @@ in Calc algebraic input.")
               (math-find-user-tokens (nth 2 (car p))))))
     (setq p (cdr p))))
 
+;;;###autoload
 (defun math-read-token ()
   (if (>= math-exp-pos (length math-exp-str))
       (setq math-exp-old-pos math-exp-pos
@@ -867,6 +880,7 @@ in Calc algebraic input.")
 ;; calc-arg-values is defined in calc-ext.el, but is used here.
 (defvar calc-arg-values)
 
+;;;###autoload
 (defun calc-check-user-syntax (&optional x prec)
   (let ((p calc-user-parse-table)
        (matches nil)
@@ -953,6 +967,7 @@ in Calc algebraic input.")
       (setq p (cdr p)))
     (and p match)))
 
+;;;###autoload
 (defun calc-match-user-syntax (p &optional term)
   (let ((matches nil)
        (save-exp-pos math-exp-pos)
@@ -1013,6 +1028,7 @@ in Calc algebraic input.")
              matches "Failed"))
     matches))
 
+;;;###autoload
 (defun math-remove-dashes (x)
   (if (string-match "\\`\\(.*\\)-\\(.*\\)\\'" x)
       (math-remove-dashes
@@ -1052,6 +1068,7 @@ If the current Calc language does not use placeholders, return nil."
        (concat (math-match-substring x 1) "_" (math-match-substring x 2)))
     x))
 
+;;;###autoload
 (defun math-read-if (cond op)
   (let ((then (math-read-expr-level 0)))
     (or (equal math-expr-data ":")
@@ -1263,5 +1280,9 @@ If the current Calc language does not use placeholders, return nil."
 
 (provide 'calc-aent)
 
-;;; arch-tag: 5599e45d-e51e-44bb-9a20-9f4ed8c96c32
+;; Local variables:
+;; generated-autoload-file: "calc-loaddefs.el"
+;; End:
+
+;; arch-tag: 5599e45d-e51e-44bb-9a20-9f4ed8c96c32
 ;;; calc-aent.el ends here