Re: [Patch] mg(1): Experimental UTF-8 support

2018-06-01 Thread S. Gilles
On 2018-06-01T11:02:57+0200, Stefan Sperling wrote: > On Wed, May 30, 2018 at 04:01:57PM -0400, S. Gilles wrote: > > On 2018-05-30T09:17:22-0600, Theo de Raadt wrote: > > > This approach seems misguided. Let me tell a story. > > > > > > More than two decades ago, I made a fork of mg which was 100

Re: [Patch] mg(1): Experimental UTF-8 support

2018-06-01 Thread Leonid Bobrov
On Fri, Jun 01, 2018 at 11:02:57AM +0200, Stefan Sperling wrote: > On Wed, May 30, 2018 at 04:01:57PM -0400, S. Gilles wrote: > > On 2018-05-30T09:17:22-0600, Theo de Raadt wrote: > > > This approach seems misguided. Let me tell a story. > > > > > > More than two decades ago, I made a fork of mg

Re: [Patch] mg(1): Experimental UTF-8 support

2018-06-01 Thread Stefan Sperling
On Wed, May 30, 2018 at 04:01:57PM -0400, S. Gilles wrote: > On 2018-05-30T09:17:22-0600, Theo de Raadt wrote: > > This approach seems misguided. Let me tell a story. > > > > More than two decades ago, I made a fork of mg which was 100% byte > > clean. Unfortunately I lost the source code of tha

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-31 Thread Leonid Bobrov
To make testing easier, I temporarily committed a port to WIP repo: https://github.com/jasperla/openbsd-wip/tree/master/editors/umg I won't submit it to ports@, this is experimental and only for testing.

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread S. Gilles
On 2018-05-30T09:17:22-0600, Theo de Raadt wrote: > This approach seems misguided. Let me tell a story. > > More than two decades ago, I made a fork of mg which was 100% byte > clean. Unfortunately I lost the source code of that change. mg's data > buffers are a linked list of lines, with a \n

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread S. Gilles
On 2018-05-30T11:50:37+0200, Stefan Sperling wrote: > Comments inline. I think this still needs a lot of work... Thanks for the review; replies inline (and omitted where the reply is the same as one above). By the time you read this, I'll have pushed the changes I mention to my branch in hboetes'

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread Theo de Raadt
This approach seems misguided. Let me tell a story. More than two decades ago, I made a fork of mg which was 100% byte clean. Unfortunately I lost the source code of that change. mg's data buffers are a linked list of lines, with a \n implied by the end of each string. 0 bytes are unsupported.

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread Leonid Bobrov
I'm updating a diff, but it is just a fix for cursor movement, it is still experimental and obvious problems are not fixed yet, this is just a diff taken from latest commit at github: Index: basic.c === RCS file: /cvs/src/usr.bin/mg/ba

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread Han Boetes
For anyone interested in contributing to this specific branch, Please have a look on github: https://github.com/hboetes/mg/tree/display-wide-characters On Wed, May 30, 2018 at 12:55 PM Leonid Bobrov wrote: > Hi Stefan! > > I'm sorry, fileio.c was out of sync that day, that's my bad, I forgot > t

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread Leonid Bobrov
Hi Stefan! I'm sorry, fileio.c was out of sync that day, that's my bad, I forgot to remove its diff. Sorry for not reading diffs before sending them (I read your comments), that's why I call it experimental: I blindly applied diffs and tested mg in runtime. I'll send your comments to S. Gilles, a

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread Stefan Sperling
Comments inline. I think this still needs a lot of work... I've done one pass over this to weed out some obvious problems. There might be many I've missed. Not going to do any run-time testing because emacs/mg break my fingers ;) On Mon, May 28, 2018 at 09:32:10PM +0300, Leonid Bobrov wrote: > I

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread Reyk Floeter
> Am 30.05.2018 um 10:10 schrieb Leonid Bobrov : > >> On Wed, May 30, 2018 at 09:05:12AM +0200, Hiltjo Posthuma wrote: >>> On Tue, May 29, 2018 at 05:22:43PM +0300, Leonid Bobrov wrote: On Tue, May 29, 2018 at 03:33:08PM +0200, Henning Brauer wrote: Hi, very welcome! >

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread Leonid Bobrov
On Wed, May 30, 2018 at 09:05:12AM +0200, Hiltjo Posthuma wrote: > On Tue, May 29, 2018 at 05:22:43PM +0300, Leonid Bobrov wrote: > > On Tue, May 29, 2018 at 03:33:08PM +0200, Henning Brauer wrote: > > > Hi, > > > > > > very welcome! > > > > > > I have applied the diff and don't notice immediate

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread Hiltjo Posthuma
On Tue, May 29, 2018 at 05:22:43PM +0300, Leonid Bobrov wrote: > On Tue, May 29, 2018 at 03:33:08PM +0200, Henning Brauer wrote: > > Hi, > > > > very welcome! > > > > I have applied the diff and don't notice immediate breakage. Pls poke > > You didn't notice cursor movement bugs? o_O > Well, I'm

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-29 Thread Leonid Bobrov
On Tue, May 29, 2018 at 03:33:08PM +0200, Henning Brauer wrote: > Hi, > > very welcome! > > I have applied the diff and don't notice immediate breakage. Pls poke You didn't notice cursor movement bugs? o_O Well, I'm giving example: авыавыавы To move from start to end of that word, you have to pr

[Patch] mg(1): Experimental UTF-8 support

2018-05-28 Thread Leonid Bobrov
Hi! Diff is taken from here: https://github.com/hboetes/mg/compare/display-wide-characters with minor modifications (didn't patch some files and updated mg.1) I got two not critical cursor movement bugs (like I have to press C-f twice or M-f moves cursor subword forward) Index: basic.c ==