summaryrefslogtreecommitdiff
path: root/lisp/calc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calc-embed.el56
-rw-r--r--lisp/calc/calc-graph.el14
-rw-r--r--lisp/calc/calc.el116
3 files changed, 132 insertions, 54 deletions
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index 2d2f66b1ebf..4f45419c136 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -1,6 +1,6 @@
;;; calc-embed.el --- embed Calc in a buffer
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
;; Author: David Gillespie <daveg@synaptics.com>
;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -48,48 +48,18 @@
(defvar calc-embedded-some-active nil)
(make-variable-buffer-local 'calc-embedded-some-active)
-(defvar calc-embedded-open-formula "\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin[^{].*\n\\|^\\\\begin{.*[^x]}.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n"
- "*A regular expression for the opening delimiter of a formula used by
-calc-embedded.")
-
-(defvar calc-embedded-close-formula "\\'\\|\n$\\|\\$\\$?\\|\\\\]\\|^\\\\end[^{].*\n\\|^\\\\end{.*[^x]}.*\n\\|^@.*\n\\|^\\.EN.*\n\\|\\\\)\\|\n%\n\\|^\\.\\\\\"\n"
- "*A regular expression for the closing delimiter of a formula used by
-calc-embedded.")
-
-(defvar calc-embedded-open-word "^\\|[^-+0-9.eE]"
- "*A regular expression for the opening delimiter of a formula used by
-calc-embedded-word.")
-
-(defvar calc-embedded-close-word "$\\|[^-+0-9.eE]"
- "*A regular expression for the closing delimiter of a formula used by
-calc-embedded-word.")
-
-(defvar calc-embedded-open-plain "%%% "
- "*A string which is the opening delimiter for a \"plain\" formula.
-If calc-show-plain mode is enabled, this is inserted at the front of
-each formula.")
-
-(defvar calc-embedded-close-plain " %%%\n"
- "*A string which is the closing delimiter for a \"plain\" formula.
-See calc-embedded-open-plain.")
-
-(defvar calc-embedded-open-new-formula "\n\n"
- "*A string which is inserted at front of formula by calc-embedded-new-formula.")
-
-(defvar calc-embedded-close-new-formula "\n\n"
- "*A string which is inserted at end of formula by calc-embedded-new-formula.")
-
-(defvar calc-embedded-announce-formula "%Embed\n\\(% .*\n\\)*"
- "*A regular expression which is sure to be followed by a calc-embedded formula." )
-
-(defvar calc-embedded-open-mode "% "
- "*A string which should precede calc-embedded mode annotations.
-This is not required to be present for user-written mode annotations.")
-
-(defvar calc-embedded-close-mode "\n"
- "*A string which should follow calc-embedded mode annotations.
-This is not required to be present for user-written mode annotations.")
-
+;; The following variables are customizable and defined in calc.el.
+(defvar calc-embedded-announce-formula)
+(defvar calc-embedded-open-formula)
+(defvar calc-embedded-close-formula)
+(defvar calc-embedded-open-word)
+(defvar calc-embedded-close-word)
+(defvar calc-embedded-open-plain)
+(defvar calc-embedded-close-plain)
+(defvar calc-embedded-open-new-formula)
+(defvar calc-embedded-close-new-formula)
+(defvar calc-embedded-open-mode)
+(defvar calc-embedded-close-mode)
(defconst calc-embedded-mode-vars '(("precision" . calc-internal-prec)
("word-size" . calc-word-size)
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el
index 662de5db867..6a58a6215fa 100644
--- a/lisp/calc/calc-graph.el
+++ b/lisp/calc/calc-graph.el
@@ -1,6 +1,6 @@
;;; calc-graph.el --- graph output functions for Calc
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
;; Author: David Gillespie <daveg@synaptics.com>
;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -33,14 +33,10 @@
;;; Graphics
-(defvar calc-gnuplot-name "gnuplot"
- "*Name of GNUPLOT program, for calc-graph features.")
-
-(defvar calc-gnuplot-plot-command nil
- "*Name of command for displaying GNUPLOT output; %s = file name to print.")
-
-(defvar calc-gnuplot-print-command "lp %s"
- "*Name of command for printing GNUPLOT output; %s = file name to print.")
+;; The following three variables are customizable and defined in calc.el.
+(defvar calc-gnuplot-name)
+(defvar calc-gnuplot-plot-command)
+(defvar calc-gnuplot-print-command)
(defvar calc-gnuplot-tempfile "calc")
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 639b6f31a68..3d78599ecc1 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -206,9 +206,121 @@
(require 'calc-macs)
+(defgroup calc nil
+ "GNU Calc"
+ :prefix "calc-"
+ :tag "Calc")
+
;;;###autoload
-(defvar calc-settings-file (convert-standard-filename "~/.calc.el")
- "*File in which to record permanent settings.")
+(defcustom calc-settings-file
+ (convert-standard-filename "~/.calc.el")
+ "*File in which to record permanent settings."
+ :group 'calc
+ :type '(file))
+
+(defcustom calc-language-alist
+ '((latex-mode . latex)
+ (tex-mode . tex)
+ (plain-tex-mode . tex)
+ (context-mode . tex)
+ (nroff-mode . eqn)
+ (pascal-mode . pascal)
+ (c-mode . c)
+ (c++-mode . c)
+ (fortran-mode . fortran)
+ (f90-mode . fortran))
+ "*Alist of major modes with appropriate Calc languages."
+ :group 'calc
+ :type '(alist :key-type symbol :value-type symbol))
+
+(defcustom calc-embedded-announce-formula
+ "%Embed\n\\(% .*\n\\)*"
+ "*A regular expression which is sure to be followed by a calc-embedded formula."
+ :group 'calc
+ :type '(regexp))
+
+(defcustom calc-embedded-open-formula
+ "\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin[^{].*\n\\|^\\\\begin{.*[^x]}.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n"
+ "*A regular expression for the opening delimiter of a formula used by calc-embedded."
+ :group 'calc
+ :type '(regexp))
+
+(defcustom calc-embedded-close-formula
+ "\\'\\|\n$\\|\\$\\$?\\|\\\\]\\|^\\\\end[^{].*\n\\|^\\\\end{.*[^x]}.*\n\\|^@.*\n\\|^\\.EN.*\n\\|\\\\)\\|\n%\n\\|^\\.\\\\\"\n"
+ "*A regular expression for the closing delimiter of a formula used by calc-embedded."
+ :group 'calc
+ :type '(regexp))
+
+(defcustom calc-embedded-open-word
+ "^\\|[^-+0-9.eE]"
+ "*A regular expression for the opening delimiter of a formula used by calc-embedded-word."
+ :group 'calc
+ :type '(regexp))
+
+(defcustom calc-embedded-close-word
+ "$\\|[^-+0-9.eE]"
+ "*A regular expression for the closing delimiter of a formula used by calc-embedded-word."
+ :group 'calc
+ :type '(regexp))
+
+(defcustom calc-embedded-open-plain
+ "%%% "
+ "*A string which is the opening delimiter for a \"plain\" formula.
+If calc-show-plain mode is enabled, this is inserted at the front of
+each formula."
+ :group 'calc
+ :type '(string))
+
+(defcustom calc-embedded-close-plain
+ " %%%\n"
+ "*A string which is the closing delimiter for a \"plain\" formula.
+See calc-embedded-open-plain."
+ :group 'calc
+ :type '(string))
+
+(defcustom calc-embedded-open-new-formula
+ "\n\n"
+ "*A string which is inserted at front of formula by calc-embedded-new-formula."
+ :group 'calc
+ :type '(string))
+
+(defcustom calc-embedded-close-new-formula
+ "\n\n"
+ "*A string which is inserted at end of formula by calc-embedded-new-formula."
+ :group 'calc
+ :type '(string))
+
+(defcustom calc-embedded-open-mode
+ "% "
+ "*A string which should precede calc-embedded mode annotations.
+This is not required to be present for user-written mode annotations."
+ :group 'calc
+ :type '(string))
+
+(defcustom calc-embedded-close-mode
+ "\n"
+ "*A string which should follow calc-embedded mode annotations.
+This is not required to be present for user-written mode annotations."
+ :group 'calc
+ :type '(string))
+
+(defcustom calc-gnuplot-name
+ "gnuplot"
+ "*Name of GNUPLOT program, for calc-graph features."
+ :group 'calc
+ :type '(string))
+
+(defcustom calc-gnuplot-plot-command
+ nil
+ "*Name of command for displaying GNUPLOT output; %s = file name to print."
+ :group 'calc
+ :type '(choice (string) (sexp)))
+
+(defcustom calc-gnuplot-print-command
+ "lp %s"
+ "*Name of command for printing GNUPLOT output; %s = file name to print."
+ :group 'calc
+ :type '(choice (string) (sexp)))
(defvar calc-bug-address "belanger@truman.edu"
"Address of the author of Calc, for use by `report-calc-bug'.")