GNU bug report logs -
#78561
[PATCH] Add semantic linefeed support for paragraph filling
Previous Next
Reported by: Roi Martin <jroi.martin <at> gmail.com>
Date: Fri, 23 May 2025 09:59:02 UTC
Severity: normal
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
>> +(defun fill-paragraph-semlf (&optional justify)
>> + "Fill paragraph at or after point using semantic linefeeds.
>> +
>> +This function ensures that a newline character follows every
>> +sentence, as punctuated by a period (.), exclamation mark (!), or
>> +question mark (?).
>
> This explanation of what is "semantic linefeeds" is a good starting
> point, but it is not enough. For starters, "ensures" hints but
> doesn't say explicitly that if there's no newline there, it is
> inserted. Also, I think a URL to at least one site explaining what
> "semantic linefeeds" are should be in the doc string.
I would prefer to avoid depending on external URLs to explain the
concept. I'd link to an external reference if, for instance, this
feature was backed by an standard located in a well-known site
(e.g. IETF RFCs). In this case, the concept is quite simple and I agree
with Stefan in that we can provide our own interpretation in the manual
and link to the Info node from the doc string. If you prefer to avoid
changing the manual until this is well tested, then we can provide a
more detailed explanation in the doc string itself. What do you think?
>> + (when (and (> (point) (line-beginning-position))
>> + (< (point) (line-end-position)))
>> + (delete-horizontal-space)
>> + (newline)
>
> Are you sure 'newline' is the right function to call here? It doesn't
> just insert the newline character, at least not in all the cases.
> Perhaps inserting a literal newline character is better?
The reason behind using 'newline' is to support documents that follow
other conventions to represent newlines (e.g. '\r\n' or '\r'). Does it
make sense? Is this the right approach?
This bug report was last modified 18 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.