From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#39517: [PATCH] Add new option 'word-wrap-boundary' Date: Mon, 10 Feb 2020 18:10:48 +0200 Message-ID: <83tv3ybeyf.fsf@gnu.org> References: <20200209074334.16270-1-tomtomjhj@gmail.com> <83lfpbdbbq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="60629"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39517@debbugs.gnu.org To: Jaehwang Jerry Jung Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 10 17:12:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j1BfP-000FhE-Kd for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 17:12:11 +0100 Original-Received: from localhost ([::1]:35664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1BfO-0007qs-BV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 11:12:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45219) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1BfH-0007ql-7u for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 11:12:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1BfG-0000lG-6h for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 11:12:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49331) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1BfG-0000l6-38 for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 11:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1BfF-0003Az-Uq for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 11:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Feb 2020 16:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39517-submit@debbugs.gnu.org id=B39517.158135108112156 (code B ref 39517); Mon, 10 Feb 2020 16:12:01 +0000 Original-Received: (at 39517) by debbugs.gnu.org; 10 Feb 2020 16:11:21 +0000 Original-Received: from localhost ([127.0.0.1]:55304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1Beb-0003A0-Ef for submit@debbugs.gnu.org; Mon, 10 Feb 2020 11:11:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1Bea-00039l-Fu for 39517@debbugs.gnu.org; Mon, 10 Feb 2020 11:11:20 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j1BeU-0008OF-A2; Mon, 10 Feb 2020 11:11:14 -0500 Original-Received: from [176.228.60.248] (port=3782 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j1BeF-0003Pv-Fy; Mon, 10 Feb 2020 11:11:13 -0500 In-reply-to: (message from Jaehwang Jerry Jung on Tue, 11 Feb 2020 00:36:01 +0900) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175880 Archived-At: > From: Jaehwang Jerry Jung > Cc: 39517@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. > - ((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? > 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.