Add TSU format: Unicode version of TS style files (#2772)#2839
Open
Eshaan-byte wants to merge 1 commit intoMoganLab:mainfrom
Open
Add TSU format: Unicode version of TS style files (#2772)#2839Eshaan-byte wants to merge 1 commit intoMoganLab:mainfrom
Eshaan-byte wants to merge 1 commit intoMoganLab:mainfrom
Conversation
Add the TSU file format for style files, providing native UTF-8 encoding support as an alternative to the cork-encoded TS format. This mirrors the relationship between TMU and TM formats. New files: - src/Data/Convert/Mogan/to_tsu.cpp: TSU serializer - src/Data/Convert/Mogan/from_tsu.cpp: TSU parser - TeXmacs/plugins/tsu/progs/data/tsu.scm: Scheme format plugin Modified files for full integration: - Extract shared mogan_tree_serialize() helper from to_tmu.cpp - Add TSU Scheme bindings in glue_convert.lua - Register TSU format in init-research.scm - Support .tsu in file I/O, style resolution, and caching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#Summary:
Implements the TSU file format (Unicode version of TS style files), resolving #2772
TSU is to TS as TMU is to TM — stores style file content in native UTF-8 instead of cork encoding hex escapes
Adds full read/write support including style resolution, cache handling, and autosave
#Changes:
New files: to_tsu.cpp, from_tsu.cpp (C++ serializer/parser), tsu.scm (Scheme plugin)
Modified: to_tmu.cpp (extracted shared mogan_tree_serialize helper), convert.hpp, glue_convert.lua, init-research.scm, tm-files.scm, tm-server.scm, new_buffer.cpp, new_style.cpp, env_exec.cpp, data_cache.cpp
#Test plan:
Build compiles successfully
Save an existing .ts style file as .tsu and verify the header starts with <TSU|<tuple|
Verify Unicode characters are stored as native UTF-8 (not hex escapes)
Verify loading a .tsu file as a style package works correctly
Verify style cache is cleared when saving .tsu files