changeset 64184:a0570a2818b2

(calc-embedded-announce-formula-alist, calc-embedded-open-close-formula-alist, calc-embedded-open-close-word-alist, calc-embedded-open-close-plain-alist, calc-embedded-open-close-new-formula-alist, calc-embedded-open-close-mode-alist, calc-embedded-new-buffer-hook, calc-embedded-new-formula-hook, calc-embedded-mode-hook): New variables.
author Jay Belanger <jay.p.belanger@gmail.com>
date Sat, 09 Jul 2005 03:41:40 +0000
parents c2ff1112f5ef
children c6d6fa805aad
files lisp/calc/calc.el
diffstat 1 files changed, 74 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calc/calc.el	Fri Jul 08 22:55:36 2005 +0000
+++ b/lisp/calc/calc.el	Sat Jul 09 03:41:40 2005 +0000
@@ -241,6 +241,19 @@
   :group 'calc
   :type '(regexp))
 
+(defcustom calc-embedded-announce-formula-alist
+  '((texinfo-mode . "@c Embed\n\\(@c .*\n\\)*")
+    (nroff-mode   . "\\\\\"Embed\n\\(\\\\\" .*\n\\)*")
+    (pascal-mode  . "{Embed}\n\\({.*}\n\\)*")
+    (c-mode       . "/\\*Embed\\*/\n\\(/\\* .*\\*/\n\\)*")
+    (c++-mode     . "//Embed\n\\(// .*\n\\)*")
+    (fortran-mode . "C Embed\n\\(C .*\n\\)*")
+    (f90-mode     . "!Embed\n\\(! .*\n\\)*"))
+  "*Alist of major modes with appropriate values for `calc-embedded-announce-formula'."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (regexp :tag "Regexp to announce formula")))
+
 (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."
@@ -253,6 +266,14 @@
   :group 'calc
   :type '(regexp))
 
+(defcustom calc-embedded-open-close-formula-alist
+  nil
+  "*Alist of major modes with pairs of formula delimiters used by calc-embedded."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (regexp :tag "Opening formula delimiter")
+                                  (regexp :tag "Closing formula delimiter"))))
+
 (defcustom calc-embedded-open-word 
   "^\\|[^-+0-9.eE]"
   "*A regular expression for the opening delimiter of a formula used by calc-embedded-word."
@@ -265,6 +286,14 @@
   :group 'calc
   :type '(regexp))
 
+(defcustom calc-embedded-open-close-word-alist
+  nil
+  "*Alist of major modes with pairs of word delimiters used by calc-embedded."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (regexp :tag "Opening word delimiter")
+                                  (regexp :tag "Closing word delimiter"))))
+
 (defcustom calc-embedded-open-plain 
   "%%% "
   "*A string which is the opening delimiter for a \"plain\" formula.
@@ -280,6 +309,20 @@
   :group 'calc
   :type '(string))
 
+(defcustom calc-embedded-open-close-plain-alist
+  '((texinfo-mode "@c %% "   " %%\n")
+    (nroff-mode   "\\\" %% " " %%\n")
+    (pascal-mode  "{%% "    " %%}\n")
+    (c-mode       "/* %% "   " %% */\n")
+    (c++-mode     "// %% "   " %%\n")
+    (fortran-mode "C %% "    " %%\n")
+    (f90-mode     "! %% "    " %%\n"))
+  "*Alist of major modes with pairs of delimiters for \"plain\" formulas."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (string :tag "Opening \"plain\" delimiter")
+                                  (string :tag "Closing \"plain\" delimiter"))))
+
 (defcustom calc-embedded-open-new-formula 
   "\n\n"
   "*A string which is inserted at front of formula by calc-embedded-new-formula."
@@ -292,6 +335,14 @@
   :group 'calc
   :type '(string))
 
+(defcustom calc-embedded-open-close-new-formula-alist
+  nil
+  "*Alist of major modes with pairs of new formula delimiters used by calc-embedded."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (string :tag "Opening new formula delimiter")
+                                  (string :tag "Closing new formula delimiter"))))
+
 (defcustom calc-embedded-open-mode 
   "% "
   "*A string which should precede calc-embedded mode annotations.
@@ -306,6 +357,20 @@
   :group 'calc
   :type '(string))
 
+(defcustom calc-embedded-open-close-mode-alist
+  '((texinfo-mode "@c "   "\n")
+    (nroff-mode   "\\\" " "\n")
+    (pascal-mode  "{ "    " }\n")
+    (c-mode       "/* "   " */\n")
+    (c++-mode     "// "   "\n")
+    (fortran-mode "C "    "\n")
+    (f90-mode     "! "    "\n"))
+  "*Alist of major modes with pairs of strings to delimit annotations."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (string :tag "Opening annotation delimiter")
+                                  (string :tag "Closing annotation delimiter"))))
+
 (defcustom calc-gnuplot-name 
   "gnuplot"
   "*Name of GNUPLOT program, for calc-graph features."
@@ -726,6 +791,15 @@
 (defvar calc-trail-window-hook nil
   "Hook called to create the Calc trail window.")
 
+(defvar calc-embedded-new-buffer-hook nil
+  "Hook run when starting embedded mode in a new buffer.")
+
+(defvar calc-embedded-new-formula-hook nil
+  "Hook run when starting embedded mode in a new formula.")
+
+(defvar calc-embedded-mode-hook nil
+  "Hook run when starting embedded mode.")
+
 ;; Verify that Calc is running on the right kind of system.
 (defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version))))