From b634c5f9a40ed671c5c30209f3b2337857575188 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Wed, 27 Mar 2024 22:46:54 +0800 Subject: [PATCH] [71_36] focus tag first letter doesn't need to be upper case ## What On the focus toolbar, both `bmatrix` and `Bmatrix` is displayed as `Bmatrix`. This pull request fix the bug. It was ported from branch-1.1, the original author is @Yufeng-shen ## Why Fix ambiguity. ## How to test your changes? ``` xmake r generic-test ``` --------- Co-authored-by: Yufeng Shen --- TeXmacs/progs/generic/generic-menu.scm | 2 +- TeXmacs/progs/generic/generic-test.scm | 32 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 TeXmacs/progs/generic/generic-test.scm diff --git a/TeXmacs/progs/generic/generic-menu.scm b/TeXmacs/progs/generic/generic-menu.scm index d4d22bd912..07aba72a6f 100644 --- a/TeXmacs/progs/generic/generic-menu.scm +++ b/TeXmacs/progs/generic/generic-menu.scm @@ -35,7 +35,7 @@ (focus-tag-name (string->symbol ns))) (if (symbol-unnumbered? l) (focus-tag-name (symbol-drop-right l 1)) - (with r (upcase-first (tree-name (tree l))) + (with r (tree-name (tree l)) (string-replace r "-" " ")))))) (tm-menu (focus-variant-menu t) diff --git a/TeXmacs/progs/generic/generic-test.scm b/TeXmacs/progs/generic/generic-test.scm new file mode 100644 index 0000000000..00909792c1 --- /dev/null +++ b/TeXmacs/progs/generic/generic-test.scm @@ -0,0 +1,32 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; MODULE : generic-test.scm +;; DESCRIPTION : Test suite for generic +;; COPYRIGHT : (C) 2022 Yufeng Shen +;; +;; This software falls under the GNU general public license version 3 or later. +;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE +;; in the root directory or . +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(texmacs-module (generic generic-test) + (:use (generic generic-menu) )) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; generic menu functions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (regtest-focus-tag-name) + (regression-test-group + "focus-tag-name" "string" + focus-tag-name :none + (test "bmatrix" 'bmatrix "bmatrix") + (test "Bmatrix" 'Bmatrix "Bmatrix") + )) + +(tm-define (regtest-generic) + (let ((n (+ (regtest-focus-tag-name) + ))) + (display* "Total: " (object->string n) " tests.\n") + (display "Test suite of generic: ok\n"))) \ No newline at end of file