Skip to content

Comments

Add TSU format: Unicode version of TS style files (#2772)#2839

Open
Eshaan-byte wants to merge 1 commit intoMoganLab:mainfrom
Eshaan-byte:feature/tsu-format
Open

Add TSU format: Unicode version of TS style files (#2772)#2839
Eshaan-byte wants to merge 1 commit intoMoganLab:mainfrom
Eshaan-byte:feature/tsu-format

Conversation

@Eshaan-byte
Copy link

#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

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
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

Successfully merging this pull request may close these issues.

1 participant