;;; 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
;; 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:
(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
;;;; 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
(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)))
(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)
(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]*\\'")
(setq calc-digit-value (minibuffer-contents))
(exit-minibuffer)))
+;;;###autoload
(defun calcDigit-edit ()
(interactive)
(calc-unread-command)
"₀₁₂₃₄₅₆₇₈₉₊₋₍₎" ; 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
(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)
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)))
(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)))
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))
(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
;; 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)
(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)
matches "Failed"))
matches))
+;;;###autoload
(defun math-remove-dashes (x)
(if (string-match "\\`\\(.*\\)-\\(.*\\)\\'" x)
(math-remove-dashes
(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 ":")
(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