From 3495cb06c2c7945e5bd2070ef603c1dac7360c14 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Mon, 11 Dec 2023 01:14:30 +0800 Subject: [PATCH] wip --- TeXmacs/progs/source/shortcut-widgets.scm | 2 +- src/Scheme/L3/glue_url.lua | 4 ++-- src/System/Classes/tm_url.cpp | 5 ----- src/System/Classes/tm_url.hpp | 1 - src/System/Classes/tmfs_url.cpp | 6 ------ src/Texmacs/Data/new_buffer.cpp | 2 +- src/Texmacs/Data/new_view.cpp | 2 +- src/Texmacs/Window/tm_window.cpp | 2 +- 8 files changed, 6 insertions(+), 18 deletions(-) diff --git a/TeXmacs/progs/source/shortcut-widgets.scm b/TeXmacs/progs/source/shortcut-widgets.scm index 6869c74566..f537a3a079 100644 --- a/TeXmacs/progs/source/shortcut-widgets.scm +++ b/TeXmacs/progs/source/shortcut-widgets.scm @@ -76,7 +76,7 @@ (tm-define (open-shortcuts-editor . opt) (:interactive #t) (let* ((b (current-buffer)) - (u (string->url (string-append "tmfs://aux/edit-shortcuts"))) + (u (string-append "tmfs://aux/edit-shortcuts")) (sh (if (null? opt) "" (car opt))) (cmd (if (or (null? opt) (null? (cdr opt))) "" (cadr opt)))) (dialogue-window (shortcuts-editor u sh cmd) diff --git a/src/Scheme/L3/glue_url.lua b/src/Scheme/L3/glue_url.lua index 8cb6e61fe9..f4e7d361f4 100644 --- a/src/Scheme/L3/glue_url.lua +++ b/src/Scheme/L3/glue_url.lua @@ -100,7 +100,7 @@ function main() }, { scm_name = "string->url", - cpp_name = "tm_url", + cpp_name = "url", ret_type = "url", arg_list = { "string" @@ -125,7 +125,7 @@ function main() }, { scm_name = "unix->url", - cpp_name = "tm_url", + cpp_name = "url", ret_type = "url", arg_list = { "string" diff --git a/src/System/Classes/tm_url.cpp b/src/System/Classes/tm_url.cpp index 9461cc5a93..ba66eab7ec 100644 --- a/src/System/Classes/tm_url.cpp +++ b/src/System/Classes/tm_url.cpp @@ -70,11 +70,6 @@ #include "analyze.hpp" #include "scheme.hpp" -url tm_url (string name) { - if (starts (name, "tmfs://")) return tmfs_url (name (7, N (name))); - else return url_general (name, URL_UNIX); -} - bool url_test (url name, string filter) { if (filter == "") return true; int i, n= N(filter); diff --git a/src/System/Classes/tm_url.hpp b/src/System/Classes/tm_url.hpp index 1c76965a66..9b8747b708 100644 --- a/src/System/Classes/tm_url.hpp +++ b/src/System/Classes/tm_url.hpp @@ -15,7 +15,6 @@ #include "tree.hpp" #include "tm_debug.hpp" -url tm_url (string name); bool is_secure (url u); // is u secure? /****************************************************************************** diff --git a/src/System/Classes/tmfs_url.cpp b/src/System/Classes/tmfs_url.cpp index da028a2576..61a5d7f1cd 100644 --- a/src/System/Classes/tmfs_url.cpp +++ b/src/System/Classes/tmfs_url.cpp @@ -12,12 +12,6 @@ #include "tmfs_url.hpp" -tmfs_url::tmfs_url (string name) - : url (url_root ("tmfs") * url_get_name (name)) {} - -tmfs_url::tmfs_url (const char* name) - : url (url_root ("tmfs") * url_get_name (string (name))) {} - bool is_tmfs_protocol (url u, string protocol) { return u->t == protocol || diff --git a/src/Texmacs/Data/new_buffer.cpp b/src/Texmacs/Data/new_buffer.cpp index 65eb1f5e66..66b6406ca6 100644 --- a/src/Texmacs/Data/new_buffer.cpp +++ b/src/Texmacs/Data/new_buffer.cpp @@ -588,7 +588,7 @@ latex_expand (tree doc, url name) { tree latex_expand (tree doc) { - tm_view vw= concrete_view (tm_url (as_string (extract (doc, "view")))); + tm_view vw= concrete_view (url_system (as_string (extract (doc, "view")))); tree body= vw->ed->exec_latex (extract (doc, "body")); doc= change_doc_attr (doc, "body", body); return remove_doc_attr (doc, "view"); diff --git a/src/Texmacs/Data/new_view.cpp b/src/Texmacs/Data/new_view.cpp index f7b60ab5f4..f589694d93 100644 --- a/src/Texmacs/Data/new_view.cpp +++ b/src/Texmacs/Data/new_view.cpp @@ -72,7 +72,7 @@ abstract_view (tm_view vw) { string name= encode_url (vw->buf->buf->name); //cout << vw->buf->buf->name << " -> " << name << "\n"; string nr = as_string (vw->nr); - return tm_url ("tmfs://view/" * nr * "/" * name); + return url_system ("tmfs://view/" * nr * "/" * name); } tm_view diff --git a/src/Texmacs/Window/tm_window.cpp b/src/Texmacs/Window/tm_window.cpp index 6a0e61294b..a4271f4415 100644 --- a/src/Texmacs/Window/tm_window.cpp +++ b/src/Texmacs/Window/tm_window.cpp @@ -268,7 +268,7 @@ embedded_name (url name) { static int nr= 0; if (!is_none (name)) return name; nr++; - return tm_url (string ("tmfs://aux/TeXmacs-input-" * as_string (nr))); + return url_system (string ("tmfs://aux/TeXmacs-input-" * as_string (nr))); } tree