public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Mg3a - a version of Mg2a developed on Cygwin
@ 2011-02-23  8:57 Bengt Larsson
  2011-02-23  9:11 ` Bengt Larsson
  2011-02-23 18:25 ` Buchbinder, Barry (NIH/NIAID) [E]
  0 siblings, 2 replies; 28+ messages in thread
From: Bengt Larsson @ 2011-02-23  8:57 UTC (permalink / raw)
  To: cygwin

As I mentioned in an earlier message I have been developing UTF-8
support for an editor, Mg2a. I chose to call it Mg3a.

You can fetch it here: http://www.bengtl.net/files/mg3a/

Or directly here: http://www.bengtl.net/files/mg3a/mg3a.110223.tar.gz

Just extract and compile. You can use it with only what's in the README,
but README.reference lists the relevant functions.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-23  8:57 Mg3a - a version of Mg2a developed on Cygwin Bengt Larsson
@ 2011-02-23  9:11 ` Bengt Larsson
  2011-02-23  9:29   ` Corinna Vinschen
  2011-02-23 18:25 ` Buchbinder, Barry (NIH/NIAID) [E]
  1 sibling, 1 reply; 28+ messages in thread
From: Bengt Larsson @ 2011-02-23  9:11 UTC (permalink / raw)
  To: cygwin

Bengt Larsson wrote:
>As I mentioned in an earlier message I have been developing UTF-8
>support for an editor, Mg2a. I chose to call it Mg3a.

The README:
------------
This is Mg, formerly Mg2a, formerly MicroGnuEmacs. It was extended by
Bengt Larsson to deal with CRLF/LF and UTF-8, plus some other small
extensions. The original README and documents are in orig/. The
extensions as well as the original, with some exceptions mentioned in
the original README, are in the public domain. 

Enjoy your GNU Emacs-like editor.

If you are on Cygwin, Mg defaults to CRLF line endings. You may want
to set them to LF by putting this in a file .mg in your home
directory:

  (set-default-mode "lf")

If you have files in an old 8-bit character set, and if you are in a
UTF-8 locale, you may want to add a command to set the default 8bit
character set. Default is CP1252. For example:

  (set-default-8bit-charset "cp1250")

"list-charsets" lists the available charsets.


Commands are documented in README.reference. README.programmer and
README.misc include some extra info. 

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-23  9:11 ` Bengt Larsson
@ 2011-02-23  9:29   ` Corinna Vinschen
  2011-02-23  9:33     ` Bengt Larsson
  0 siblings, 1 reply; 28+ messages in thread
From: Corinna Vinschen @ 2011-02-23  9:29 UTC (permalink / raw)
  To: cygwin

On Feb 23 10:11, Bengt Larsson wrote:
> Bengt Larsson wrote:
> >As I mentioned in an earlier message I have been developing UTF-8
> >support for an editor, Mg2a. I chose to call it Mg3a.
> 
> The README:
> ------------
> This is Mg, formerly Mg2a, formerly MicroGnuEmacs. It was extended by
> Bengt Larsson to deal with CRLF/LF and UTF-8, plus some other small
> extensions. The original README and documents are in orig/. The
> extensions as well as the original, with some exceptions mentioned in
> the original README, are in the public domain. 
> 
> Enjoy your GNU Emacs-like editor.
> 
> If you are on Cygwin, Mg defaults to CRLF line endings. You may want
> to set them to LF by putting this in a file .mg in your home
> directory:
> 
>   (set-default-mode "lf")

I'm not an Emacs user, but IMO LF should be the default on Cygwin.
It's also the default in vim.  After all, Cygwin is a UNIX-like
environment in the first place.  And textmode is usually handled
transparently by the underlying mount point, unless you open the
file explicitely in binary mode.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-23  9:29   ` Corinna Vinschen
@ 2011-02-23  9:33     ` Bengt Larsson
  0 siblings, 0 replies; 28+ messages in thread
From: Bengt Larsson @ 2011-02-23  9:33 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen wrote:
>On Feb 23 10:11, Bengt Larsson wrote:
>> If you are on Cygwin, Mg defaults to CRLF line endings. You may want
>> to set them to LF by putting this in a file .mg in your home
>> directory:
>> 
>>   (set-default-mode "lf")
>
>I'm not an Emacs user, but IMO LF should be the default on Cygwin.
>It's also the default in vim.  After all, Cygwin is a UNIX-like
>environment in the first place.  And textmode is usually handled
>transparently by the underlying mount point, unless you open the
>file explicitely in binary mode.

Well, maybe. I'll think about it.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* RE: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-23  8:57 Mg3a - a version of Mg2a developed on Cygwin Bengt Larsson
  2011-02-23  9:11 ` Bengt Larsson
@ 2011-02-23 18:25 ` Buchbinder, Barry (NIH/NIAID) [E]
  2011-02-23 18:53   ` Andrew Schulman
  1 sibling, 1 reply; 28+ messages in thread
From: Buchbinder, Barry (NIH/NIAID) [E] @ 2011-02-23 18:25 UTC (permalink / raw)
  To: cygwin

Bengt Larsson sent the following at Wednesday, February 23, 2011 3:58 AM
>
>As I mentioned in an earlier message I have been developing UTF-8
>support for an editor, Mg2a. I chose to call it Mg3a.
>
>You can fetch it here: http://www.bengtl.net/files/mg3a/
>
>Or directly here: http://www.bengtl.net/files/mg3a/mg3a.110223.tar.gz

Why not ITP it as an official package?

{Not that I care.  Nothing against emacs, but vim is enough for me.  :-)  }

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-23 18:25 ` Buchbinder, Barry (NIH/NIAID) [E]
@ 2011-02-23 18:53   ` Andrew Schulman
  2011-02-23 19:36     ` Bengt Larsson
  0 siblings, 1 reply; 28+ messages in thread
From: Andrew Schulman @ 2011-02-23 18:53 UTC (permalink / raw)
  To: cygwin

> Bengt Larsson sent the following at Wednesday, February 23, 2011 3:58 AM
> >
> >As I mentioned in an earlier message I have been developing UTF-8
> >support for an editor, Mg2a. I chose to call it Mg3a.
> >
> >You can fetch it here: http://www.bengtl.net/files/mg3a/
> >
> >Or directly here: http://www.bengtl.net/files/mg3a/mg3a.110223.tar.gz
> 
> Why not ITP it as an official package?

It will need a license.  Right now there's no license information anywhere
in the tarball AFAICT.

Is the code in Mg3a taken from Emacs?  If so, you need to include the GPL
in your tarball.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-23 18:53   ` Andrew Schulman
@ 2011-02-23 19:36     ` Bengt Larsson
  2011-02-24  8:56       ` Corinna Vinschen
  0 siblings, 1 reply; 28+ messages in thread
From: Bengt Larsson @ 2011-02-23 19:36 UTC (permalink / raw)
  To: cygwin

Andrew Schulman wrote:
>> Why not ITP it as an official package?
>
>It will need a license.  Right now there's no license information anywhere
>in the tarball AFAICT.
>
>Is the code in Mg3a taken from Emacs?  If so, you need to include the GPL
>in your tarball.

No, it was taken from Mg2a, which was public domain. See the README in
the orig/ directory. The orig directory is referred to in the README in
the source directory.

README:
"The original README and documents are in orig/. The
extensions as well as the original, with some exceptions mentioned in
the original README, are in the public domain. "

orig/README:
"Mg 2a README  May 15, 1988

Mg (mg) is a Public Domain EMACS style editor."

This is perhaps not perfect disclosure, but it is there. (I did miss
wcwidth.c, but it says:

" * Markus Kuhn -- 2007-05-26 (Unicode 5.0)
 *
 * Permission to use, copy, modify, and distribute this software
 * for any purpose and without fee is hereby granted. The author
 * disclaims all warranties with regard to this software.
"

So I think I'm in the clear. Since the original was public domain I
haven't wanted to think about doing it differently with my code; it
makes my head hurt. I do know what public domain means, and should
someone go ahead and make insane amount of money on this I will be a)
insanely proud, b) take it as a learning experience and c) be sure to
extract a lot of money next time. 

I think public domain is interesting because anyone can do anything.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-23 19:36     ` Bengt Larsson
@ 2011-02-24  8:56       ` Corinna Vinschen
  2011-02-24 10:56         ` Bengt Larsson
  2011-02-25  8:05         ` wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin] Thomas Wolff
  0 siblings, 2 replies; 28+ messages in thread
From: Corinna Vinschen @ 2011-02-24  8:56 UTC (permalink / raw)
  To: cygwin

On Feb 23 20:36, Bengt Larsson wrote:
> Andrew Schulman wrote:
> >> Why not ITP it as an official package?
> >
> >It will need a license.  Right now there's no license information anywhere
> >in the tarball AFAICT.
> >
> >Is the code in Mg3a taken from Emacs?  If so, you need to include the GPL
> >in your tarball.
> 
> No, it was taken from Mg2a, which was public domain. See the README in
> the orig/ directory. The orig directory is referred to in the README in
> the source directory.
> 
> README:
> "The original README and documents are in orig/. The
> extensions as well as the original, with some exceptions mentioned in
> the original README, are in the public domain. "
> 
> orig/README:
> "Mg 2a README  May 15, 1988
> 
> Mg (mg) is a Public Domain EMACS style editor."
> 
> This is perhaps not perfect disclosure, but it is there. (I did miss
> wcwidth.c, but it says:
> 
> " * Markus Kuhn -- 2007-05-26 (Unicode 5.0)
>  *
>  * Permission to use, copy, modify, and distribute this software
>  * for any purpose and without fee is hereby granted. The author
>  * disclaims all warranties with regard to this software.
> "

Just a hint:

When on Cygwin, you might better use Cygwin's(*) wcwidth function.  It's
based on the same code from Markus Kuhn, but it interacts with the
setlocale function to make sure that the width returned for the CJK
ambiguous width characters makes sense in the given locale.  Plus, it
supports a Cygwin-specific locale modifier '@cjknarrow' which allows the
user to modify this behaviour.  When using your own wcwidth, you're
giving up on this feature.

Better yet, convert wide chars to wide strings and use the wcswidth
function.  In contrast to wcwidth, it can also handle surrogate pairs.


Corinna


(*) Actually newlib's wcwidth.

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24  8:56       ` Corinna Vinschen
@ 2011-02-24 10:56         ` Bengt Larsson
  2011-02-24 11:15           ` Corinna Vinschen
  2011-02-24 11:19           ` Bengt Larsson
  2011-02-25  8:05         ` wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin] Thomas Wolff
  1 sibling, 2 replies; 28+ messages in thread
From: Bengt Larsson @ 2011-02-24 10:56 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen wrote:
>Just a hint:
>
>When on Cygwin, you might better use Cygwin's(*) wcwidth function.  It's
>based on the same code from Markus Kuhn, but it interacts with the
>setlocale function to make sure that the width returned for the CJK
>ambiguous width characters makes sense in the given locale.  Plus, it
>supports a Cygwin-specific locale modifier '@cjknarrow' which allows the
>user to modify this behaviour.  When using your own wcwidth, you're
>giving up on this feature.
>
>Better yet, convert wide chars to wide strings and use the wcswidth
>function.  In contrast to wcwidth, it can also handle surrogate pairs.

I don't use surrogates. I only use UTF-8 and UTF-32. But using cygwin's
wcwidth may be worth thinking about. I suppose it will be consistent
with mintty that way; otherwise not?

Using wcswidth isn't very useful in the editor because it has special
requirements, like showing control characters with ^C. That's one of the
reasons I mostly wrote my own, all the special requirements. I always
iterate of bytes, which are converted in a mode-dependent way to ints
(UTF-32). Do you have a case-insensitive compare? Because I limited that
to ASCII.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24 10:56         ` Bengt Larsson
@ 2011-02-24 11:15           ` Corinna Vinschen
  2011-02-24 11:40             ` Bengt Larsson
  2011-02-24 12:16             ` Andy Koppe
  2011-02-24 11:19           ` Bengt Larsson
  1 sibling, 2 replies; 28+ messages in thread
From: Corinna Vinschen @ 2011-02-24 11:15 UTC (permalink / raw)
  To: cygwin

On Feb 24 11:56, Bengt Larsson wrote:
> Corinna Vinschen wrote:
> >Just a hint:
> >
> >When on Cygwin, you might better use Cygwin's(*) wcwidth function.  It's
> >based on the same code from Markus Kuhn, but it interacts with the
> >setlocale function to make sure that the width returned for the CJK
> >ambiguous width characters makes sense in the given locale.  Plus, it
> >supports a Cygwin-specific locale modifier '@cjknarrow' which allows the
> >user to modify this behaviour.  When using your own wcwidth, you're
> >giving up on this feature.
> >
> >Better yet, convert wide chars to wide strings and use the wcswidth
> >function.  In contrast to wcwidth, it can also handle surrogate pairs.
> 
> I don't use surrogates. I only use UTF-8 and UTF-32. But using cygwin's
> wcwidth may be worth thinking about. I suppose it will be consistent
> with mintty that way; otherwise not?

Yes, I think Andy uses the system functions as well.

As for the wide char representation, wchar_t is UTF-16 on Cygwin, as on
the underlying Windows, and surrogate pairs are always possible.
You can't use any libc wide char function if you assume UTF-32.

> Using wcswidth isn't very useful in the editor because it has special
> requirements, like showing control characters with ^C.

Well, it's not really such a big problem to special case wide char
control values and just call wcswidth otherwise...

> That's one of the
> reasons I mostly wrote my own, all the special requirements. I always
> iterate of bytes, which are converted in a mode-dependent way to ints
> (UTF-32). Do you have a case-insensitive compare? Because I limited that
> to ASCII.

wcscasecmp and wcsncasecmp are both available.  But obviously they
use UTF-16, since wchar_t is UTF-16.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24 10:56         ` Bengt Larsson
  2011-02-24 11:15           ` Corinna Vinschen
@ 2011-02-24 11:19           ` Bengt Larsson
  2011-02-24 11:51             ` Corinna Vinschen
  1 sibling, 1 reply; 28+ messages in thread
From: Bengt Larsson @ 2011-02-24 11:19 UTC (permalink / raw)
  To: cygwin

Bengt Larsson wrote:
>I don't use surrogates. I only use UTF-8 and UTF-32. But using cygwin's
>wcwidth may be worth thinking about. I suppose it will be consistent
>with mintty that way; otherwise not?

And: is wcwidth always available in modern Unices? How do you find out
these things? I mean practically available.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24 11:15           ` Corinna Vinschen
@ 2011-02-24 11:40             ` Bengt Larsson
  2011-02-24 11:55               ` Corinna Vinschen
  2011-02-24 12:16             ` Andy Koppe
  1 sibling, 1 reply; 28+ messages in thread
From: Bengt Larsson @ 2011-02-24 11:40 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen wrote:
>> Using wcswidth isn't very useful in the editor because it has special
>> requirements, like showing control characters with ^C.
>
>Well, it's not really such a big problem to special case wide char
>control values and just call wcswidth otherwise...

Oh I see. wcwidth takes a wchar_t. Handily, Kuhn's implementation takes
an UCS character. Now I understand what you mean by wcswidth.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24 11:19           ` Bengt Larsson
@ 2011-02-24 11:51             ` Corinna Vinschen
  2011-02-24 14:48               ` Eric Blake
  0 siblings, 1 reply; 28+ messages in thread
From: Corinna Vinschen @ 2011-02-24 11:51 UTC (permalink / raw)
  To: cygwin

On Feb 24 12:19, Bengt Larsson wrote:
> Bengt Larsson wrote:
> >I don't use surrogates. I only use UTF-8 and UTF-32. But using cygwin's
> >wcwidth may be worth thinking about. I suppose it will be consistent
> >with mintty that way; otherwise not?
> 
> And: is wcwidth always available in modern Unices? How do you find out
> these things? I mean practically available.

wcwidth and wcswidth are XSI extensions, so they are optional.  As for
finding out, that's usally nicely done by autoconf'ing your project.

 
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24 11:40             ` Bengt Larsson
@ 2011-02-24 11:55               ` Corinna Vinschen
  0 siblings, 0 replies; 28+ messages in thread
From: Corinna Vinschen @ 2011-02-24 11:55 UTC (permalink / raw)
  To: cygwin

On Feb 24 12:40, Bengt Larsson wrote:
> Corinna Vinschen wrote:
> >> Using wcswidth isn't very useful in the editor because it has special
> >> requirements, like showing control characters with ^C.
> >
> >Well, it's not really such a big problem to special case wide char
> >control values and just call wcswidth otherwise...
> 
> Oh I see. wcwidth takes a wchar_t. Handily, Kuhn's implementation takes
> an UCS character. Now I understand what you mean by wcswidth.

Yeah, newlibs wcswidth combines UTF-16 surrogates into UCS-32 chars
and calls the internal __wcwidth function, which is basically Kuhn's
code, and which takes a wint_t as parameter.  Since wint_t is 32 bit...
Of course, this trick doesn't work for wcwidth, which will blindly
call __wcwidth with every incoming surrogate half.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24 11:15           ` Corinna Vinschen
  2011-02-24 11:40             ` Bengt Larsson
@ 2011-02-24 12:16             ` Andy Koppe
  2011-02-24 18:51               ` Bengt Larsson
  1 sibling, 1 reply; 28+ messages in thread
From: Andy Koppe @ 2011-02-24 12:16 UTC (permalink / raw)
  To: cygwin

On 24 February 2011 11:14, Corinna Vinschen wrote:
> On Feb 24 11:56, Bengt Larsson wrote:
>> I don't use surrogates. I only use UTF-8 and UTF-32.

... which of course means that you don't support anything but UTF-8
and ASCII locales. Can't argue with that, but you might want to use
nl_langinfo(CODESET) to check and warn if something else is used.

>>  But using cygwin's
>> wcwidth may be worth thinking about. I suppose it will be consistent
>> with mintty that way; otherwise not?
>
> Yes, I think Andy uses the system functions as well.

Yep, as should any other terminal emulator.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24 11:51             ` Corinna Vinschen
@ 2011-02-24 14:48               ` Eric Blake
  0 siblings, 0 replies; 28+ messages in thread
From: Eric Blake @ 2011-02-24 14:48 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1284 bytes --]

On 02/24/2011 04:50 AM, Corinna Vinschen wrote:
> On Feb 24 12:19, Bengt Larsson wrote:
>> Bengt Larsson wrote:
>>> I don't use surrogates. I only use UTF-8 and UTF-32. But using cygwin's
>>> wcwidth may be worth thinking about. I suppose it will be consistent
>>> with mintty that way; otherwise not?
>>
>> And: is wcwidth always available in modern Unices? How do you find out
>> these things? I mean practically available.
> 
> wcwidth and wcswidth are XSI extensions, so they are optional.  As for
> finding out, that's usally nicely done by autoconf'ing your project.

And if you don't mind [L]GPL licensing, gnulib provides a source code
replacement that guarantees wide character support on all modern porting
platforms (particularly useful for mingw, which is sorely lacking on
this front); and is currently working on introducing a wwchar_t type
that is guaranteed to be UTF-32 even on cygwin (this is how coreutils
gets wide character support for things like wc).  Portions of that
gnulib code are incorporated into libunistring.  But from the sounds of
your program's license, I'm not sure you can take advantage of gnulib or
libunistring.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24 12:16             ` Andy Koppe
@ 2011-02-24 18:51               ` Bengt Larsson
  2011-02-25  2:24                 ` Cyrille Lefevre
  0 siblings, 1 reply; 28+ messages in thread
From: Bengt Larsson @ 2011-02-24 18:51 UTC (permalink / raw)
  To: cygwin

Andy Koppe wrote:
>On 24 February 2011 11:14, Corinna Vinschen wrote:
>> On Feb 24 11:56, Bengt Larsson wrote:
>>> I don't use surrogates. I only use UTF-8 and UTF-32.
>
>... which of course means that you don't support anything but UTF-8
>and ASCII locales. Can't argue with that, but you might want to use
>nl_langinfo(CODESET) to check and warn if something else is used.

Utf-8 and a number of 8-bit charsets, actually. I'm getting rather
annoyed that people judge the program without looking at it. And it does
use nl_langinfo(CODESET).

>>>  But using cygwin's
>>> wcwidth may be worth thinking about. I suppose it will be consistent
>>> with mintty that way; otherwise not?
>>
>> Yes, I think Andy uses the system functions as well.
>
>Yep, as should any other terminal emulator.

I have fixed it to use Cygwin's wcswidth.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-24 18:51               ` Bengt Larsson
@ 2011-02-25  2:24                 ` Cyrille Lefevre
  2011-02-25  2:25                   ` Cyrille Lefevre
  2011-02-25  6:47                   ` Bengt Larsson
  0 siblings, 2 replies; 28+ messages in thread
From: Cyrille Lefevre @ 2011-02-25  2:24 UTC (permalink / raw)
  To: cygwin


Le 24/02/2011 19:50, Bengt Larsson a écrit :

> Utf-8 and a number of 8-bit charsets, actually. I'm getting rather
> annoyed that people judge the program without looking at it. And it does
> use nl_langinfo(CODESET).

make install should copy mg to /bin instead of /docs/Command, copy 
documentation files in /usr/share/doc/mg3a and samples (dot files)
in /us/share/doc/mg3a/examples

v2$ echo $LANG
en_US.UTF-8

v2$ mg
M-x emacs-version
Mg 2a (formerly MicroGnuEmacs)

s/2/3/ no ?

v2$ mg
^H a RET
apropos: Segmentation fault
uh!

sigh, no ^X d (aka dired mode) by default !
well, I've tried w/o NO_DIRED and d_makename() needs to be rewritten
a lot to handle dynamic comlumns sizing of gnu ls :-(
to compile w/o NO_DIRED, in function fbackupfile in file fileio.c, replace :
char *malloc();
by
#define rename renamefile

^Z doesn't suspend !

^X ^F doesn't complete :-(

no M-T (transpose-words)

M-x something say [Ambiguous] w/o listing possible solutions

about defines :
-DNO_BACKUP may be replaced by -DMAKEBACKUP=0, so, it is disabled by 
default and may be enable using (make-backup-files) if needed.
as suggested, -DLF_DEFAULT should be defined
-DNOTAB seems to work fine but no-tab-mode and nobom must be switched in 
keymap.c
-DPREFIXREGION seems to work fine
-DREGEX seems to work fine
-DSCROLLBYONE seems to work fine

Regards,

Cyrille Lefevre
-- 
mailto:Cyrille.Lefevre-lists@laposte.net



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-25  2:24                 ` Cyrille Lefevre
@ 2011-02-25  2:25                   ` Cyrille Lefevre
  2011-02-25  6:48                     ` Bengt Larsson
  2011-02-25  6:47                   ` Bengt Larsson
  1 sibling, 1 reply; 28+ messages in thread
From: Cyrille Lefevre @ 2011-02-25  2:25 UTC (permalink / raw)
  To: cygwin


forgot about make install :

install: strip installbin installdoc

PREFIX=/usr
#PREFIX=/usr/local
BINDIR=${PREFIX}/bin
DOCDIR=${PREFIX}/share/doc/mg3a
DOCFILES=README README.misc README.programmer README.reference \
         orig/mgprog.doc orig/README orig/tutorial
SAMPDIR=${DOCDIR}/examples
SAMFILES=.mg .mg-cygwin .mg-xterm

installbin:
         cp mg.exe /usr/local/bin
installdoc:
         mkdir -p ${DOCDIR}/orig ${SAMPDIR}
         for file in ${SAMFILES}; do cp bl/$${file} 
${SAMPDIR}/dot$${file}; done
         for file in ${DOCFILES}; do cp $${file} ${DOCDIR}/$${file}; done

Regards,

Cyrille Lefevre
-- 
mailto:Cyrille.Lefevre-lists@laposte.net


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-25  2:24                 ` Cyrille Lefevre
  2011-02-25  2:25                   ` Cyrille Lefevre
@ 2011-02-25  6:47                   ` Bengt Larsson
  2011-02-25  6:55                     ` Kenneth Wolcott
  1 sibling, 1 reply; 28+ messages in thread
From: Bengt Larsson @ 2011-02-25  6:47 UTC (permalink / raw)
  To: cygwin

Cyrille Lefevre wrote:

Thanks for your informed criticism. But I haven't suggested it should be
delivered with Cygwin.

>make install should copy mg to /bin instead of /docs/Command, 

Yup

>copy 
>documentation files in /usr/share/doc/mg3a and samples (dot files)
>in /us/share/doc/mg3a/examples

Yes. Thanks.

>
>v2$ echo $LANG
>en_US.UTF-8
>
>v2$ mg
>M-x emacs-version
>Mg 2a (formerly MicroGnuEmacs)

Ah. Thanks.

>
>s/2/3/ no ?
>
>v2$ mg
>^H a RET
>apropos: Segmentation fault
>uh!

Old bug. Menitioned in the old documentation. Incredibly hairy code.

>
>sigh, no ^X d (aka dired mode) by default !

True. I never use it. I kind of philosophically disagree with it.

>well, I've tried w/o NO_DIRED and d_makename() needs to be rewritten
>a lot to handle dynamic comlumns sizing of gnu ls :-(

It was good that it worked at all :-)

There is also a NO_BACKUP #define. I don't guarantee what happens if you
remove it.

>to compile w/o NO_DIRED, in function fbackupfile in file fileio.c, replace :
>char *malloc();
>by
>#define rename renamefile

Helpful. Thanks.

>
>^Z doesn't suspend !

I know. The very old code did this for a BSD system. But I have never
figured out how to do this portably on a more modern system. Mentioned
in the documentation.

>
>^X ^F doesn't complete :-(

That would be a nice feature.

>
>no M-T (transpose-words)

Hmm. Could be added I guess.
>
>M-x something say [Ambiguous] w/o listing possible solutions

OK. It never did, actually. Of course we don't have to do everything
Emacs did.

>
>about defines :
>-DNO_BACKUP may be replaced by -DMAKEBACKUP=0, so, it is disabled by 
>default and may be enable using (make-backup-files) if needed.
>as suggested, -DLF_DEFAULT should be defined

If it were distributed with Cygwin I would certainly define LF_DEFAULT.
I wouldn't do it all on my own, but certainly if it's a condition.

>-DNOTAB seems to work fine but no-tab-mode and nobom must be switched in 
>keymap.c

OH! Thanks. Fixed.

>-DPREFIXREGION seems to work fine
>-DREGEX seems to work fine

I haven't touched those.

>-DSCROLLBYONE seems to work fine

OK. That was more thorough than I asked for ;-) But very helpful.
Thanks.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-25  2:25                   ` Cyrille Lefevre
@ 2011-02-25  6:48                     ` Bengt Larsson
  0 siblings, 0 replies; 28+ messages in thread
From: Bengt Larsson @ 2011-02-25  6:48 UTC (permalink / raw)
  To: cygwin

Cyrille Lefevre wrote:
>
>forgot about make install :

Again Super-helpful. Thanks.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-25  6:47                   ` Bengt Larsson
@ 2011-02-25  6:55                     ` Kenneth Wolcott
  2011-02-25 14:09                       ` Bengt Larsson
  0 siblings, 1 reply; 28+ messages in thread
From: Kenneth Wolcott @ 2011-02-25  6:55 UTC (permalink / raw)
  To: cygwin

One comment in-line...

On Thu, Feb 24, 2011 at 22:47, Bengt Larsson <lists.cygwin2@bengtl.net> wrote:
> Cyrille Lefevre wrote:
>
> Thanks for your informed criticism. But I haven't suggested it should be
> delivered with Cygwin.
>
>>make install should copy mg to /bin instead of /docs/Command,
>
> Yup
>
>>copy
>>documentation files in /usr/share/doc/mg3a and samples (dot files)
>>in /us/share/doc/mg3a/examples
>
> Yes. Thanks.
>
>>
>>v2$ echo $LANG
>>en_US.UTF-8
>>
>>v2$ mg
>>M-x emacs-version
>>Mg 2a (formerly MicroGnuEmacs)
>
> Ah. Thanks.
>
>>
>>s/2/3/ no ?
>>
>>v2$ mg
>>^H a RET
>>apropos: Segmentation fault
>>uh!
>
> Old bug. Menitioned in the old documentation. Incredibly hairy code.
>
>>
>>sigh, no ^X d (aka dired mode) by default !
>
> True. I never use it. I kind of philosophically disagree with it.

  Strange, as "dired" is one of the most important pieces of emacs and
when one says "emacs" and then says "but this version doesn't have
'dired'", the emacs person will go, "What?!"  It's kInd of like having
a kitchen sink with no running water :-)

>>well, I've tried w/o NO_DIRED and d_makename() needs to be rewritten
>>a lot to handle dynamic comlumns sizing of gnu ls :-(
>
> It was good that it worked at all :-)
>
> There is also a NO_BACKUP #define. I don't guarantee what happens if you
> remove it.
>
>>to compile w/o NO_DIRED, in function fbackupfile in file fileio.c, replace :
>>char *malloc();
>>by
>>#define rename renamefile
>
> Helpful. Thanks.
>
>>
>>^Z doesn't suspend !
>
> I know. The very old code did this for a BSD system. But I have never
> figured out how to do this portably on a more modern system. Mentioned
> in the documentation.
>
>>
>>^X ^F doesn't complete :-(
>
> That would be a nice feature.
>
>>
>>no M-T (transpose-words)
>
> Hmm. Could be added I guess.
>>
>>M-x something say [Ambiguous] w/o listing possible solutions
>
> OK. It never did, actually. Of course we don't have to do everything
> Emacs did.
>
>>
>>about defines :
>>-DNO_BACKUP may be replaced by -DMAKEBACKUP=0, so, it is disabled by
>>default and may be enable using (make-backup-files) if needed.
>>as suggested, -DLF_DEFAULT should be defined
>
> If it were distributed with Cygwin I would certainly define LF_DEFAULT.
> I wouldn't do it all on my own, but certainly if it's a condition.
>
>>-DNOTAB seems to work fine but no-tab-mode and nobom must be switched in
>>keymap.c
>
> OH! Thanks. Fixed.
>
>>-DPREFIXREGION seems to work fine
>>-DREGEX seems to work fine
>
> I haven't touched those.
>
>>-DSCROLLBYONE seems to work fine
>
> OK. That was more thorough than I asked for ;-) But very helpful.
> Thanks.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin]
  2011-02-24  8:56       ` Corinna Vinschen
  2011-02-24 10:56         ` Bengt Larsson
@ 2011-02-25  8:05         ` Thomas Wolff
  2011-02-25 11:06           ` Corinna Vinschen
  1 sibling, 1 reply; 28+ messages in thread
From: Thomas Wolff @ 2011-02-25  8:05 UTC (permalink / raw)
  To: cygwin

Am 24.02.2011 09:56, schrieb Corinna Vinschen:
> When on Cygwin, you might better use Cygwin's(*) wcwidth function.  It's
> based on the same code from Markus Kuhn, but it interacts with the
> setlocale function to make sure that the width returned for the CJK
> ambiguous width characters makes sense in the given locale.  Plus, it
> supports a Cygwin-specific locale modifier '@cjknarrow' which allows the
> user to modify this behaviour.  When using your own wcwidth, you're
> giving up on this feature.
On the other hand, not specific for cygwin, the wcwidth/wcswidht 
functions are in general based on installed locale data.
But you can never know whether the terminal you are running in actually 
uses those data.
On a Linux system, you may encounter a wide range of different 
environments, for example:
rxvt based on system locale which is often based on an outdated locale 
data installation (e.g. Unicode 3)
xterm with a hard-coded wcwidth
mlterm with some tweaks
remote operation (rlogin/ssh to/from other system) with inconsistent 
locale data base
...

For that reason, my editor mined implements an auto-detection of actual 
terminal width data (checking Unicode version and a number of 
terminal-specific odds).

For cygwin, it might be useful (although not standard) for wcwidth to 
consider whether it's running in a cygwin console or a terminal, so e.g. 
wcwidth (0x8080) should return 2 in mintty but 1 in a cygwin console.

Erik Blake wrote:
> And if you don't mind [L]GPL licensing, gnulib provides a source code
> replacement that guarantees wide character support on all modern porting
> platforms (particularly useful for mingw, which is sorely lacking on
> this front); and is currently working on introducing a wwchar_t type
> that is guaranteed to be UTF-32 even on cygwin (this is how coreutils
> gets wide character support for things like wc).  Portions of that
> gnulib code are incorporated into libunistring.  But from the sounds of
> your program's license, I'm not sure you can take advantage of gnulib or
> libunistring.
Maybe I should check whether my auto-detection code could be contributed 
to that project...

Thomas

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin]
  2011-02-25  8:05         ` wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin] Thomas Wolff
@ 2011-02-25 11:06           ` Corinna Vinschen
  2011-02-26  9:52             ` Andy Koppe
  0 siblings, 1 reply; 28+ messages in thread
From: Corinna Vinschen @ 2011-02-25 11:06 UTC (permalink / raw)
  To: cygwin

On Feb 25 09:05, Thomas Wolff wrote:
> Am 24.02.2011 09:56, schrieb Corinna Vinschen:
> >When on Cygwin, you might better use Cygwin's(*) wcwidth function.  It's
> >based on the same code from Markus Kuhn, but it interacts with the
> >setlocale function to make sure that the width returned for the CJK
> >ambiguous width characters makes sense in the given locale.  Plus, it
> >supports a Cygwin-specific locale modifier '@cjknarrow' which allows the
> >user to modify this behaviour.  When using your own wcwidth, you're
> >giving up on this feature.
> On the other hand, not specific for cygwin, the wcwidth/wcswidht
> functions are in general based on installed locale data.
> But you can never know whether the terminal you are running in
> actually uses those data.
> On a Linux system, you may encounter a wide range of different
> environments, for example:
> rxvt based on system locale which is often based on an outdated
> locale data installation (e.g. Unicode 3)
> xterm with a hard-coded wcwidth
> mlterm with some tweaks
> remote operation (rlogin/ssh to/from other system) with inconsistent
> locale data base
> ...
> 
> For that reason, my editor mined implements an auto-detection of
> actual terminal width data (checking Unicode version and a number of
> terminal-specific odds).
> 
> For cygwin, it might be useful (although not standard) for wcwidth
> to consider whether it's running in a cygwin console or a terminal,
> so e.g. wcwidth (0x8080) should return 2 in mintty but 1 in a cygwin
> console.

Hmm, I don't think that's the right thing to do.  How's the OS version
of wcwidht supposed to know what the wcwidth function is used for?
After all, the application does *not* specify that it calls wcwidth
to get the size of a character for a specifc purpose.  How's the function
to know that the character is supposed to be printed to the current tty?
What if the application has open handles to more than one tty?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-25  6:55                     ` Kenneth Wolcott
@ 2011-02-25 14:09                       ` Bengt Larsson
  2011-02-25 21:46                         ` Bengt Larsson
  0 siblings, 1 reply; 28+ messages in thread
From: Bengt Larsson @ 2011-02-25 14:09 UTC (permalink / raw)
  To: cygwin

Kenneth Wolcott wrote:
>>>sigh, no ^X d (aka dired mode) by default !
>>
>> True. I never use it. I kind of philosophically disagree with it.
>
>  Strange, as "dired" is one of the most important pieces of emacs and
>when one says "emacs" and then says "but this version doesn't have
>'dired'", the emacs person will go, "What?!"  It's kInd of like having
>a kitchen sink with no running water :-)

Mmm. Could you tell me which commands you use, and what they do, in
order of decreasing priority?

I'm thinking one could do a simple dired, generating the list
internally. Delete, Visit file, Rename, how does that sound?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-25 14:09                       ` Bengt Larsson
@ 2011-02-25 21:46                         ` Bengt Larsson
  2011-02-26  2:48                           ` Kenneth Wolcott
  0 siblings, 1 reply; 28+ messages in thread
From: Bengt Larsson @ 2011-02-25 21:46 UTC (permalink / raw)
  To: cygwin

Bengt Larsson wrote:
>Kenneth Wolcott wrote:
>>>>sigh, no ^X d (aka dired mode) by default !
>>>
>>> True. I never use it. I kind of philosophically disagree with it.
>>
>>  Strange, as "dired" is one of the most important pieces of emacs and
>>when one says "emacs" and then says "but this version doesn't have
>>'dired'", the emacs person will go, "What?!"  It's kInd of like having
>>a kitchen sink with no running water :-)
>
>Mmm. Could you tell me which commands you use, and what they do, in
>order of decreasing priority?
>
>I'm thinking one could do a simple dired, generating the list
>internally. Delete, Visit file, Rename, how does that sound?

I have implemented dired.

But I suppose this is getting off topic. There is some support for
creating a mailing list at my domain so I'll see if I can do that. If I
do, I'll announce it here. I'll keep updating the website. there will be
a Changelog.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Mg3a - a version of Mg2a developed on Cygwin
  2011-02-25 21:46                         ` Bengt Larsson
@ 2011-02-26  2:48                           ` Kenneth Wolcott
  0 siblings, 0 replies; 28+ messages in thread
From: Kenneth Wolcott @ 2011-02-26  2:48 UTC (permalink / raw)
  To: cygwin

On Fri, Feb 25, 2011 at 13:46, Bengt Larsson <lists.cygwin2@bengtl.net> wrote:
> Bengt Larsson wrote:
>>Kenneth Wolcott wrote:
>>>>>sigh, no ^X d (aka dired mode) by default !
>>>>
>>>> True. I never use it. I kind of philosophically disagree with it.
>>>
>>>  Strange, as "dired" is one of the most important pieces of emacs and
>>>when one says "emacs" and then says "but this version doesn't have
>>>'dired'", the emacs person will go, "What?!"  It's kInd of like having
>>>a kitchen sink with no running water :-)
>>
>>Mmm. Could you tell me which commands you use, and what they do, in
>>order of decreasing priority?
>>
>>I'm thinking one could do a simple dired, generating the list
>>internally. Delete, Visit file, Rename, how does that sound?
>
> I have implemented dired.
>
> But I suppose this is getting off topic. There is some support for
> creating a mailing list at my domain so I'll see if I can do that. If I
> do, I'll announce it here. I'll keep updating the website. there will be
> a Changelog.

  What most people who used Emacs would use Dired for is to avoid
having to go to a terminal shell to do:
ls
ls -l
ls -lrt
ls -d
rm <some_file>
rm <glob_expression>
mv <file1> <file2>
chmod
chown
many, many other things as well

Ken Wolcott

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin]
  2011-02-25 11:06           ` Corinna Vinschen
@ 2011-02-26  9:52             ` Andy Koppe
  0 siblings, 0 replies; 28+ messages in thread
From: Andy Koppe @ 2011-02-26  9:52 UTC (permalink / raw)
  To: cygwin

On 25 February 2011 11:05, Corinna Vinschen wrote:
> On Feb 25 09:05, Thomas Wolff wrote:
>> For cygwin, it might be useful (although not standard) for wcwidth
>> to consider whether it's running in a cygwin console or a terminal,
>> so e.g. wcwidth (0x8080) should return 2 in mintty but 1 in a cygwin
>> console.
>
> Hmm, I don't think that's the right thing to do.  How's the OS version
> of wcwidht supposed to know what the wcwidth function is used for?
> After all, the application does *not* specify that it calls wcwidth
> to get the size of a character for a specifc purpose.  How's the function
> to know that the character is supposed to be printed to the current tty?
> What if the application has open handles to more than one tty?

I agree. Also, I'd be surprised if character width in the console was
actually constant across different locales, fonts, and Windows
versions.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2011-02-26  9:52 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-23  8:57 Mg3a - a version of Mg2a developed on Cygwin Bengt Larsson
2011-02-23  9:11 ` Bengt Larsson
2011-02-23  9:29   ` Corinna Vinschen
2011-02-23  9:33     ` Bengt Larsson
2011-02-23 18:25 ` Buchbinder, Barry (NIH/NIAID) [E]
2011-02-23 18:53   ` Andrew Schulman
2011-02-23 19:36     ` Bengt Larsson
2011-02-24  8:56       ` Corinna Vinschen
2011-02-24 10:56         ` Bengt Larsson
2011-02-24 11:15           ` Corinna Vinschen
2011-02-24 11:40             ` Bengt Larsson
2011-02-24 11:55               ` Corinna Vinschen
2011-02-24 12:16             ` Andy Koppe
2011-02-24 18:51               ` Bengt Larsson
2011-02-25  2:24                 ` Cyrille Lefevre
2011-02-25  2:25                   ` Cyrille Lefevre
2011-02-25  6:48                     ` Bengt Larsson
2011-02-25  6:47                   ` Bengt Larsson
2011-02-25  6:55                     ` Kenneth Wolcott
2011-02-25 14:09                       ` Bengt Larsson
2011-02-25 21:46                         ` Bengt Larsson
2011-02-26  2:48                           ` Kenneth Wolcott
2011-02-24 11:19           ` Bengt Larsson
2011-02-24 11:51             ` Corinna Vinschen
2011-02-24 14:48               ` Eric Blake
2011-02-25  8:05         ` wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin] Thomas Wolff
2011-02-25 11:06           ` Corinna Vinschen
2011-02-26  9:52             ` Andy Koppe

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).