Subject: bug#68593: 29.1; comment-dwim: Args out of range: "", 0, 1

From: Eli Zaretskii <[email-masked]>
Date: Sat, 20 Jan 2024 08:47:34 +0200

> From: Frank Ruben <[email-masked]>
> Date: Fri, 19 Jan 2024 22:16:04 +0100
> 
> When in c-ts-mode.el and when having '(setq comment-end " ")' and when I then
> then run e.g. 'comment-dwim' or simpler '(comment-normalize-vars)', I'm getting
> 'comment-dwim: Args out of range: "", 0, 1'.
> 
> The error comes from the two 'substring' calls in this s-sexp - where the code
> already contains my "fix" - both calls to 'substring' have been guarded by
> '(if (string-equal ce "") "" ...)'.

Can you tell why do you set comment-end to such a value in c-ts-mode?
What is the purpose of such a strange setting?