emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should `fill-paragraph' respect formatting?


From: Tor Kringeland
Subject: Re: Should `fill-paragraph' respect formatting?
Date: Thu, 9 Dec 2021 03:05:21 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.2

On 09/12/2021 02:03, Lars Ingebrigtsen wrote:
   /Some text/.  Some more text.

😀

I think it's a matter of choice, similar to putting a period before or
after a quote.  À la Americans it's Some "text." while otherwise it's
Some "text". --- I think, though it's not a rule.  If you're
formatting a whole sentence it makes more sense to surround it
including the period for consistency, but for one word at the end of
the sentence /vice versa/.

I think it's up to the individual modes.

I think it's a matter of choice, similar to placing a period before or
after a quote.  À la Americans it's Some "text." while otherwise it's
Some "text". --- I think, though it's not a rule.  If you're
formatting a whole sentence it makes more sense to surround it
including the period for consistency, but for one word at the end of
the sentence /vice versa/.

Maybe it'd be possible to have a customizable regex for what defines
the end of a sentence in a given mode?  /E.g./ in `text-mode' derived
modes that doesn't have the pretty formatting like `org-mode'
formatting like this is still used sometimes, but not by everyone.

Another example is TeX where $-encapsulated "math" ending in a double
space afterwards isn't respected.  Though it respect the three most
common brackets (), [] and {}.

I did some digging with regard to how `fill-paragraph' treats
quotation marks, and found some interesting results.  For example it
respect the "standard ASCII" ones

  Some."  Text

  Some.'  Text

and Norwegian, Swedish and Japanese ones like

  Some.»  Text

  Some«.  Text

  Some」.  Text

and some rarer ones

  Some.›  Text

  Some〞.  Text

probably because it doesn't recognize these as quotation marks and
guesses that they're part of the word itself.  However, for the
following ones it removes the double space

  Some.‘  Text

  Some.“  Text

  Some.❜  Text

  Some.❞  Text

which I guess means it understands that these are quotation marks and
not part of the word, but doesn't respect the double space like with
the first two examples.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]