Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wolfram-run-script does not respect wolfram-program #10

Open
ymei opened this issue Nov 6, 2018 · 5 comments
Open

wolfram-run-script does not respect wolfram-program #10

ymei opened this issue Nov 6, 2018 · 5 comments

Comments

@ymei
Copy link

ymei commented Nov 6, 2018

wolfram-run-script does not respect the user-set value in wolfram-program. And there are a few warnings concerning unescaped symbols. I'd like to offer the following patch:

diff --git a/wolfram-mode.el b/wolfram-mode.el
index b77c746..500e8f3 100644
--- a/wolfram-mode.el
+++ b/wolfram-mode.el
@@ -142,13 +142,13 @@ See `run-hooks'."
     (modify-syntax-entry ?\^m " " syntax-table)
 
     ;; comments and parens
-    (modify-syntax-entry ?( "()1n" syntax-table)
-    (modify-syntax-entry ?) ")(4n" syntax-table)
+    (modify-syntax-entry ?\( "()1n" syntax-table)
+    (modify-syntax-entry ?\) ")(4n" syntax-table)
     (modify-syntax-entry ?* "_ 23n" syntax-table)
 
     ;; pure parens
-    (modify-syntax-entry ?[ "(]" syntax-table)
-    (modify-syntax-entry ?] ")[" syntax-table)
+    (modify-syntax-entry ?\[ "(]" syntax-table)
+    (modify-syntax-entry ?\] ")[" syntax-table)
     (modify-syntax-entry ?{ "(}" syntax-table)
     (modify-syntax-entry ?} "){" syntax-table)
 
@@ -298,7 +298,7 @@ See `run-hooks'."
     (`(,_ . ";") (smie-rule-separator kind))
     (`(,_ . ",") (smie-rule-separator kind))
     (`(:elem . ,_) 0)
-    (t nil)))
+    (`(_ nil))))
 
 (defalias 'wolfram-smie-forward-token 'smie-default-forward-token)
 (defalias 'wolfram-smie-backward-token 'smie-default-backward-token)
@@ -450,7 +450,7 @@ if that value is non-nil."
     ;; Call Mathematica
     (call-process-shell-command (concat "cd "
                                        cur-dir
-                                       "; MathKernel -script "
+                                        "; " wolfram-program " -script "
                                        cur-file)
                                nil output-buffer)
@kenkangxgwe
Copy link
Contributor

kenkangxgwe commented Nov 6, 2018

It seems that wolfram-program is not a universal name for all platforms. I wonder if there is a WolframKernel in your system?

@ymei
Copy link
Author

ymei commented Nov 6, 2018

By default, Mathematica 11.3 installs /usr/local/bin/WolframKernel on linux and /Applications/Mathematica.app/Contents/MacOS/WolframKernel on macOS

@kenkangxgwe
Copy link
Contributor

Then, what about using WolframKernel instead?

@ymei
Copy link
Author

ymei commented Nov 6, 2018

wolfram-program is a customizable variable. Users may change its value as they wish. My patch refers to using this variable for both wolfram-run-script and run-wolfram. Which value wolfram-program is set to (by default) is a separate issue. If you are suggesting to set wolfram-program to WolframKernel by default, I am fine with it. The proposed changes in the patch remain though.

@zhonghzhao
Copy link

I want to know how to set up in the windows system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants