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

Previous Next

Package: emacs;

Reported by: Marcin Borkowski <mbork <at> mbork.pl>

Date: Mon, 22 Jun 2015 10:21:02 UTC

Severity: normal

Found in version 25.0.50

Fixed in version 27.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 20871 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Marcin Borkowski <mbork <at> mbork.pl>
Cc: 20871 <at> debbugs.gnu.org
Subject: Re: 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
Date: Sun, 17 Apr 2016 19:49:35 +0300
> From: Marcin Borkowski <mbork <at> mbork.pl>
> Cc: 20871 <at> debbugs.gnu.org
> Date: Sun, 17 Apr 2016 17:34:04 +0200
> 
> In Polish typography, it is customary to foribid line breaks after
> one-letter words (and we have quite a few of them: a, i, o, w, z - they
> are conjunctions or prepositions).  And it is not uncommon to have
> a combination of them with a parenthesized remark or something like
> that.  That's why allowing a linebreak after, say "(a" when writing
> something in Polish (like an email, for instance) is a bug IMO.
> 
> > See, the function in question, fill-single-char-nobreak-p, is
> > documented as a possible value to use in the fill hook, for a very
> > specific purpose.  If you are saying that it doesn't fulfill that
> > purpose well enough, please show a use case where it fails to do that.
> > At least the situation you described, with " (a", doesn't seem to fit
> > the use cases which this function is supposed to cover, since the
> > parenthesis makes a 2-character sequence, whereas
> > fill-single-char-nobreak-p aims to support isolated one-character
> > words.
> 
> I see.  So you suggest that instead of patching
> `fill-single-char-nobreak-p' I should have provided another function,
> customized for Polish?

Yes, I think so.  There's already fill-french-nobreak-p, why shouldn't
there be a Polish predicate?

> In fact, I'm not so sure about it.  The whole point of such functions
> (as I see it) is help write texts in natural langauges.  It seems
> unnatural to treat words preceded by a space and by a parenthesis *in
> a natural language* differently, no?

Not necessarily: that space that precedes the word is by itself a
line-breaking opportunity.  IOW, Emacs will break before 'a' in " a",
and the penalty will be only 1 character.  By contrast, breaking
before the parenthesis in your case will yield a penalty of 2
characters, which is a different tradeoff, worthy of asking the user
explicitly to agree to.

The default value of fill-nobreak-predicate is nil for a reason.

Thanks.




This bug report was last modified 5 years and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.