GNU bug report logs - #71865
[PATCH] New user option `fill-sentence-end-double-space`

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Mon, 1 Jul 2024 01:08:01 UTC

Severity: wishlist

Tags: patch

To reply to this bug, email your comments to 71865 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#71865; Package emacs. (Mon, 01 Jul 2024 01:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefankangas <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 01 Jul 2024 01:08:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] New user option `fill-sentence-end-double-space`
Date: Sun, 30 Jun 2024 18:07:29 -0700
[Message part 1 (text/plain, inline)]
Severity: wishlist

Consider doing this in emacs -Q

    M-: (setq sentence-end-double-space nil) RET

Now put point at a paragraph like this

    Foo bar baz.  Hello hello.

Press M-q and end up with:

    Foo bar baz. Hello hello.

However, in some cases the user will _not_ want this be reflowed, while
still wanting to make the sentence commands navigate correctly even if
there is only one space.

For that purpose, I suggest adding a new user option
`fill-sentence-end-double-space', which controls _only_ the behavior
when refilling.  That way you can customize sentence commands separately
from fill commands.

See the attached patch (still lacking NEWS and documentation changes).

Thoughts?
[0001-New-user-option-fill-sentence-end-double-space.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71865; Package emacs. (Mon, 01 Jul 2024 21:17:02 GMT) Full text and rfc822 format available.

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

From: Jeremy Bryant <jb <at> jeremybryant.net>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 71865 <at> debbugs.gnu.org
Subject: Re: bug#71865: [PATCH] New user option
 `fill-sentence-end-double-space`
Date: Mon, 01 Jul 2024 22:16:02 +0100
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Severity: wishlist
>
> Consider doing this in emacs -Q
>
>     M-: (setq sentence-end-double-space nil) RET
>
> Now put point at a paragraph like this
>
>     Foo bar baz.  Hello hello.
>
> Press M-q and end up with:
>
>     Foo bar baz. Hello hello.
>
> However, in some cases the user will _not_ want this be reflowed, while
> still wanting to make the sentence commands navigate correctly even if
> there is only one space.

I tried this example but would be interested in a clearer statement of
the problem.  Does M-a, M-e not work as intended?
>
> For that purpose, I suggest adding a new user option
> `fill-sentence-end-double-space', which controls _only_ the behavior
> when refilling.  That way you can customize sentence commands separately
> from fill commands.
>
> See the attached patch (still lacking NEWS and documentation changes).
>
> Thoughts?
>
> [2. text/x-patch; 0001-New-user-option-fill-sentence-end-double-space.patch]...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71865; Package emacs. (Mon, 01 Jul 2024 23:04:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Jeremy Bryant <jb <at> jeremybryant.net>
Cc: 71865 <at> debbugs.gnu.org
Subject: Re: bug#71865: [PATCH] New user option
 `fill-sentence-end-double-space`
Date: Mon, 1 Jul 2024 16:02:28 -0700
Jeremy Bryant <jb <at> jeremybryant.net> writes:

> I tried this example but would be interested in a clearer statement of
> the problem.  Does M-a, M-e not work as intended?

Thanks, and yes indeed, the `M-a' and `M-e' doesn't work as I'd hope if
you evaluate this in emacs -Q:

    (progn (insert "Foo. Bar. Baz.")
           (goto-char (pos-bol))
           (forward-sentence))

Point is now at the third period, after "Baz".

I think that there are some users [this one included] that will want to
set

    (setq sentence-end-double-space nil)

to make point end up at the second period instead, after "Bar", yet they
do _not_ want this paragraph to be refilled to use only one space
between sentences:

    Foo.  Bar.  Baz.

In other words, the problem is that `sentence-end-double-space' controls
both filling and sentence commands.  This rectifies that by introducing
a new variable that allows controlling the filling commands separately.

Does that make the problem more clear?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71865; Package emacs. (Sat, 06 Jul 2024 21:47:01 GMT) Full text and rfc822 format available.

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

From: Jeremy Bryant <jb <at> jeremybryant.net>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 71865 <at> debbugs.gnu.org
Subject: Re: bug#71865: [PATCH] New user option
 `fill-sentence-end-double-space`
Date: Sat, 06 Jul 2024 22:46:07 +0100
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Jeremy Bryant <jb <at> jeremybryant.net> writes:
>
>> I tried this example but would be interested in a clearer statement of
>> the problem.  Does M-a, M-e not work as intended?
>
> Thanks, and yes indeed, the `M-a' and `M-e' doesn't work as I'd hope if
> you evaluate this in emacs -Q:
>
>     (progn (insert "Foo. Bar. Baz.")
>            (goto-char (pos-bol))
>            (forward-sentence))
>
> Point is now at the third period, after "Baz".
>
> I think that there are some users [this one included] that will want to
> set
>
>     (setq sentence-end-double-space nil)
>
> to make point end up at the second period instead, after "Bar", yet they
> do _not_ want this paragraph to be refilled to use only one space
> between sentences:
>
>     Foo.  Bar.  Baz.
>
> In other words, the problem is that `sentence-end-double-space' controls
> both filling and sentence commands.  This rectifies that by introducing
> a new variable that allows controlling the filling commands separately.
>
> Does that make the problem more clear?

Thanks, I understand your point of view.

However it seems consistent to me that a user who wishes to terminate
sentences with one space, would generally want to reflow to adhere to
the one space convention.  The same would apply if working on documents
that happen to adhere to that convention.

However as this new option doesn't seem to break anything and introduce
flexibility, it could be a good idea.  I'll let others comment.




This bug report was last modified 103 days ago.

Previous Next


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