diff --git a/TeXmacs/progs/table/table-menu.scm b/TeXmacs/progs/table/table-menu.scm index aca65903de..7ce19ed16d 100644 --- a/TeXmacs/progs/table/table-menu.scm +++ b/TeXmacs/progs/table/table-menu.scm @@ -553,6 +553,14 @@ --- ("Table properties" (open-table-properties))))) +(tm-define (focus-tag-name l) + (:require (== l 'tabular*)) + "centered tabular") + +(tm-define (focus-tag-name l) + (:require (== l 'block*)) + "centered block") + (define (cell-halign-icon) (with h (cell-get-format "cell-halign") (cond ((== h "l") "tm_cell_left.xpm") diff --git a/devel/202_106.md b/devel/202_106.md new file mode 100644 index 0000000000..b6b6ab138b --- /dev/null +++ b/devel/202_106.md @@ -0,0 +1,24 @@ +# [202_106] Fix duplicate names in table environment switching dropdown + +### How to test +1. Open Mogan +2. Insert a table using `Alt+t` +3. Click the "tabular" dropdown on the focus toolbar +4. Verify all 6 variants have distinct names: + - 小表格 (small table) + - 大表格 (big table) + - 无框表格 (tabular) + - 居中无框表格 (centered tabular) + - 有框表格 (block) + - 居中有框表格 (centered block) + +## 2026/02/27 +### What +Added `focus-tag-name` overrides for `tabular*` and `block*` in `TeXmacs/progs/table/table-menu.scm` so they display as "centered tabular" and "centered block" respectively. + +### Why +The `focus-tag-name` function strips the `*` suffix from `tabular*` and `block*` (treating them as unnumbered variants of `tabular` and `block`), causing both pairs to display the same name in the table variant dropdown. This results in two duplicate entries: "无框表格" appears twice and "有框表格" appears twice. + +The fix adds explicit `focus-tag-name` dispatches for these two tags, using translation keys ("centered tabular" / "centered block") that already exist in all language dictionaries. + +Fixes: https://github.com/XmacsLabs/mogan/issues/2782