summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-rewr.el
diff options
context:
space:
mode:
authorColin Walters <walters@gnu.org>2001-11-19 07:44:56 +0000
committerColin Walters <walters@gnu.org>2001-11-19 07:44:56 +0000
commit3132f345bc1ab68e4425178266e3d4ad1b2ccd02 (patch)
tree43339ccf578fb555b44dd0c84aa0e7b0389dc8b0 /lisp/calc/calc-rewr.el
parentf269b73e3ea3de8c539d544fd0310b63fc029f20 (diff)
downloademacs-3132f345bc1ab68e4425178266e3d4ad1b2ccd02.tar.gz
Change all toplevel `setq' forms to `defvar' forms, and move them
before their first use. Use `when', `unless'. Remove trailing periods from error forms. Add description and headers suggested by Emacs Lisp coding conventions.
Diffstat (limited to 'lisp/calc/calc-rewr.el')
-rw-r--r--lisp/calc/calc-rewr.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/calc/calc-rewr.el b/lisp/calc/calc-rewr.el
index a1c26159d9c..5e46e135ae2 100644
--- a/lisp/calc/calc-rewr.el
+++ b/lisp/calc/calc-rewr.el
@@ -1,6 +1,9 @@
-;; Calculator for GNU Emacs, part II [calc-rewr.el]
+;;; calc-rewr.el --- rewriting functions for Calc
+
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
-;; Written by Dave Gillespie, daveg@synaptics.com.
+
+;; Author: David Gillespie <daveg@synaptics.com>
+;; Maintainer: Colin Walters <walters@debian.org>
;; This file is part of GNU Emacs.
@@ -19,7 +22,9 @@
;; file named COPYING. Among other things, the copyright notice
;; and this notice must be preserved on all copies.
+;;; Commentary:
+;;; Code:
;; This file is autoloaded from calc-ext.el.
(require 'calc-ext)
@@ -29,6 +34,7 @@
(defun calc-Need-calc-rewr () nil)
+(defvar math-rewrite-default-iters 100)
(defun calc-rewrite-selection (rules-str &optional many prefix)
(interactive "sRewrite rule(s): \np")
(calc-slow-wrapper
@@ -43,7 +49,7 @@
(math-rewrite-default-iters 1))
(if (or (null rules-str) (equal rules-str "") (equal rules-str "$"))
(if (= num 1)
- (error "Can't use same stack entry for formula and rules.")
+ (error "Can't use same stack entry for formula and rules")
(setq rules (calc-top-n 1 t)
pop-rules t))
(setq rules (if (stringp rules-str)
@@ -203,7 +209,6 @@
(if (= mmt-many 0) " (reached iteration limit)" "")
":\n" fmt "\n"))))
whole-expr))
-(setq math-rewrite-default-iters 100)
(defun math-rewrite-phase (sched)
(while (and sched (/= mmt-many 0))
@@ -479,9 +484,9 @@
(if (eq (car-safe pats) 'vec)
(cdr pats)
(list pats)))))))))
-(setq math-rewrite-whole nil)
-(setq math-make-import-list nil)
+(defvar math-rewrite-whole nil)
+(defvar math-make-import-list nil)
(defun math-compile-rewrites (rules &optional name)
(if (eq (car-safe rules) 'var)
(let ((prop (get (nth 2 rules) 'math-rewrite-cache))
@@ -805,10 +810,11 @@
(cons (car expr)
(mapcar 'math-rwcomp-subst-rec (cdr expr)))))))
-(setq math-rwcomp-tracing nil)
+(defvar math-rwcomp-tracing nil)
(defun math-rwcomp-trace (instr)
- (if math-rwcomp-tracing (progn (terpri) (princ instr)))
+ (when math-rwcomp-tracing
+ (terpri) (princ instr))
instr)
(defun math-rwcomp-instr (&rest instr)