Re: [DRAFT PATCH v5] Decouple LANG= and testing (was: Test failure due to LANG)

2023-07-17 Thread Ihor Radchenko
Ihor Radchenko writes: > Ruijie Yu writes: > >> Ihor Radchenko writes: >> >>> (let ((org-time-stamp-formats '("%Y-%m-%d" . "%Y-%m-%d %H:%M"))) >>> (org-element-timestamp-interpreter timestamp nil)) >> >> Thanks for the pointer. I have made this into a macro and redid my >> changes

Re: [DRAFT PATCH v6] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-26 Thread Ihor Radchenko
Ruijie Yu via "General discussions about Org-mode." writes: > Iteration v6. Everything, other than the French test and the > batch-non-batch Chinese test, now passes. I'll look up how to determine > whether we are in batch mode or not, and slap that onto the expect tag > for

Re: [DRAFT PATCH v5] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-26 Thread Ihor Radchenko
Ruijie Yu writes: > Ihor Radchenko writes: > >> (let ((org-time-stamp-formats '("%Y-%m-%d" . "%Y-%m-%d %H:%M"))) >> (org-element-timestamp-interpreter timestamp nil)) > > Thanks for the pointer. I have made this into a macro and redid my > changes accordingly. Please also let me know if

Re: [DRAFT PATCH v6] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-25 Thread General discussions about Org-mode.
Ruijie Yu via "General discussions about Org-mode." writes: > Ihor Radchenko writes: > >> (let ((org-time-stamp-formats '("%Y-%m-%d" . "%Y-%m-%d %H:%M"))) >> (org-element-timestamp-interpreter timestamp nil)) > > Thanks for the pointer. I have made this into a macro and redid my >

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-25 Thread General discussions about Org-mode.
Ihor Radchenko writes: >> +(defun org-columns--substring-below-width (string start width) >> + "Similar to `substring', but use `string-width' to check width. > > This is not really similar to `substring' as `substring' has totally > different third argument. Addressed in v6 -- see my update

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-25 Thread Ihor Radchenko
Ruijie Yu writes: > Just had a try at this, fully untested code (other than starting a > LANG=zh_CN.UTF-8 Emacs session and running this substring function to > see its effects). Thanks! > +(defun org-columns--substring-below-width (string start width) > + "Similar to `substring', but use

Re: [DRAFT PATCH v5] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-25 Thread General discussions about Org-mode.
Ihor Radchenko writes: > (let ((org-time-stamp-formats '("%Y-%m-%d" . "%Y-%m-%d %H:%M"))) > (org-element-timestamp-interpreter timestamp nil)) Thanks for the pointer. I have made this into a macro and redid my changes accordingly. Please also let me know if more work should be dedicated

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-23 Thread General discussions about Org-mode.
Ihor Radchenko writes: > Ruijie Yu writes: > >>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63029 >> >> From my understanding of Eli's response, org-colview is at fault here, by >> calling `length' instead of `string-width' in >> `org-columns-add-ellipses'. Changing this function call

Re: [DRAFT PATCH v4] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-23 Thread Ihor Radchenko
Ruijie Yu writes: >> I recommend `org-element-timestamp-parser' for analysis. > > Thanks for pointing that out! I didn't realize it was there. Although, > I don't think I can use this function as-is, nor its internal regexps: > all the relevant tests where I used `org-test-timestamp-regexp'

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-23 Thread Ihor Radchenko
Ruijie Yu writes: >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63029 > > From my understanding of Eli's response, org-colview is at fault here, by > calling `length' instead of `string-width' in > `org-columns-add-ellipses'. Changing this function call might be all it > needs to fix the

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-23 Thread General discussions about Org-mode.
Ihor Radchenko writes: > Ruijie Yu writes: > (format "%-5.5s |" "1234…") returns different results for different locales, causing `test-org-colview/columns-width' to break. >>> >>> What are these different results? >> >> In CJK locales such as zh_CN and ja_JA, the

Re: [DRAFT PATCH v4] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-23 Thread General discussions about Org-mode.
Ihor Radchenko writes: > Ruijie Yu via "General discussions about Org-mode." > writes: > >> Something very troublesome for me is `test-org-clock/clocktable/lang' on >> zh_CN.UTF-8. What I noticed is that when I run this test in batch mode >> (one of the two methods below), it fails: > >

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-23 Thread Ihor Radchenko
Ruijie Yu writes: >>> (format "%-5.5s |" "1234…") >>> >>> returns different results for different locales, causing >>> `test-org-colview/columns-width' to break. >> >> What are these different results? > > In CJK locales such as zh_CN and ja_JA, the ellipsis character is > truncated, and

Re: [DRAFT PATCH v4] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-23 Thread Ihor Radchenko
Ruijie Yu via "General discussions about Org-mode." writes: > Something very troublesome for me is `test-org-clock/clocktable/lang' on > zh_CN.UTF-8. What I noticed is that when I run this test in batch mode > (one of the two methods below), it fails: Well. Batch and non-batch modes are not

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-23 Thread Ihor Radchenko
Ruijie Yu via "General discussions about Org-mode." writes: > Second, `org-columns--overlay-text' has a problem where > > (format "%-5.5s |" "1234…") > > returns different results for different locales, causing > `test-org-colview/columns-width' to break. What are these different results?

Re: [DRAFT PATCH v4] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-23 Thread General discussions about Org-mode.
Axel Kielhorn writes: >> Am 23.04.2023 um 03:47 schrieb Ruijie Yu via General discussions about >> Org-mode. : >> >> >> Ruijie Yu via "General discussions about Org-mode." >> writes: >> >>> Axel Kielhorn writes: >>> With this patch I get: FAILED

Re: [DRAFT PATCH v3] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-22 Thread Axel Kielhorn
> Am 23.04.2023 um 03:47 schrieb Ruijie Yu via General discussions about > Org-mode. : > > > Ruijie Yu via "General discussions about Org-mode." > writes: > >> Axel Kielhorn writes: >> >>> With this patch I get: >>> FAILED test-org-clock/clock-drawer-dwim arrayp >>> FAILED

Re: [DRAFT PATCH v3] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-22 Thread General discussions about Org-mode.
Ruijie Yu via "General discussions about Org-mode." writes: > Axel Kielhorn writes: > >> With this patch I get: >>FAILED test-org-clock/clock-drawer-dwim arrayp >>FAILED test-org-clok/org-clock-timestamps-change arrayp >> >> Axel > > Thanks for testing. Will take a look tomorrow.

Re: Test failure due to LANG

2023-04-22 Thread Max Nikulin
On 22/04/2023 21:40, Axel Kielhorn wrote: (with-environment-variables (("LC_TIME" "de_DE.UTF-8")) (format-time-string "%A“)) Still results in „Saturday“ when I start emacs from a shell with LANG=C. Changing environment variable while process is running is not enough. There is a dedicated

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-22 Thread General discussions about Org-mode.
Axel Kielhorn writes: >> Am 22.04.2023 um 15:01 schrieb Ruijie Yu via General discussions about >> Org-mode. : >> >> >> Ruijie Yu via "General discussions about Org-mode." >> writes: >> >>> Ruijie Yu via "General discussions about Org-mode." >>> writes: >>> Ruijie Yu via "General

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-22 Thread Axel Kielhorn
> Am 22.04.2023 um 15:01 schrieb Ruijie Yu via General discussions about > Org-mode. : > > > Ruijie Yu via "General discussions about Org-mode." > writes: > >> Ruijie Yu via "General discussions about Org-mode." >> writes: >> >>> Ruijie Yu via "General discussions about Org-mode."

Re: [DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-22 Thread General discussions about Org-mode.
Ruijie Yu writes: > Here is an updated patch (replacing the first iteration). This should > hopefully fix both test failures that Axel found. Once this is > confirmed good, I will look at the test failures of the other languages > to see what I can do. > > [2. text/x-patch; >

Re: Test failure due to LANG

2023-04-22 Thread Axel Kielhorn
> Am 22.04.2023 um 16:21 schrieb Max Nikulin : > > On 22/04/2023 19:35, Ihor Radchenko wrote: >> Axel Kielhorn writes: >>> "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 Thu 06:00]--[2022-11-03 Thu 06:01] => >>> 0:01\n:END:\n" #( >>> "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 Do 06:00]--[2022-11-03 Do

Re: Test failure due to LANG

2023-04-22 Thread Axel Kielhorn
> Am 22.04.2023 um 14:35 schrieb Ihor Radchenko : > > > (with-environment-variables (("LANG" "de")) > (format-time-string "%A")) > (with-environment-variables (("LANG" "en")) > (format-time-string "%A“)) When I start Emacs from a shell with LANG=de I get „Samstag“ in both cases. When I

Re: Test failure due to LANG

2023-04-22 Thread Ihor Radchenko
Max Nikulin writes: >> (with-environment-variables (("LANG" "de")) >>(format-time-string "%A")) >> (with-environment-variables (("LANG" "en")) >>(format-time-string "%A")) > > ("LC_TIME" "de_DE.UTF-8") > > Since it is related to dates or even "LC_ALL". E.g. Ubuntu installer may >

Re: Test failure due to LANG

2023-04-22 Thread Axel Kielhorn
> Am 22.04.2023 um 14:37 schrieb Ruijie Yu : > > > > Axel, does this patch fix test-org-clock/clock-drawer-dwim on your > system? > > <0001-testing-lisp-test-org-clock.el.patch> Yes it does, thanks. Axel

Re: Test failure due to LANG

2023-04-22 Thread Max Nikulin
On 22/04/2023 19:35, Ihor Radchenko wrote: Axel Kielhorn writes: "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 Thu 06:00]--[2022-11-03 Thu 06:01] => 0:01\n:END:\n" #( "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 Do 06:00]--[2022-11-03 Do 06:01] => 0:01\n:END:\n" (with-environment-variables (("LANG"

[DRAFT PATCH v2] Decouple LANG= and testing (was: Test failure due to LANG)

2023-04-22 Thread General discussions about Org-mode.
Ruijie Yu via "General discussions about Org-mode." writes: > Ruijie Yu via "General discussions about Org-mode." > writes: > >> Ruijie Yu via "General discussions about Org-mode." >> writes: >> >>> Axel Kielhorn writes: >>> Hello! I’m building org with LANG=de. As a

Re: Test failure due to LANG

2023-04-22 Thread General discussions about Org-mode.
Ihor Radchenko writes: > Axel Kielhorn writes: > >> I’m building org with LANG=de. >> As a result I get two failed tests: >> >> ... >> "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 Thu 06:00]--[2022-11-03 Thu 06:01] => >> 0:01\n:END:\n" #( >> "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 Do

Re: Test failure due to LANG

2023-04-22 Thread General discussions about Org-mode.
Ruijie Yu via "General discussions about Org-mode." writes: > Ruijie Yu via "General discussions about Org-mode." > writes: > >> Axel Kielhorn writes: >> >>> Hello! >>> >>> I’m building org with LANG=de. >>> As a result I get two failed tests: >> >> Reproducible using "LANG=zh_CN.UTF-8".

Re: Test failure due to LANG

2023-04-22 Thread Ihor Radchenko
Axel Kielhorn writes: > I’m building org with LANG=de. > As a result I get two failed tests: > > ... > "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 Thu 06:00]--[2022-11-03 Thu 06:01] => > 0:01\n:END:\n" #( > "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 Do 06:00]--[2022-11-03 Do 06:01] => > 0:01\n:END:\n"

Re: Test failure due to LANG

2023-04-22 Thread General discussions about Org-mode.
Ruijie Yu via "General discussions about Org-mode." writes: > Axel Kielhorn writes: > >> Hello! >> >> I’m building org with LANG=de. >> As a result I get two failed tests: > > Reproducible using "LANG=zh_CN.UTF-8". In fact, I got more failed tests > in my testing. I think the OP's two test

Re: Test failure due to LANG

2023-04-22 Thread General discussions about Org-mode.
Axel Kielhorn writes: > Hello! > > I’m building org with LANG=de. > As a result I get two failed tests: Reproducible using "LANG=zh_CN.UTF-8". In fact, I got more failed tests in my testing. I think the OP's two test failures are due to hardcoded English expected result, whereas the

Test failure due to LANG

2023-04-22 Thread Axel Kielhorn
Hello! I’m building org with LANG=de. As a result I get two failed tests: FAILED test-org-clock/clock-drawer-dwim ((should (equal "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 Thu 06:00]--[2022-11-03 Thu 06:01] => 0:01\n:END:\n" (org-test-with-temp-text "* Foo\n:LOGBOOK:\nCLOCK: [2022-11-03 ???