delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/08/09:32:00

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4BBDDABD.7030304@towo.net>
Date: Thu, 08 Apr 2010 15:31:41 +0200
From: Thomas Wolff <towo AT towo DOT net>
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Fwd: cannot search for -a in man inside mintty under cygwin-1.7
References: <28139bc1003300442w2d48c7aag371fad0ed9eb26e8 AT mail DOT gmail DOT com> <28139bc1003300513x159749d1j84f197eee085be0 AT mail DOT gmail DOT com> <4BB1F2B0 DOT 4040900 AT towo DOT net> <416096c61003301143y1b780160s331e2e1522a6ff18 AT mail DOT gmail DOT com>
In-Reply-To: <416096c61003301143y1b780160s331e2e1522a6ff18@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Andy Koppe schrieb:
>> moo.tinys wrote:
>>     
>>> using mintty
>>> LANG=zh_CN.UTF-8 mintty
>>> inside mintty:
>>> $ man man
>>> /-
>>> Pattern not found  (press RETURN)
>>>       
> With UTF-8, hyphen/minus symbols in the man page are displays as the
> Unicode codepoints for hyphen or minus. These are different from ASCII
> '-', which is why your search didn't turn up anything.
>
> This isn't mintty-specific.
>
> Thomas Wolff:
>   
>> This was discussed here before but I'm not sure whether a solution was
>> already outlined.
>> The problem appeared on Linux too, some years ago, but has been fixed
>> meanwhile.
>> Differences are:
>> man calls nroff -mandoc on cygwin, nroff -mandocdb on Linux. The latter
>> macro package of groff includes the following which is prepended to the
>> manual page before feeding it to nroff for formatting:
>> .if '\*[.T]'utf8' \{\
>> .  char \- \N'45'
>> .  char  - \N'45'
>> .  char  ' \N'39'
>> .  char  ` \N'96'
>> .\}
>>     
>
> Thanks, glad to hear there is a fix. I'll use this in the mintty
> manpage, so at least searching will work there.
>
> Question: what's the *[.T] pattern matched against?
>   
I guess the -Tutf8 parameter also showed by procps (with some luck while 
invoking man...):
troff -mtty-char -mandoc -Tutf8
groff -mtty-char -Tutf8 -P-c -mandoc
I have no idea why both groff and troff appear in the process list or 
how the -Tutf8 parameter is set there.

>> Checking the program chain of 'man' with procps, some other macros are added
>> already (simply using 'echo'), that's where it could also be added without a
>> complete new macro package (i.e. without changing groff). However, the
>> auxiliary roff codes are apparently hard-coded in man.exe so that'll have to
>> be changed.
>>     
> What are those auxiliary roff codes?
>   
I mean those being echoed into the nroff pipe as revealed by 'procps 
xww' while running man:
sh -c (cd "/usr/share/man" && (echo ".pl 1100i"; /usr/bin/gunzip -c 
'/usr/share/man/man1/mintty.1.gz'; echo ".\\\""; echo ".pl \n(nlu+10") | 
/usr/bin/tbl | /usr/bin/nroff -c -mandoc 2>/dev/null | /usr/bin/less -isrR)

I guess the additional lines as quoted above can simply be added by a 
few strcat calls inserted before line 572 of man.c.
I couldn't test, though, because the man source package needs some 
interactive configuration before make works.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019