apostophe aka single-quote disappears i.e. explicit literal string becomes implicit, which it shouldn't
Please refer to the attached example: bad-unquote.gnumeric
In cell B2 use an apostrophe to enter the explicit literal string:
'2023/jan/1
This is recognized as being a string and a valid date.
Copy B2 to B4 and lengthen the month name to january. This is no longer a valid date. It is still a string. The apostrophe has disappeared, which is odd and alarming.
Copy B4 to B6 and change the day number. The apostrophe is still gone.
Copy B6 to B8 and shorten the month name back to jan.
This goes back to being a valid date, but it is no longer a string. This is unexpected and undesirable. This causes problems if you want to edit the expression, because the representation has changed. The new representation is probably locale-dependent. It causes additional problems if there is explicit type-checking using the TYPE()
function, and when the string is concatenated using the &
operator.
A similar scenario plays out in cells B14, B16, and B18. Explicit string becomes implicit string becomes non-string.
Desired behavior The apostrophe should be sticky. When something is an explicit literal string, it should remain an explicit literal string unless and until the user edits out the apostrophe. It should remain an explicit literal string even if it would be recognized as implicitly necessarily a string.
To say the same thing the other way,
'2023/january/1xx
'2023/jan/1
'foobar
should be different from
2023/january/1xx
2023/jan/1
foobar
and should remain different. The distinction is important because it affects editing, type-checking, and concatenation.
Workaround: In my application there are partial workarounds, but they are ugly, involving additional cells and constructing a string by concatenation.
Circumstances
This is observed with both (a) freshly-pulled git sources and (b) a years old distro version:
gnumeric version '1.12.51'
datadir := '/usr/share/gnumeric/1.12.51'
libdir := '/usr/lib/gnumeric/1.12.51'