From 9c328c36d41f095e1b42ab63040e43e47634a3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E8=BE=BE?= Date: Sun, 27 Jun 2021 23:42:11 +0800 Subject: [PATCH 1/7] SageMath: win --- sage/progs/init-sage.scm | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sage/progs/init-sage.scm b/sage/progs/init-sage.scm index 4e3a606..7f9f749 100644 --- a/sage/progs/init-sage.scm +++ b/sage/progs/init-sage.scm @@ -30,20 +30,23 @@ (with s (texmacs->code (stree->tree u) "SourceCode") (string-append s "\n\n")))) -(define (sage-launchers) +(define (sage-entry) (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy") - `((:launch ,(string-append "sage -python " - (getenv "TEXMACS_HOME_PATH") - "/plugins/tmpy/session/tm_sage.py"))) - `((:launch ,(string-append "sage -python " - (getenv "TEXMACS_PATH") - "/plugins/tmpy/session/tm_sage.py"))))) + (system-url->string "$TEXMACS_HOME_PATH/plugins/tmpy/session/tm_sage.py") + (system-url->string "$TEXMACS_PATH/plugins/tmpy/session/tm_sage.py"))) + +(define (sage-launchers) + (if (os-mingw?) + `((:launch ,(string-append (raw-quote "C:\\Program Files\\SageMath 9.2\\runtime\\bin\\bash.exe") + " --login -c '/opt/sagemath-9.2/sage -python /cygdrive/c/Program\\ Files/Xmacs/plugins/tmpy/session/tm_sage.py'"))) + `((:launch ,(string-append "sage -python " (sage-entry)))))) + + (plugin-configure sage - (:winpath "Sage*" "bin") - (:winpath "Sage*/runtime" "bin") + (:winpath "SageMath*/runtime/opt" "sagemath-9.2") (:macpath "Sage*" "Contents/Resources/sage") - (:require (url-exists-in-path? "sage")) + ;(:require (url-exists-in-path? "sage")) ,@(sage-launchers) (:tab-completion #t) (:serializer ,sage-serialize) -- Gitee From b12949f060d6e0cf7d131c881b40a1fdb7655329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E8=BE=BE?= Date: Sat, 3 Jul 2021 15:40:03 +0800 Subject: [PATCH 2/7] attempt --- sage/progs/init-sage.scm | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/sage/progs/init-sage.scm b/sage/progs/init-sage.scm index 7f9f749..2740d54 100644 --- a/sage/progs/init-sage.scm +++ b/sage/progs/init-sage.scm @@ -30,23 +30,50 @@ (with s (texmacs->code (stree->tree u) "SourceCode") (string-append s "\n\n")))) +(define (texmacs-cygwin-path) + (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy") + (string-replace + (string-replace + (string-replace (getenv "TEXMACS_HOME_PATH") + "C:" "/cygdrive/c") + "\\" "/") + " " "\\ ") + (string-replace + (string-replace + (string-replace (getenv "TEXMACS_PATH") + "C:" "/cygdrive/c") + "\\" "/") + " " "\\ "))) + (define (sage-entry) (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy") (system-url->string "$TEXMACS_HOME_PATH/plugins/tmpy/session/tm_sage.py") (system-url->string "$TEXMACS_PATH/plugins/tmpy/session/tm_sage.py"))) +(define (sage-version) + "9.2") + +(define (sage-path) + (string-append "C:\\Program Files\\SageMath " (sage-version))) + +(define (sage-entry-mingw) + (string-append (texmacs-cygwin-path) "/tmpy/session/tm_sage.py") + (define (sage-launchers) (if (os-mingw?) - `((:launch ,(string-append (raw-quote "C:\\Program Files\\SageMath 9.2\\runtime\\bin\\bash.exe") - " --login -c '/opt/sagemath-9.2/sage -python /cygdrive/c/Program\\ Files/Xmacs/plugins/tmpy/session/tm_sage.py'"))) + `((:launch ,(string-append (raw-quote (string-append (sage-path) "\\runtime\\bin\\bash.exe")) + (string-append + (string-append " --login -c '/opt/sagemath-" + (sage-version) + "/sage -python " + (sage-entry-mingw) + "'"))))) `((:launch ,(string-append "sage -python " (sage-entry)))))) - - (plugin-configure sage - (:winpath "SageMath*/runtime/opt" "sagemath-9.2") + (:winpath "SageMath*/runtime/opt" (string-append "sagemath-" (sage-version))) (:macpath "Sage*" "Contents/Resources/sage") - ;(:require (url-exists-in-path? "sage")) + (:require (or (url-exists-in-path? "sage") (os-mingw?))) ,@(sage-launchers) (:tab-completion #t) (:serializer ,sage-serialize) -- Gitee From 97dc4a4cb0c2805e487aa6245cd64bc504ebc268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E8=BE=BE?= Date: Sat, 3 Jul 2021 16:11:47 +0800 Subject: [PATCH 3/7] Revert "attempt" This reverts commit b12949f060d6e0cf7d131c881b40a1fdb7655329. --- sage/progs/init-sage.scm | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/sage/progs/init-sage.scm b/sage/progs/init-sage.scm index 2740d54..7f9f749 100644 --- a/sage/progs/init-sage.scm +++ b/sage/progs/init-sage.scm @@ -30,50 +30,23 @@ (with s (texmacs->code (stree->tree u) "SourceCode") (string-append s "\n\n")))) -(define (texmacs-cygwin-path) - (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy") - (string-replace - (string-replace - (string-replace (getenv "TEXMACS_HOME_PATH") - "C:" "/cygdrive/c") - "\\" "/") - " " "\\ ") - (string-replace - (string-replace - (string-replace (getenv "TEXMACS_PATH") - "C:" "/cygdrive/c") - "\\" "/") - " " "\\ "))) - (define (sage-entry) (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy") (system-url->string "$TEXMACS_HOME_PATH/plugins/tmpy/session/tm_sage.py") (system-url->string "$TEXMACS_PATH/plugins/tmpy/session/tm_sage.py"))) -(define (sage-version) - "9.2") - -(define (sage-path) - (string-append "C:\\Program Files\\SageMath " (sage-version))) - -(define (sage-entry-mingw) - (string-append (texmacs-cygwin-path) "/tmpy/session/tm_sage.py") - (define (sage-launchers) (if (os-mingw?) - `((:launch ,(string-append (raw-quote (string-append (sage-path) "\\runtime\\bin\\bash.exe")) - (string-append - (string-append " --login -c '/opt/sagemath-" - (sage-version) - "/sage -python " - (sage-entry-mingw) - "'"))))) + `((:launch ,(string-append (raw-quote "C:\\Program Files\\SageMath 9.2\\runtime\\bin\\bash.exe") + " --login -c '/opt/sagemath-9.2/sage -python /cygdrive/c/Program\\ Files/Xmacs/plugins/tmpy/session/tm_sage.py'"))) `((:launch ,(string-append "sage -python " (sage-entry)))))) + + (plugin-configure sage - (:winpath "SageMath*/runtime/opt" (string-append "sagemath-" (sage-version))) + (:winpath "SageMath*/runtime/opt" "sagemath-9.2") (:macpath "Sage*" "Contents/Resources/sage") - (:require (or (url-exists-in-path? "sage") (os-mingw?))) + ;(:require (url-exists-in-path? "sage")) ,@(sage-launchers) (:tab-completion #t) (:serializer ,sage-serialize) -- Gitee From fe6872b3b0111c5dfeb3072f4f1372c744b7dfed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E8=BE=BE?= Date: Sat, 3 Jul 2021 16:44:18 +0800 Subject: [PATCH 4/7] sage --- sage/progs/init-sage.scm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sage/progs/init-sage.scm b/sage/progs/init-sage.scm index 7f9f749..813eb27 100644 --- a/sage/progs/init-sage.scm +++ b/sage/progs/init-sage.scm @@ -35,10 +35,28 @@ (system-url->string "$TEXMACS_HOME_PATH/plugins/tmpy/session/tm_sage.py") (system-url->string "$TEXMACS_PATH/plugins/tmpy/session/tm_sage.py"))) +(define (sage-version) "9.2") + +(define (texmacs-cygwin-path) + (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy") + (string-replace + (string-replace + (string-replace (getenv "TEXMACS_HOME_PATH") + "C:" "/cygdrive/c") + "\\" "/") + " " "\\ ") + (string-replace + (string-replace + (string-replace (getenv "TEXMACS_PATH") + "C:" "/cygdrive/c") + "\\" "/") + " " "\\ "))) + + (define (sage-launchers) (if (os-mingw?) - `((:launch ,(string-append (raw-quote "C:\\Program Files\\SageMath 9.2\\runtime\\bin\\bash.exe") - " --login -c '/opt/sagemath-9.2/sage -python /cygdrive/c/Program\\ Files/Xmacs/plugins/tmpy/session/tm_sage.py'"))) + `((:launch ,(string-append "\"C:\\Program Files\\SageMath " (sage-version) "\\runtime\\bin\\bash.exe\"" + " --login -c '/opt/sagemath-" (sage-version) "/sage -python " (texmacs-cygwin-path) "/plugins/tmpy/session/tm_sage.py'"))) `((:launch ,(string-append "sage -python " (sage-entry)))))) -- Gitee From b9ee650160a450dc4daaab87608c75e5090be48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E8=BE=BE?= Date: Sat, 3 Jul 2021 16:46:42 +0800 Subject: [PATCH 5/7] indent --- sage/progs/init-sage.scm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sage/progs/init-sage.scm b/sage/progs/init-sage.scm index 813eb27..be0ac19 100644 --- a/sage/progs/init-sage.scm +++ b/sage/progs/init-sage.scm @@ -38,19 +38,19 @@ (define (sage-version) "9.2") (define (texmacs-cygwin-path) - (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy") - (string-replace - (string-replace - (string-replace (getenv "TEXMACS_HOME_PATH") - "C:" "/cygdrive/c") - "\\" "/") - " " "\\ ") - (string-replace - (string-replace - (string-replace (getenv "TEXMACS_PATH") - "C:" "/cygdrive/c") - "\\" "/") - " " "\\ "))) + (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy") + (string-replace + (string-replace + (string-replace (getenv "TEXMACS_HOME_PATH") + "C:" "/cygdrive/c") + "\\" "/") + " " "\\ ") + (string-replace + (string-replace + (string-replace (getenv "TEXMACS_PATH") + "C:" "/cygdrive/c") + "\\" "/") + " " "\\ "))) (define (sage-launchers) -- Gitee From b2a7204fb0545555aa8a81a56dc3d333d7bc0f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E8=BE=BE?= Date: Sat, 3 Jul 2021 17:02:21 +0800 Subject: [PATCH 6/7] sage --- sage/progs/init-sage.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sage/progs/init-sage.scm b/sage/progs/init-sage.scm index be0ac19..cd1a23f 100644 --- a/sage/progs/init-sage.scm +++ b/sage/progs/init-sage.scm @@ -59,12 +59,16 @@ " --login -c '/opt/sagemath-" (sage-version) "/sage -python " (texmacs-cygwin-path) "/plugins/tmpy/session/tm_sage.py'"))) `((:launch ,(string-append "sage -python " (sage-entry)))))) +(define (sage-folder) + (string-append "sagemath-" (sage-version))) +(define (sage-winpath) + `((:winpath "SageMath*/runtime/opt" ,(sage-folder)))) (plugin-configure sage - (:winpath "SageMath*/runtime/opt" "sagemath-9.2") + ,@(sage-winpath) (:macpath "Sage*" "Contents/Resources/sage") - ;(:require (url-exists-in-path? "sage")) + (:require (url-exists-in-path? "sage")) ,@(sage-launchers) (:tab-completion #t) (:serializer ,sage-serialize) -- Gitee From f8d1d51ba3f4b1c8484d818afb46145e7bf7e26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E8=BE=BE?= Date: Sat, 3 Jul 2021 17:12:52 +0800 Subject: [PATCH 7/7] Who invent Program Files (x86) --- sage/progs/init-sage.scm | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/sage/progs/init-sage.scm b/sage/progs/init-sage.scm index cd1a23f..ce5279d 100644 --- a/sage/progs/init-sage.scm +++ b/sage/progs/init-sage.scm @@ -40,17 +40,25 @@ (define (texmacs-cygwin-path) (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy") (string-replace - (string-replace - (string-replace (getenv "TEXMACS_HOME_PATH") - "C:" "/cygdrive/c") - "\\" "/") - " " "\\ ") - (string-replace - (string-replace - (string-replace (getenv "TEXMACS_PATH") - "C:" "/cygdrive/c") - "\\" "/") - " " "\\ "))) + (string-replace + (string-replace + (string-replace + (string-replace (getenv "TEXMACS_HOME_PATH") + "C:" "/cygdrive/c") + "\\" "/") + " " "\\ ") + "(" "\\(") + ")" "\\)") + (string-replace + (string-replace + (string-replace + (string-replace + (string-replace (getenv "TEXMACS_PATH") + "C:" "/cygdrive/c") + "\\" "/") + " " "\\ ") + "(" "\\(") + ")" "\\)"))) (define (sage-launchers) -- Gitee