;; Author: Burkhard Zimmermann
;; Maintainer: Burkhard Zimmermann <B.Zimmermann@risc.uni-linz.ac.at>
-;; Credits:
+;; Credits:
;; mathematica.el is derived from Tim Wichmann's mode mma.el.
;; In particular, it takes its font-lock support from there.
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
-;;
+;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
-;;
+;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;;; Commentary:
-;;; Installation:
+;;; Installation:
;; To use mathematica-m-mode you should add the following to your .emacs file:
;; (autoload 'mathematica-m-mode "mathematica.el" "Mathematica package file mode" t)
;; (setq mathematica-m-mode-hook (function (lambda () (interactive)
;; (setq mathematica-m-mode-hook-done 1)
-;; (show-paren-mode)
+;; (show-paren-mode)
;; )))
;; June 17, 2004:
;; fix to get the rigth window-width for the Mathematica process buffer.
-;;
-;; June 16, 2004:
+;;
+;; June 16, 2004:
;; 3. respects the window layout of the user:
;; uses pop-to-buffer, and no longer switch-to-buffer.
;; Jan 28, 2003: removed debug support.
;; removed indentation support.
-;; Jan 27, 2003: Started from mma.el,v 1.32 2000/06/27 16:05:19
+;; Jan 27, 2003: Started from mma.el,v 1.32 2000/06/27 16:05:19
;; Author: Tim Wichmann <wichmann@itwm.uni-kl.de>
(modify-syntax-entry ?\\ "\\" mathematica-m-mode-syntax-table)
; " is a string quote
; ...
-; the properties of ( are:
-; (: it is an open-parenthesis character.
+; the properties of ( are:
+; (: it is an open-parenthesis character.
; ): its matching anticharacter is ).
; 1: it is the first character of the comment delimiters "(**)",
; n: such comments may [n]est.
; (bug in Wichmann's mode: "n" is missing).
(modify-syntax-entry ?( "()1n" mathematica-m-mode-syntax-table)
-; the properties of ) are:
-; ): it is a close-parenthesis character.
+; the properties of ) are:
+; ): it is a close-parenthesis character.
; (: its matching anticharacter is (.
; 4: it is the fourth character of the "(**)"
; n: such comments may [n]est.
; n: such comments may [n]est.
(modify-syntax-entry ?* ". 23n" mathematica-m-mode-syntax-table)
-; the properties of [ are:
-; (: it is an open-parenthesis character.
+; the properties of [ are:
+; (: it is an open-parenthesis character.
; ]: its matching anticharacter is ].
(modify-syntax-entry ?\[ "(]" mathematica-m-mode-syntax-table)
-; the properties of ] are:
-; ): it is a close-parenthesis character.
+; the properties of ] are:
+; ): it is a close-parenthesis character.
; [: its matching anticharacter is [.
(modify-syntax-entry ?\] ")[" mathematica-m-mode-syntax-table)
-; the properties of { are:
-; (: it is an open-parenthesis character.
+; the properties of { are:
+; (: it is an open-parenthesis character.
; }: its matching anticharacter is }.
(modify-syntax-entry ?\{ "(}" mathematica-m-mode-syntax-table)
-; the properties of } are:
-; ): it is a close-parenthesis character.
+; the properties of } are:
+; ): it is a close-parenthesis character.
; {: its matching anticharacter is {.
(modify-syntax-entry ?\] ")[" mathematica-m-mode-syntax-table)
)
(defun mathematica-m-tab-command ()
""
(interactive)
- (if (or (bolp) nil) ; (empty-line-p)) ; if at an empty line or at the beginning of a line,
+ (if (or (bolp) nil) ; (empty-line-p)) ; if at an empty line or at the beginning of a line,
; note: statt bolp haette ich lieber: wenn links vom cursor nur whitespace ist.
- (indent-relative-maybe) ; then: indent; ;(indent-for-tab-command)
- (dabbrev-expand nil) ; otherwise: expand word.
- ; the argument nil is needed. I don't know what it means.
+ (indent-relative-maybe) ; then: indent; ;(indent-for-tab-command)
+ (dabbrev-expand nil) ; otherwise: expand word.
+ ; the argument nil is needed. I don't know what it means.
)
)
; debug code: (global-set-key [f5] 'mathematica-m-tab-command)
-
-
+
+
; does not work the way it should.
;(defun empty-line-p ()
; "Checks if the current line is empty."
-;;;(make-regexp '("If" "While" "Print" "Module" "With" "Block" "Switch"
+;;;(make-regexp '("If" "While" "Print" "Module" "With" "Block" "Switch"
;;; "Return""Begin" "End" "BeginPackage" "EndPackage"
-;;; "Which" "Do" "For" "Throw" "Catch" "Check" "Break"
+;;; "Which" "Do" "For" "Throw" "Catch" "Check" "Break"
;;; "Continue" "Goto" "Label" "Abort" "Message"))
;;;;;;;;
-;;;(make-regexp '("If" "While")) "Print" "Module" "With" "Block" "Switch"
+;;;(make-regexp '("If" "While")) "Print" "Module" "With" "Block" "Switch"
;;; "Return""Begin" "End" "BeginPackage" "EndPackage"
-;;; "Which" "Do" "For" "Throw" "Catch" "Check" "Break"
+;;; "Which" "Do" "For" "Throw" "Catch" "Check" "Break"
;;; "Continue" "Goto" "Label" "Abort" "Message"))
;;;;;;;;
; '("\\(^[a-zA-Z]\\w*\\)\\([ \t]*=[ \t]*Compile\\|\\[\\([ \t]*\\]\\|.*\\(_\\|:\\)\\)\\)"
; 1 font-lock-function-name-face)
; '("\\<\\(\\$\\(Aborted\\|B\\(atch\\(Input\\|Output\\)\\|yteOrdering\\)\\|C\\(haracterEncoding\\|o\\(mmandLine\\|ntext\\(Path\\)?\\)\\|reationDate\\|urrentLink\\)\\|Display\\(Function\\)?\\|E\\(cho\\|pilog\\|xportFormats\\)\\|F\\(ailed\\|ormatType\\|rontEnd\\)\\|H\\(istoryLength\\|omeDirectory\\)\\|I\\(gnoreEOF\\|mportFormats\\|n\\(itialDirectory\\|put\\|s\\(pector\\|tallationDate\\)\\)\\|terationLimit\\)\\|L\\(a\\(nguage\\|unchDirectory\\)\\|in\\(e\\|ked\\)\\)\\|M\\(a\\(chine\\(Domain\\|Epsilon\\|ID\\|Name\\|Precision\\|Type\\)\\|x\\(ExtraPrecision\\|MachineNumber\\|Number\\|Precision\\)\\)\\|essage\\(List\\|PrePrint\\|s\\)\\|in\\(MachineNumber\\|Number\\|Precision\\)\\|oduleNumber\\)\\|N\\(ew\\(Message\\|Symbol\\)\\|otebooks\\|umberMarks\\)\\|O\\(peratingSystem\\|utput\\)\\|P\\(a\\(ckages\\|rent\\(Link\\|ProcessID\\)\\|th\\)\\|ost\\|r\\(e\\(Print\\|Read\\)?\\|ocess\\(ID\\|orType\\)\\)\\)\\|R\\(andomState\\|e\\(cursionLimit\\|leaseNumber\\)\\)\\|S\\(essionID\\|oundDisplayFunction\\|y\\(ntaxHandler\\|stem\\(CharacterEncoding\\|ID\\)?\\)\\)\\|T\\(extStyle\\|imeUnit\\|opDirectory\\)\\|U\\(rgent\\|serName\\)\\|Version\\(Number\\)?\\)\\|A\\(b\\(ort\\(Protect\\)?\\|s\\(olute\\(Dashing\\|Options\\|PointSize\\|T\\(hickness\\|ime\\)\\)\\)?\\)\\|c\\(c\\(ountingForm\\|uracy\\(Goal\\)?\\)\\|tive\\)\\|d\\(dTo\\|justmentBox\\)\\|iry\\(Ai\\(Prime\\)?\\|Bi\\(Prime\\)?\\)\\|l\\(gebraics\\|l\\|ternatives\\)\\|mbientLight\\|n\\(choredSearch\\|d\\|imationDi\\(rection\\|splayTime\\)\\)\\|p\\(art\\|p\\(e\\(llF1\\|nd\\(To\\)?\\)\\|ly\\)\\)\\|r\\(c\\(C\\(o\\(sh\\|th\\|[st]\\)\\|sch?\\)\\|S\\(ech?\\|inh?\\)\\|Tanh?\\)\\|g\\|ithmeticGeometricMean\\|ray\\)\\|s\\(pectRatio\\(Fixed\\)?\\|sumptions\\)\\|t\\(omQ\\|tributes\\)\\|uto\\(I\\(ndent\\|talicWords\\)\\|Spacing\\|matic\\)\\|xes\\(Edge\\|Label\\|Origin\\|Style\\)?\\)\\|B\\(a\\(ckground\\|seForm\\)\\|e\\(gin\\(Package\\)?\\|rnoulliB\\|ssel[IJKY]\\|ta\\(Regularized\\)?\\)\\|i\\(nomial\\|t\\(And\\|Not\\|Or\\|Xor\\)\\)\\|l\\(ank\\(NullSequence\\|Sequence\\)?\\|ock\\)\\|o\\(oleans\\|x\\(Ratios\\|Style\\|ed\\)\\)\\|reak\\|utton\\(Box\\|Data\\|E\\(valuator\\|xpandable\\)\\|F\\(rame\\|unction\\)\\|M\\(argins\\|inHeight\\)\\|Note\\(book\\)?\\|S\\(ource\\|tyle\\)\\)\\|yte\\(Count\\)?\\)\\|C\\(Form\\|MYKColor\\|a\\(ncel\\|rmichaelLambda\\|ses\\|t\\(alan\\|ch\\)\\)\\|e\\(iling\\|ll\\(AutoOverwrite\\|Baseline\\|Dingbat\\|E\\(ditDuplicate\\|valuationDuplicate\\)\\|Frame\\(Margins\\)?\\|Group\\(Data\\|ing\\)\\|Label\\(AutoDelete\\)?\\|Margins\\|Open\\|Print\\|Tags\\)?\\)\\|h\\(aracter\\(Encoding\\|Range\\|s\\)?\\|e\\(byshev[TU]\\|ck\\(Abort\\)?\\)\\|op\\)\\|ircle\\|l\\(e\\(ar\\(A\\(ll\\|ttributes\\)\\)?\\|bschGordan\\)\\|ipFill\\|ose\\)\\|o\\(efficient\\(List\\)?\\|l\\(lect\\|or\\(Function\\(Scaling\\)?\\|Output\\)\\|umn\\(Alignments\\|Form\\|Lines\\|Spacings\\|Widths\\|sEqual\\)\\)\\|mp\\(ile\\(d\\(Function\\)?\\)?\\|le\\(ment\\|x\\(Expand\\|Infinity\\|es\\|ityFunction\\)?\\)\\|o\\(s\\(e\\(List\\|Series\\)\\|ition\\)\\|undExpression\\)\\)\\|n\\(dition\\|jugate\\|st\\(ants?\\|rainedM\\(ax\\|in\\)\\)\\|t\\(exts?\\|inue\\(dFraction\\)?\\|our\\(Graphics\\|Lines\\|Plot\\|S\\(hading\\|tyle\\)\\|s\\)\\)\\|versionRules\\)\\|py\\(Directory\\|File\\|able\\)\\|s\\(Integral\\|h\\(Integral\\)?\\)\\|th\\|unt\\|[st]\\)\\|r\\(eateDirectory\\|oss\\)\\|sch?\\|uboid\\|yclotomic\\)\\|D\\(Solve\\|a\\(shing\\|te\\)\\|e\\(c\\(larePackage\\|ompose\\|rement\\)\\|dekindEta\\|f\\(ault\\(Color\\|DuplicateCellStyle\\|NewCellStyle\\)?\\|inition\\)\\|gree\\|l\\(et\\(able\\|e\\(Cases\\|Directory\\|File\\)?\\)\\|imiterFlashTime\\)\\|n\\(ominator\\|sity\\(Graphics\\|Plot\\)\\)\\|pth\\|rivative\\|t\\)\\|i\\(a\\(gonalMatrix\\|log\\(Prolog\\|Symbols\\)?\\)\\|git\\(Block\\|Count\\|Q\\)\\|mensions\\|r\\(acDelta\\|ect\\(edInfinity\\|ory\\(Name\\|Stack\\)?\\)\\)\\|s\\(creteDelta\\|k\\|p\\(atch\\|lay\\(F\\(orm\\|unction\\)\\|String\\)?\\)\\|tribute\\)\\|vi\\(de\\(By\\)?\\|sor\\(Sigma\\|s\\)\\)\\)\\|o\\(t\\|wnValues\\)\\|r\\(agAndDrop\\|op\\)\\|umpSave\\|[ot]\\)\\|E\\(d\\(geForm\\|itable\\)\\|igen\\(system\\|v\\(alues\\|ectors\\)\\)\\|l\\(ement\\|iminate\\|liptic\\(Exp\\|Log\\|NomeQ\\|Pi\\|Theta\\(Prime\\)?\\|[EFK]\\)\\)\\|n\\(code\\|d\\(OfFile\\|Package\\)?\\|gineeringForm\\|vironment\\)\\|pilog\\|qual\\|r\\(f[ci]?\\|rorBox\\)\\|uler\\(E\\|Gamma\\|Phi\\)\\|v\\(aluat\\(able\\|e\\|ionNotebook\\|or\\)\\|enQ\\)\\|x\\(cludedForms\\|it\\|p\\(IntegralEi?\\|ToTrig\\|and\\(All\\|Denominator\\|Numerator\\)?\\|o\\(nent\\(Function\\)?\\|rt\\(String\\)?\\)\\|ression\\)?\\|t\\(en\\(dedGCD\\|sion\\)\\|ract\\)\\)\\)\\|F\\(a\\(c\\(e\\(Form\\|Grids\\)\\|tor\\(Integer\\|List\\|SquareFree\\(List\\)?\\|Terms\\(List\\)?\\|ial2?\\)?\\)\\|lse\\)\\|i\\(bonacci\\|le\\(ByteCount\\|Date\\|Names\\|Type\\)\\|nd\\(List\\|Minimum\\|Root\\)?\\|rst\\|t\\|xedPoint\\(List\\)?\\)\\|l\\(at\\(ten\\(At\\)?\\)?\\|oor\\)\\|o\\(ld\\(List\\)?\\|nt\\(Color\\|Family\\|S\\(ize\\|lant\\|ubstitutions\\)\\|Tracking\\|Weight\\)\\|r\\(m\\(Box\\|at\\(Type\\)?\\)\\|tranForm\\)?\\|urier\\(CosTransform\\|SinTransform\\|Transform\\)?\\)\\|r\\(a\\(ction\\(Box\\|alPart\\)\\|me\\(Box\\|Label\\|Style\\|Ticks\\)?\\)\\|e\\(eQ\\|snel[CS]\\)\\|o\\(m\\(C\\(haracterCode\\|ontinuedFraction\\)\\|D\\(ate\\|igits\\)\\)\\|ntEndExecute\\)\\)\\|u\\(ll\\(Definition\\|Form\\|Graphics\\|Simplify\\)\\|nction\\(Expand\\|Interpolation\\)?\\)\\)\\|G\\(CD\\|a\\(mma\\(Regularized\\)?\\|ussianIntegers\\)\\|e\\(genbauerC\\|nera\\(l\\|te\\(Conditions\\|dCell\\)\\)\\|t\\)\\|laisher\\|o\\(ldenRatio\\|to\\)\\|r\\(a\\(phics\\(3D\\|Array\\|Spacing\\)?\\|yLevel\\)\\|eater\\(Equal\\)?\\|id\\(B\\(aseline\\|ox\\)\\|DefaultElement\\|Lines\\)\\|o\\(ebnerBasis\\|upPageBreakWithin\\)\\)\\)\\|H\\(TMLSave\\|armonicNumber\\|e\\(ads?\\|rmiteH\\)\\|iddenSurface\\|old\\(All\\(Complete\\)?\\|Complete\\|F\\(irst\\|orm\\)\\|Pattern\\|Rest\\)?\\|ue\\|yp\\(ergeometric\\(0F1\\(Regularized\\)?\\|1F1\\(Regularized\\)?\\|2F1\\(Regularized\\)?\\|PFQ\\(Regularized\\)?\\|U\\)\\|henation\\)\\)\\|I\\(dentity\\(Matrix\\)?\\|gnoreCase\\|m\\(age\\(Margins\\|R\\(esolution\\|otated\\)\\|Size\\)\\|p\\(lies\\|ort\\(String\\)?\\)\\)\\|n\\(String\\|crement\\|determinate\\|f\\(i\\(nity\\|x\\)\\|ormation\\)\\|itializationCell\\|ner\\|put\\(A\\(liases\\|utoReplacements\\)\\|Form\\|Notebook\\|Str\\(eam\\|ing\\)\\)?\\|s\\(ert\\|tall\\)\\|te\\(g\\(er\\(Digits\\|Exponent\\|Part\\|[Qs]\\)?\\|rate\\)\\|r\\(p\\(olati\\(ng\\(Function\\|Polynomial\\)\\|on\\)\\|retationBox\\)\\|rupt\\|section\\|val\\(Intersection\\|MemberQ\\|Union\\)?\\)\\)\\|verse\\(BetaRegularized\\|E\\(llipticNomeQ\\|rfc?\\)\\|F\\(ourier\\(CosTransform\\|SinTransform\\|Transform\\)?\\|unctions?\\)\\|GammaRegularized\\|LaplaceTransform\\|Series\\|WeierstrassP\\|ZTransform\\)?\\)\\|[fmn]\\)\\|J\\(acobi\\(Amplitude\\|P\\|Symbol\\|Zeta\\)\\|o\\(in\\|rdanDecomposition\\)\\)\\|K\\(hinchin\\|leinInvariantJ\\|roneckerDelta\\)\\|L\\(CM\\|U\\(BackSubstitution\\|Decomposition\\)\\|a\\(bel\\|guerreL\\|nguageCategory\\|placeTransform\\|st\\|tticeReduce\\)\\|e\\(afCount\\|gendre[PQ]\\|ngth\\|rchPhi\\|ss\\(Equal\\)?\\|tterQ\\|vel\\)\\|i\\(ght\\(Sources\\|ing\\)\\|mit\\(sPositioning\\)?\\|n\\(e\\(Indent\\(MaxFraction\\)?\\|Spacing\\|ar\\(Programming\\|Solve\\)\\)?\\|k\\(C\\(lose\\|onnect\\|reate\\)\\|Interrupt\\|Launch\\|Object\\|P\\(atterns\\|rotocol\\)\\|Read\\(yQ\\)?\\|Write\\|s\\)\\)\\|st\\(Co\\(n\\(tourPlot\\|volve\\)\\|rrelate\\)\\|DensityPlot\\|Interpolation\\|Pl\\(ay\\|ot\\(3D\\)?\\)\\|able\\)?\\)\\|o\\(cked\\|g\\(Gamma\\|Integral\\|icalExpand\\)?\\|werCaseQ\\)\\)\\|M\\(a\\(chineNumberQ\\|gnification\\|ke\\(Boxes\\|Expression\\)\\|ntissaExponent\\|p\\(A\\(ll\\|t\\)\\|Indexed\\|Thread\\)\\|t\\(ch\\(LocalNames\\|Q\\)\\|hieu\\(C\\(Prime\\|haracteristic\\(Exponent\\|[AB]\\)\\)\\|SPrime\\|[CS]\\)\\|rix\\(Exp\\|Form\\|Power\\|Q\\)\\)\\|x\\(Bend\\|MemoryUsed\\)\\|[px]\\)\\|e\\(ijerG\\|m\\(berQ\\|ory\\(Constrained\\|InUse\\)\\)\\|s\\(h\\(Range\\|Style\\)?\\|sage\\(List\\|Name\\|s\\)?\\)\\)\\|in\\(ors\\|us\\)?\\|o\\(d\\(ul\\(arLambda\\|e\\|us\\)\\)?\\|ebiusMu\\)\\|ulti\\(nomial\\|plicativeOrder\\)\\)\\|N\\(DSolve\\|Hold\\(All\\|First\\|Rest\\)\\|Integrate\\|Product\\|S\\(olve\\|um\\)\\|ame[Qs]\\|e\\(eds\\|gative\\|st\\(List\\|While\\(List\\)?\\)?\\)\\|o\\(n\\(Co\\(mmutativeMultiply\\|nstants\\)\\|Negative\\|Positive\\|e\\)\\|rmal\\|t\\(ebook\\(A\\(pply\\|utoSave\\)\\|C\\(lose\\|reate\\)\\|Delete\\|Find\\|Get\\|Locate\\|O\\(bject\\|pen\\)\\|P\\(rint\\|ut\\)\\|Read\\|S\\(ave\\|election\\)\\|Write\\|s\\)?\\)?\\)\\|u\\(ll\\(Records\\|Space\\|Words\\)?\\|m\\(ber\\(Form\\(at\\)?\\|M\\(arks\\|ultiplier\\)\\|P\\(adding\\|oint\\)\\|Q\\|S\\(eparator\\|igns\\)\\)?\\|er\\(ator\\|ic\\(Function\\|Q\\)\\)\\)\\)\\)\\|O\\(ddQ\\|ff\\(set\\)?\\|neIdentity\\|p\\(e\\(n\\(Append\\|Read\\|Temporary\\|Write\\)\\|rate\\)\\|tion\\(al\\|s\\)\\)\\|rder\\(edQ\\|less\\)?\\|ut\\(er\\|put\\(Form\\|Stream\\)\\)?\\|verscriptBox\\|[nr]\\)\\|P\\(a\\(d\\(Left\\|Right\\|dedForm\\)\\|ge\\(Break\\(Above\\|Below\\|Within\\)\\|Width\\)\\|r\\(a\\(graph\\(Indent\\|Spacing\\)\\|metricPlot\\(3D\\)?\\)\\|entDirectory\\|t\\(ition\\(s[PQ]\\)?\\)?\\)\\|t\\(h\\|tern\\(Test\\)?\\)\\|use\\)\\|ermutations\\|i\\|l\\(ay\\(Range\\)?\\|ot\\(3D\\|Division\\|Joined\\|Label\\|Points\\|R\\(ange\\|egion\\)\\|Style\\)?\\|us\\)\\|o\\(chhammer\\|int\\(Size\\)?\\|ly\\(Gamma\\|Log\\|gon\\(Intersections\\)?\\|nomial\\(GCD\\|LCM\\|Mod\\|Q\\(uotient\\)?\\|Re\\(duce\\|mainder\\)\\)\\)\\|s\\(iti\\(on\\|ve\\)\\|t\\(Script\\|fix\\)\\)\\|wer\\(Expand\\|Mod\\)?\\)\\|r\\(e\\(Decrement\\|Increment\\|c\\(edenceForm\\|ision\\(Goal\\)?\\)\\|fix\\|pend\\(To\\)?\\)\\|i\\(me\\(Pi\\|[Qs]\\)?\\|n\\(cipalValue\\|t\\(ingStyleEnvironment\\)?\\)\\)\\|o\\(duct\\(Log\\)?\\|log\\|tect\\(ed\\)?\\)\\)\\|seudoInverse\\|ut\\(Append\\)?\\)\\|Q\\(RDecomposition\\|u\\(it\\|otient\\)\\)\\|R\\(GBColor\\|a\\(dicalBox\\|n\\(dom\\|ge\\)\\|ster\\(Array\\)?\\|tional\\(ize\\|s\\)?\\|w\\)\\|e\\(a\\(d\\(List\\|Protected\\)\\|l\\(Digits\\|s\\)\\|[dl]\\)\\|c\\(ord\\(Lists\\|Separators\\)?\\|tangle\\)\\|duce\\|leaseHold\\|move\\|n\\(ame\\(Directory\\|File\\)\\|derAll\\)\\|p\\(eated\\(Null\\)?\\|lace\\(All\\|List\\|Part\\|Repeated\\)?\\)\\|s\\(etDirectory\\|idue\\|t\\|ultant\\)\\|turn\\|verse\\)?\\|iemannSiegel\\(Theta\\|Z\\)\\|o\\(ot\\(Reduce\\|Sum\\|s\\)?\\|tate\\(L\\(abel\\|eft\\)\\|Right\\)\\|und\\|w\\(Alignments\\|Box\\|Lines\\|MinHeight\\|Reduce\\|Spacings\\|sEqual\\)\\)\\|u\\(le\\(Delayed\\)?\\|n\\(Through\\)?\\)\\)\\|S\\(a\\(m\\(eQ\\|ple\\(Depth\\|Rate\\|dSound\\(Function\\|List\\)\\)\\)\\|ve\\)\\|c\\(a\\(led\\|n\\)\\|hurDecomposition\\|ientificForm\\|r\\(eenStyleEnvironment\\|ipt\\(BaselineShifts\\|MinSize\\|SizeMultipliers\\)\\)\\)\\|e\\(ch\\|edRandom\\|lect\\(able\\|edNotebook\\|ion\\(Animate\\|CreateCell\\|Evaluate\\(CreateCell\\)?\\|Move\\)\\)?\\|quence\\(Form\\|Hold\\)?\\|ries\\(Coefficient\\|Data\\)?\\|ssionTime\\|t\\(A\\(ccuracy\\|ttributes\\)\\|D\\(elayed\\|irectory\\)\\|FileDate\\|Options\\|Precision\\|S\\(electedNotebook\\|treamPosition\\)\\)\\|[ct]\\)\\|h\\(a\\(ding\\|llow\\|re\\)\\|o\\(rt\\|w\\(AutoStyles\\|C\\(ell\\(Bracket\\|Label\\|Tags\\)\\|ursorTracker\\)\\|PageBreaks\\|S\\(election\\|pecialCharacters\\|tringCharacters\\)\\)?\\)\\)\\|i\\(gn\\(Padding\\|ature\\)?\\|mplify\\|n\\(Integral\\|g\\(leLetterItalics\\|ularValues\\)\\|h\\(Integral\\)?\\)?\\|xJSymbol\\)\\|k\\(eleton\\|ip\\)\\|lot\\(Sequence\\)?\\|o\\(lve\\(Always\\)?\\|rt\\|und\\)\\|p\\(ellingCorrection\\|herical\\(HarmonicY\\|Region\\)\\|li\\(ce\\|t\\)\\)\\|qrt\\(Box\\)?\\|t\\(a\\(ck\\(Begin\\|Complete\\|Inhibit\\)?\\|ndardForm\\)\\|i\\(eltjesGamma\\|rlingS[12]\\)\\|r\\(eam\\(Position\\|s\\)\\|ing\\(Drop\\|Form\\|Insert\\|Join\\|Length\\|MatchQ\\|Position\\|Re\\(place\\(Part\\)?\\|verse\\)\\|Skeleton\\|T\\(ake\\|oStream\\)\\)?\\|u\\(cturedSelection\\|ve[HL]\\)\\)\\|ub\\|yle\\(Box\\|Definitions\\|Form\\|Print\\)\\)\\|u\\(b\\(resultants\\|s\\(criptBox\\|uperscriptBox\\)\\|tract\\(From\\)?\\)\\|m\\|perscriptBox\\|rface\\(Color\\|Graphics\\)\\)\\|witch\\|y\\(mbol\\(Name\\)?\\|ntax\\(Length\\|Q\\)\\)\\)\\|T\\(a\\(ble\\(Alignments\\|D\\(epth\\|irections\\)\\|Form\\|Headings\\|Spacing\\)?\\|g\\(Box\\|Set\\(Delayed\\)?\\|Unset\\)\\|ke\\|nh?\\)\\|e\\(X\\(Form\\|Save\\)\\|mporary\\|nsorRank\\|xt\\(Alignment\\|Justification\\|Style\\)?\\)\\|h\\(ickness\\|r\\(e\\(ad\\|eJSymbol\\)\\|o\\(ugh\\|w\\)\\)\\)\\|i\\(cks\\|m\\(e\\(Constrain\\(ed\\|t\\)\\|Used\\|Zone\\|s\\(By\\)?\\)\\|ing\\)\\)\\|o\\(Boxes\\|CharacterCode\\|Date\\|Expression\\|FileName\\|LowerCase\\|R\\(adicals\\|ules\\)\\|String\\|UpperCase\\|gether\\|kenWords\\|talWidth\\)\\|r\\(a\\(ce\\(Above\\|Backward\\|D\\(epth\\|ialog\\)\\|Forward\\|O\\(ff\\|n\\|riginal\\)\\|Print\\|Scan\\)?\\|ditionalForm\\|ns\\(formationFunctions\\|pose\\)\\)\\|eeForm\\|ig\\(Expand\\|Factor\\(List\\)?\\|Reduce\\|ToExp\\)\\|ueQ?\\)?\\)\\|U\\(n\\(der\\(overscriptBox\\|scriptBox\\)\\|e\\(qual\\|valuated\\)\\|i\\(nstall\\|on\\|que\\|tStep\\)\\|protect\\|s\\(ameQ\\|et\\)\\)\\|p\\(Set\\(Delayed\\)?\\|Values\\|date\\|perCaseQ\\)\\)\\|V\\(a\\(lueQ\\|riables\\)\\|e\\(ctorQ\\|rbatim\\)\\|i\\(ew\\(Center\\|Point\\|Vertical\\)\\|sible\\)\\)\\|W\\(eierstrass\\(HalfPeriods\\|Invariants\\|P\\(Prime\\)?\\|Sigma\\|Zeta\\)\\|hi\\(ch\\|le\\)\\|i\\(ndow\\(ClickSelect\\|Elements\\|F\\(loating\\|rame\\)\\|M\\(argins\\|ovable\\)\\|Size\\|T\\(itle\\|oolbars\\)\\)\\|th\\)\\|or\\(d\\(Se\\(arch\\|parators\\)\\)?\\|kingPrecision\\)\\|rite\\(String\\)?\\)\\|Xor\\|Z\\(Transform\\|eta\\)\\|[CDEINO]\\)\\>" 1 font-lock-keyword-face)
-
+
; '("\\<\\(Abort\\|B\\(egin\\(\\|Package\\)\\|lock\\|reak\\)\\|C\\(atch\\|heck\\|ontinue\\)\\|Do\\|End\\(\\|Package\\)\\|For\\|Goto\\|If\\|Label\\|M\\(essage\\|odule\\)\\|Print\\|Return\\|Switch\\|Throw\\|W\\(hi\\(ch\\|le\\)\\|ith\\)\\)\\>" 1 font-lock-keyword-face)
- ;; a missing `;' in Mathematica code may cause magic effects. So
+ ;; a missing `;' in Mathematica code may cause magic effects. So
;; highlight it:
; '("\\(;\\)" 1 font-lock-keyword-face))
; "Subdued level highlighting for mathematica-m mode.")
mathematica-m-font-lock-keywords-1
'(
("\\(\\(-\\|:\\)>\\|//[.@]?\\|/[.@;:]\\|@@\\|#\\(#\\|[0-9]*\\)\\|&\\)" 1 font-lock-keyword-face append)
- ("([*]:[a-zA-Z-]*:[*])" 0 font-lock-keyword-face t)
+ ("([*]:[a-zA-Z-]*:[*])" 0 font-lock-keyword-face t)
;;; This pattern is just for internal use...
;;; ("([*]\\(:FILE-ID:\\).*:[*])" 1 font-lock-keyword-face t)
("\\(!=\\|=\\(!=\\|==?\\)\\)" 1 font-lock-reference-face)))
;(message "(run-hooks 'mathematica-m-mode-hook)")
(show-paren-mode) ; show matching parentheses in color.
- ; it seems, that it doesn't work for me: I have to call it interactively.
+ ; it seems, that it doesn't work for me: I have to call it interactively.
(setq debug-flag 1)
)
;; the current value is appropriate for Mathematica 1.0 - 4.2
;;
;; `mathematica-comint-hook' is invoked in the *mathematica* once it is started.
-;;
+;;
;;; All functions/variables start with
;;; `(turn-(on/off)-)mathematica' or `mathematica-comint-'.
(defun mathematica-comint-load ()
""
(interactive)
-
+
; save the current buffer.
; load its contents into mathematica.
- (save-excursion (mathematica-comint-execute-get))
+ (save-excursion (mathematica-comint-execute-get))
; (set-buffer mathematica-comint-process-buffer) + making it visible:
(pop-to-buffer mathematica-comint-process-buffer)
; was:(set-buffer mathematica-comint-process-buffer)
; is:
; (set-buffer mathematica-comint-process-buffer) + making it visible:
- ; This function makes buffer-or-name the current buffer and switches to it in some window,
- ; preferably not the window previously selected. The "popped-to" window becomes the selected
- ; window within its frame.
+ ; This function makes buffer-or-name the current buffer and switches to it in some window,
+ ; preferably not the window previously selected. The "popped-to" window becomes the selected
+ ; window within its frame.
(pop-to-buffer mathematica-comint-process-buffer)
; reason: to make (window-width), for Mathematicas PageWidth option, work.
)
; (save-excursion (mathematica-comint-execute-get))
-; Get[...]; main[];
+; Get[...]; main[];
(defun mathematica-comint-execute-get ();(load-command cd)
"Save the current buffer and load its file into the Mathematica process."
(let (file)
;; ;; Ensure the Mathematica buffer is selected.
;; (set-buffer mathematica-comint-process-buffer)
;; ;; Start Mathematica process.
-;; (mathematica-comint-start-process))
+;; (mathematica-comint-start-process))
;; why?:
;; Wait until output arrives and go to the last input.
; Here's a workaround for the problem with // Short:
;SetOptions[$Output, PageWidth-> Infinity];Block[{Short=Identity},Get["c:/Documents and Settings/burki/My Documents/systems/Mathematica/BurkisMathematicaToolsAdditions_Backup1.m"]];SetOptions[$Output, PageWidth-> 78];
- (mathematica-comint-send
+ (mathematica-comint-send
(format "SetOptions[$Output, PageWidth-> Infinity]; Block[{Short=Identity},Get[\"%s\"]]; SetOptions[$Output, PageWidth-> %d];" (mathematica-comint-quote-filename file) (- (window-width) 1)))
; the necessity for -1 was found by experimentation.
; trouble: it takes the window-width of the *.m buffer, not of the *mathematica* comint buffer.
;; if the user wants to execute main[] indeed, then he can add such a call to his source file.
; (mathematica-comint-send "main[];")
-
-
+
+
;; Wait until output arrives and go to the last input.
; (mathematica-comint-wait-for-output)
)
; (mathematica-comint-show-errors)
(defun mathematica-comint-find-error ()
- "If there is an error, set the cursor at the
+ "If there is an error, set the cursor at the
error line, otherwise show the Mathematica buffer."
(interactive)
(set-buffer mathematica-comint-process-buffer)
(goto-char comint-last-input-start)
(if (re-search-forward
- ; eg: Syntax::sntx: Syntax error in or before "SetAttributes[BatchResult, HoldAllComplete[; ".
+ ; eg: Syntax::sntx: Syntax error in or before "SetAttributes[BatchResult, HoldAllComplete[; ".
; eg: (line 1 of "c:/examples/test.m")
"^\\(.*\\)(line \\([0-9]+\\) of \"\\(.*\\)\")" nil t)
(let ( ; Unfortunately, Mathematica applies //Short to the filename.
; so efile is often nonsense like
; "c:/Documents and Settin<<42>>rki/mathematica.el"
- (efile (buffer-substring (match-beginning 3)
+ (efile (buffer-substring (match-beginning 3)
(match-end 3)))
(eline (string-to-int (buffer-substring (match-beginning 2)
(match-end 2))))
- (emesg (buffer-substring (match-beginning 1)
+ (emesg (buffer-substring (match-beginning 1)
(match-end 1)))
)
; is this a kind of clean-up?
- ;(pop-to-buffer mathematica-comint-process-buffer)
+ ;(pop-to-buffer mathematica-comint-process-buffer)
(goto-char (point-max))
;(recenter)
(goto-line eline)
; maybe that would be better in case of several files.
- ; difficulty: to resolve efile in the same way as Matheamtica does.
+ ; difficulty: to resolve efile in the same way as Matheamtica does.
; we should call Mathematica for doing the resolving.
; (if (file-exists-p efile)
; (progn (find-file-other-window efile)
) ; let
-; else
+; else
(progn
;(pop-to-buffer mathematica-comint-process-buffer) ; show *mathematica* buffer
(goto-char (point-max))
;; (mathematica-comint-start-process))
;; (pop-to-buffer mathematica-comint-process-buffer)
;; )
-