Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions TeXmacs/progs/table/table-menu.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +556 to +560
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR changes focus-tag-name dispatch for tabular*/block*, but there is already a regression-test group for focus-tag-name in TeXmacs/progs/generic/generic-test.scm. Please add/extend a regression test to cover these two symbols so the dropdown naming behavior doesn’t regress.

Copilot uses AI. Check for mistakes.
(:require (== l 'block*))
"centered block")

(define (cell-halign-icon)
(with h (cell-get-format "cell-halign")
(cond ((== h "l") "tm_cell_left.xpm")
Expand Down
24 changes: 24 additions & 0 deletions devel/202_106.md
Original file line number Diff line number Diff line change
@@ -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
Loading