GNU bug report logs - #39517
[PATCH] Add new option 'word-wrap-boundary'

Previous Next

Package: emacs;

Reported by: Jaehwang Jerry Jung <tomtomjhj <at> gmail.com>

Date: Sun, 9 Feb 2020 08:16:02 UTC

Severity: wishlist

Tags: patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Jaehwang Jerry Jung <tomtomjhj <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39517 <at> debbugs.gnu.org
Subject: Re: bug#39517: [PATCH] Add new option 'word-wrap-boundary'
Date: Wed, 12 Feb 2020 00:43:06 +0900

On 11/02/2020 01:10, Eli Zaretskii wrote:
>> From: Jaehwang Jerry Jung <tomtomjhj <at> gmail.com>
>> Cc: 39517 <at> debbugs.gnu.org
>> Date: Tue, 11 Feb 2020 00:36:01 +0900
>>
>> I noticed that word wrapping looks a bit weird when the text contains
>> long URLs.  So I wanted to add non-word ASCII characters so that URLs
>> can be wrapped more naturally as in other editors, while not changing
>> the default behavior.
> OK, but is that the only relevant use case?  Maybe we have others.  We
> need to think in more general terms, in case the other use cases might
> suggest different solutions.

Not that I know of.

>> -  ((it->what == IT_CHARACTER && (it->c == ' ' || it->c == '\t'))	\
>> +#define IT_DISPLAYING_WORD_WRAP_BOUNDARY(it)				\
>> +  ((it->what == IT_CHARACTER						\
>> +    && strchr ((char *) SDATA (BVAR (current_buffer, word_wrap_boundary)), \
>> +		it->c))							\
>>
>> This cannot be right: characters are stored in Lisp strings in a
>> multibyte encoding that is superset of UTF-8, so the above will only
>> support pure-ASCII boundary characters, which is probably not what you
>> had in mind.
>>
>> You're right. Actually I think it would be simpler to hard-code a better
>> list of boundary characters in that macro.
> I don't think we can hardcode them, because the set of characters must
> be buffer-local: we don't want to wrap on '/' in a general text-mode
> buffer, let alone in a C-mode buffer, right?

It's not uncommon to wrap on '/'. For example,
* Vim: http://vimdoc.sourceforge.net/htmldoc/options.html#'breakat'
* Visual Studio Code: https://github.com/microsoft/vscode/blob/39370d9c988c584fa2e834728d8ffa56259ff1ad/src/vs/editor/common/config/editorOptions.ts#L279-L283

Anyway, I agree with configurability. Perhaps I'll need some more time
to implement it with multibyte characters in mind. Or we could use the
syntax table.

>>   Last, but not least, for a contribution this large, we will need you
>> to assign the copyright to the FSF.  If you agree, I will send you the
>> form to fill and the instructions to send it.
>>
>> Yes, I agree.
> Form sent off-list.
>
> Thanks.

Thanks. I sent the request.





This bug report was last modified 4 years and 345 days ago.

Previous Next


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