Subject: bug#20871: 25.0.50; fill-single-char-nobreak-p does not recognize a single-letter word when it is preceded by an open paren

From: Michał Nazarewicz <[email-masked]>
Date: Mon, 19 Aug 2019 15:07:56 +0100

On Sat, 17 Aug 2019 at 07:57, Eli Zaretskii <[email-masked]> wrote:
> My problem is conceptual rather than practical.  Since in , e.g.,
> English it is okay to break a line after single-letter words, whereas
> in Polish it is not, I wonder how can we have a single function
> satisfy both requirements.  We would need some option, and then we
> would need to decide what is the trigger for changing the value of
> that option -- it could be the user, or the language environment, or
> maybe something else.

This sounds related to what we’ve discussed when I was working on the
Unicode casing rules.  There also some rules need to be enabled only
if the text is in a certain language.  Having buffer-local variable or
a text-property defining language of the buffer sounds to me like the
only possible solution if we want this fully automatic.

> tildify.el explicitly says that its defaults are for a specific
> language, so I don't think it solves the problem that bothers me, as
> described above.  This is why I originally suggested a separate
> function -- having that is equivalent to having an option which
> determines a behavior that depends on the language.

To be honest, I don’t understand the issue.  If having separate
functions is equivalent to having an option than users already have an
option: either add the function to ‘fill-nobreak-predicate’ or not.

As discussed previously, ‘fill-single-char-nobreak-p’ and
‘fill-polish-nobreak-p’ and serve pretty much the same purpose.  When
I wrote the former I had Polish typography in mind and obviously the
latter is meant to handle the same case.  As such, having those two
functions don’t provide much option to the user.

> I'm also okay with extending tildify.el to support more than just
> Czech rules, but that's a separate issue.

The differences between Czech and Polish can largely be ignored.  The
regex in tildify.el will work for Polish just fine.  The character
group simply lists all existing one-letter Czech words which is
superset of one-letter Polish words.

At the same time, those two languages are, to my knowledge, the only
which observe this typography rule, so there’s no need to add support
for more.

‘fill-single-char-nobreak-p’ matches any single-letter words just for
the sake of simplicity plus it then works with other languages, which
may have different one-letter words, if someone wishes to use it with
them.

-- 
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»