unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jaehwang Jerry Jung <tomtomjhj@gmail.com>
Cc: 39517@debbugs.gnu.org
Subject: bug#39517: [PATCH] Add new option 'word-wrap-boundary'
Date: Mon, 10 Feb 2020 18:10:48 +0200	[thread overview]
Message-ID: <83tv3ybeyf.fsf@gnu.org> (raw)
In-Reply-To: <fb2ba175-29aa-4683-e398-1ed2a69967a3@gmail.com> (message from Jaehwang Jerry Jung on Tue, 11 Feb 2020 00:36:01 +0900)

> From: Jaehwang Jerry Jung <tomtomjhj@gmail.com>
> 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.





  reply	other threads:[~2020-02-10 16:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-09  7:43 bug#39517: [PATCH] Add new option 'word-wrap-boundary' Jaehwang Jerry Jung
2020-02-09 15:34 ` Eli Zaretskii
2020-02-10 15:36   ` Jaehwang Jerry Jung
2020-02-10 16:10     ` Eli Zaretskii [this message]
2020-02-11 15:43       ` Jaehwang Jerry Jung
2020-08-09 11:23         ` Lars Ingebrigtsen
2020-08-09 14:11           ` Eli Zaretskii
2020-08-09 15:23             ` Jaehwang Jerry Jung
2020-08-09 15:25               ` Lars Ingebrigtsen
2020-08-09 15:44               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83tv3ybeyf.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=39517@debbugs.gnu.org \
    --cc=tomtomjhj@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).