public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [ITP] italic-man
@ 2023-01-21 17:04 Thomas Wolff
  2023-02-16 18:59 ` Jon Turney
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Wolff @ 2023-01-21 17:04 UTC (permalink / raw)
  To: cygwin-apps

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

italic-man installs two scripts and hooks them into the workflow of the 
'man' command so that the italic attribute of manual pages is actually 
displayed as italics in terminals that support it.

cygport file attached

[-- Attachment #2: italic-man.cygport --]
[-- Type: text/plain, Size: 793 bytes --]

NAME=italic-man
VERSION=1.0
RELEASE=1
ARCH=noarch

SUMMARY="Enabling italic display in manual pages"
CATEGORY="Utils Doc"
HOMEPAGE=https://github.com/mintty/italic-man
DESCRIPTION="italic-man installs two scripts and hooks them into the workflow of the 'man' command so that the italic attribute of manual pages is actually displayed as italics in terminals that support it."
LICENSE="GNU GPL V3"

SRC_URI=https://github.com/mintty/$NAME/archive/$VERSION/$NAME-$VERSION.tar.gz

SRC_DIR=.

src_compile() {
    :
}

src_install() {
    cd $S/$NAME-$VERSION
    doman italic-man.7
    insinto /usr/share/${NAME}
    doins grotty iroff
    insinto /etc/postinstall
    newins postinstall ${NAME}.sh
    newins postinstall zp_${NAME}.sh
    insinto /etc/preremove
    newins preremove ${NAME}.sh
}

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

* Re: [ITP] italic-man
  2023-01-21 17:04 [ITP] italic-man Thomas Wolff
@ 2023-02-16 18:59 ` Jon Turney
  2023-02-16 19:17   ` Thomas Wolff
  0 siblings, 1 reply; 18+ messages in thread
From: Jon Turney @ 2023-02-16 18:59 UTC (permalink / raw)
  To: Thomas Wolff, cygwin-apps, Achim Gratz

On 21/01/2023 17:04, Thomas Wolff via Cygwin-apps wrote:
> italic-man installs two scripts and hooks them into the workflow of the 
> 'man' command so that the italic attribute of manual pages is actually 
> displayed as italics in terminals that support it.
> 
> cygport file attached

Thanks very much for having another go at this.

I'm still not overly keen on postinstall/preremove scripts which modify 
a configuration file belonging to another package, so I think I'm going 
to defer to Achim on approving this.

Taking a step back, may I ask a couple of questions?

- Can this be done as a patch to man-db and/or groff?

(perhaps with a separate man-italic package which just contains a marker 
file which enables the functionality?)

- (If different) how would this be done in an upstreamable way?



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

* Re: [ITP] italic-man
  2023-02-16 18:59 ` Jon Turney
@ 2023-02-16 19:17   ` Thomas Wolff
  2023-06-21 21:45     ` Thomas Wolff
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Wolff @ 2023-02-16 19:17 UTC (permalink / raw)
  To: Jon Turney, cygwin-apps, Achim Gratz


Am 16.02.2023 um 19:59 schrieb Jon Turney:
> On 21/01/2023 17:04, Thomas Wolff via Cygwin-apps wrote:
>> italic-man installs two scripts and hooks them into the workflow of 
>> the 'man' command so that the italic attribute of manual pages is 
>> actually displayed as italics in terminals that support it.
>>
>> cygport file attached
>
> Thanks very much for having another go at this.
>
> I'm still not overly keen on postinstall/preremove scripts which 
> modify a configuration file belonging to another package, so I think 
> I'm going to defer to Achim on approving this.
>
> Taking a step back, may I ask a couple of questions?
>
> - Can this be done as a patch to man-db and/or groff?
>
> (perhaps with a separate man-italic package which just contains a 
> marker file which enables the functionality?)
>
> - (If different) how would this be done in an upstreamable way?
Thanks for taking a look.
I understand your hesitation but there are a number of zp_ postinstall 
scripts around that make updates to mandb, mime db, desktop, various 
caches, maybe crontab.
Well, yes, there could be a zp_ script for man that makes this entry to 
/etc/man_db.conf itself in the presence of the italic-man package. If 
that's desired and someone else updates man, I will cooperate on this.
I think the installation of italic-man does this in an upstreamable way 
except for the postinstall mechanism of course which seems to be 
different (if existent at all) everywhere.
Thomas

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

* Re: [ITP] italic-man
  2023-02-16 19:17   ` Thomas Wolff
@ 2023-06-21 21:45     ` Thomas Wolff
  2023-06-25 13:36       ` Jon Turney
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Wolff @ 2023-06-21 21:45 UTC (permalink / raw)
  To: cygwin-apps


Am 16.02.2023 um 20:17 schrieb Thomas Wolff via Cygwin-apps:
>
> Am 16.02.2023 um 19:59 schrieb Jon Turney:
>> On 21/01/2023 17:04, Thomas Wolff via Cygwin-apps wrote:
>>> italic-man installs two scripts and hooks them into the workflow of 
>>> the 'man' command so that the italic attribute of manual pages is 
>>> actually displayed as italics in terminals that support it.
>>>
>>> cygport file attached
>>
>> Thanks very much for having another go at this.
>>
>> I'm still not overly keen on postinstall/preremove scripts which 
>> modify a configuration file belonging to another package, so I think 
>> I'm going to defer to Achim on approving this.
>>
>> Taking a step back, may I ask a couple of questions?
>>
>> - Can this be done as a patch to man-db and/or groff?
>>
>> (perhaps with a separate man-italic package which just contains a 
>> marker file which enables the functionality?)
>>
>> - (If different) how would this be done in an upstreamable way?
> Thanks for taking a look.
> I understand your hesitation but there are a number of zp_ postinstall 
> scripts around that make updates to mandb, mime db, desktop, various 
> caches, maybe crontab.
> Well, yes, there could be a zp_ script for man that makes this entry 
> to /etc/man_db.conf itself in the presence of the italic-man package. 
> If that's desired and someone else updates man, I will cooperate on this.
> I think the installation of italic-man does this in an upstreamable 
> way except for the postinstall mechanism of course which seems to be 
> different (if existent at all) everywhere.
> Thomas
I've added a zp_man-db-italic.dash postinstall script as a proposal for 
man-db to address your concerns, to be found in the repository 
github.com/mintty/italic-man. However, I find not documentation about 
these zp_ things, it seems they are just all called after each setup. So 
would it actually make a difference whether the zp_ is a script of 
italic-man or of man-db? I've also added a cygport file to the 
repository so you can try the update if you like.
About your first question
> - Can this be done as a patch to man-db and/or groff?
Do you mean the whole thing should not be a separate package at all but 
completely patched into man-db?
Looking forward to your opinion and that of the man-db package maintainer.
And yes, the hook works on Linux too, so it could be provided somehow 
upstream.
Thomas

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

* Re: [ITP] italic-man
  2023-06-21 21:45     ` Thomas Wolff
@ 2023-06-25 13:36       ` Jon Turney
  2023-06-25 13:59         ` Thomas Wolff
  0 siblings, 1 reply; 18+ messages in thread
From: Jon Turney @ 2023-06-25 13:36 UTC (permalink / raw)
  To: Thomas Wolff, cygwin-apps

On 21/06/2023 22:45, Thomas Wolff via Cygwin-apps wrote:
> 
> Am 16.02.2023 um 20:17 schrieb Thomas Wolff via Cygwin-apps:
>>
>> Am 16.02.2023 um 19:59 schrieb Jon Turney:
>>> On 21/01/2023 17:04, Thomas Wolff via Cygwin-apps wrote:
>>>> italic-man installs two scripts and hooks them into the workflow of 
>>>> the 'man' command so that the italic attribute of manual pages is 
>>>> actually displayed as italics in terminals that support it.
>>>>
>>>> cygport file attached
>>>
>>> Thanks very much for having another go at this.
>>>
>>> I'm still not overly keen on postinstall/preremove scripts which 
>>> modify a configuration file belonging to another package, so I think 
>>> I'm going to defer to Achim on approving this.
>>>
>>> Taking a step back, may I ask a couple of questions?
>>>
>>> - Can this be done as a patch to man-db and/or groff?
>>>
>>> (perhaps with a separate man-italic package which just contains a 
>>> marker file which enables the functionality?)
>>>
>>> - (If different) how would this be done in an upstreamable way?
>> Thanks for taking a look.
>> I understand your hesitation but there are a number of zp_ postinstall 
>> scripts around that make updates to mandb, mime db, desktop, various 
>> caches, maybe crontab.

There's a difference between updating a cache or db of files which exist 
on the filesystem after the package update and modifying a file which 
might be overwritten by reinstalling or updating a different package.

>> Well, yes, there could be a zp_ script for man that makes this entry 
>> to /etc/man_db.conf itself in the presence of the italic-man package. 
>> If that's desired and someone else updates man, I will cooperate on this.
>> I think the installation of italic-man does this in an upstreamable 
>> way except for the postinstall mechanism of course which seems to be 
>> different (if existent at all) everywhere.
>> Thomas
> I've added a zp_man-db-italic.dash postinstall script as a proposal for 
> man-db to address your concerns, to be found in the repository 
> github.com/mintty/italic-man. However, I find not documentation about 
> these zp_ things, it seems they are just all called after each setup. So 

They are briefly covered in [1].  If that's missing some details, please 
let me know and I'll see what can be done to improve it.

[1] https://cygwin.com/packaging-package-files.html#postinstall

> would it actually make a difference whether the zp_ is a script of 
> italic-man or of man-db? I've also added a cygport file to the 
> repository so you can try the update if you like.
> About your first question
>> - Can this be done as a patch to man-db and/or groff?
> Do you mean the whole thing should not be a separate package at all but 
> completely patched into man-db?

Well, yes, that would avoid all the knots caused by post-install scripts 
with uncertain ordering I'm worrying about.

Can you explain, in general terms, why this isn't a feature of stock 
man-db already?

> Looking forward to your opinion and that of the man-db package maintainer.
> And yes, the hook works on Linux too, so it could be provided somehow 
> upstream.

Thanks continuing to grind away at this.


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

* Re: [ITP] italic-man
  2023-06-25 13:36       ` Jon Turney
@ 2023-06-25 13:59         ` Thomas Wolff
  2023-06-25 16:02           ` ASSI
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Wolff @ 2023-06-25 13:59 UTC (permalink / raw)
  To: Jon Turney, cygwin-apps


Am 25.06.2023 um 15:36 schrieb Jon Turney:
> On 21/06/2023 22:45, Thomas Wolff via Cygwin-apps wrote:
>>
>> Am 16.02.2023 um 20:17 schrieb Thomas Wolff via Cygwin-apps:
>>>
>>> Am 16.02.2023 um 19:59 schrieb Jon Turney:
>>>> On 21/01/2023 17:04, Thomas Wolff via Cygwin-apps wrote:
>>>>> italic-man installs two scripts and hooks them into the workflow 
>>>>> of the 'man' command so that the italic attribute of manual pages 
>>>>> is actually displayed as italics in terminals that support it.
>>>>>
>>>>> cygport file attached
>>>>
>>>> Thanks very much for having another go at this.
>>>>
>>>> I'm still not overly keen on postinstall/preremove scripts which 
>>>> modify a configuration file belonging to another package, so I 
>>>> think I'm going to defer to Achim on approving this.
>>>>
>>>> Taking a step back, may I ask a couple of questions?
>>>>
>>>> - Can this be done as a patch to man-db and/or groff?
>>>>
>>>> (perhaps with a separate man-italic package which just contains a 
>>>> marker file which enables the functionality?)
>>>>
>>>> - (If different) how would this be done in an upstreamable way?
>>> Thanks for taking a look.
>>> I understand your hesitation but there are a number of zp_ 
>>> postinstall scripts around that make updates to mandb, mime db, 
>>> desktop, various caches, maybe crontab.
>
> There's a difference between updating a cache or db of files which 
> exist on the filesystem after the package update and modifying a file 
> which might be overwritten by reinstalling or updating a different 
> package.
>
>>> Well, yes, there could be a zp_ script for man that makes this entry 
>>> to /etc/man_db.conf itself in the presence of the italic-man 
>>> package. If that's desired and someone else updates man, I will 
>>> cooperate on this.
>>> I think the installation of italic-man does this in an upstreamable 
>>> way except for the postinstall mechanism of course which seems to be 
>>> different (if existent at all) everywhere.
>>> Thomas
>> I've added a zp_man-db-italic.dash postinstall script as a proposal 
>> for man-db to address your concerns, to be found in the repository 
>> github.com/mintty/italic-man. However, I find not documentation about 
>> these zp_ things, it seems they are just all called after each setup. So 
>
> They are briefly covered in [1].  If that's missing some details, 
> please let me know and I'll see what can be done to improve it.
>
> [1] https://cygwin.com/packaging-package-files.html#postinstall
>
>> would it actually make a difference whether the zp_ is a script of 
>> italic-man or of man-db? I've also added a cygport file to the 
>> repository so you can try the update if you like.
Still interested in your opinion about this question. Also whether it's 
OK that package italic-man provided a zp script that modified 
/etc/man_db.conf.

>> About your first question
>>> - Can this be done as a patch to man-db and/or groff?
>> Do you mean the whole thing should not be a separate package at all 
>> but completely patched into man-db?
>
> Well, yes, that would avoid all the knots caused by post-install 
> scripts with uncertain ordering I'm worrying about.
I think I have addressed those uncertainties and the problem with the 
man-db patch is that man-db package maintainers would need to take up 
the issue...

>
> Can you explain, in general terms, why this isn't a feature of stock 
> man-db already?
There is option grotty -i in stock man-db but grotty is a tool deeply 
embedded in the man toolchain and there is no user-friendly documented 
way to inject this option into the toolchain, other than replacing 
grotty with a wrapper script which is effectively all my package does.

>
>> Looking forward to your opinion and that of the man-db package 
>> maintainer.
>> And yes, the hook works on Linux too, so it could be provided somehow 
>> upstream.
>
> Thanks continuing to grind away at this.
>


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

* Re: [ITP] italic-man
  2023-06-25 13:59         ` Thomas Wolff
@ 2023-06-25 16:02           ` ASSI
  0 siblings, 0 replies; 18+ messages in thread
From: ASSI @ 2023-06-25 16:02 UTC (permalink / raw)
  To: cygwin-apps


[I've had no time to look at this in detail and that will have to wait a
bit more.]

Thomas Wolff via Cygwin-apps writes:
>>> would it actually make a difference whether the zp_ is a script of
>>> italic-man or of man-db? I've also added a cygport file to the
>>> repository so you can try the update if you like.
> Still interested in your opinion about this question. Also whether
> it's OK that package italic-man provided a zp script that modified
> /etc/man_db.conf.

In principle I think replacing one tool with another that  has the same
name and slightly different functionality should be done via the
alternatives system, not hand-rolled scripts.  You'd still need
postinstall scripts to set it up correctly.

>>> About your first question
>>>> - Can this be done as a patch to man-db and/or groff?
>>> Do you mean the whole thing should not be a separate package at all
>>> but completely patched into man-db?
>>
>> Well, yes, that would avoid all the knots caused by post-install
>> scripts with uncertain ordering I'm worrying about.
> I think I have addressed those uncertainties and the problem with the
> man-db patch is that man-db package maintainers would need to take up
> the issue...

I'd prefer that work be one upstream since none of it is specific to
Cygwin, which looks like it would be eminently possible given the nature
of your change.

>> Can you explain, in general terms, why this isn't a feature of stock
>> man-db already?
> There is option grotty -i in stock man-db but grotty is a tool deeply
> embedded in the man toolchain and there is no user-friendly documented
> way to inject this option into the toolchain, other than replacing
> grotty with a wrapper script which is effectively all my package does.

This is why to me it would make a lot more sense to work with upstream
to come to a solution.  Colin Watson has been pretty receptive in the
past.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

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

* Re: [ITP] italic-man
  2019-08-11  9:33             ` Thomas Wolff
@ 2019-08-11 16:17               ` Achim Gratz
  0 siblings, 0 replies; 18+ messages in thread
From: Achim Gratz @ 2019-08-11 16:17 UTC (permalink / raw)
  To: cygwin-apps

Thomas Wolff writes:
>> How are updates to man-db, /etc/man_db.conf etc. handled?
> I checked the man-db postinstall script, and it does not overwrite
> man_db.conf if it exists already, so the modification will persist.

No postinstall script should ever modify files in /etc if they have been
changed from their default.  By extension, they shouldn't do any editing
there either.

>> Is a permanent postinstall script provided to maintain the conf on man-db updates?
> Not needed under the observation above. If it were, how would a
> permanent postinstall be deployed?

By naming it correctly and making sure it behaves sensibly considering
that it runs each time setup finishes, i.e. exiting as early as possible
if there's nothing to do, using dash instead of bash and a number of
other things.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

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

* Re: [ITP] italic-man
  2019-08-10 22:29           ` Brian Inglis
@ 2019-08-11  9:33             ` Thomas Wolff
  2019-08-11 16:17               ` Achim Gratz
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Wolff @ 2019-08-11  9:33 UTC (permalink / raw)
  To: cygwin-apps


Am 11.08.2019 um 00:29 schrieb Brian Inglis:
> On 2019-08-10 03:07, Thomas Wolff wrote:
>> Am 09.08.2019 um 22:51 schrieb Brian Inglis:
>>> On 2019-08-09 13:31, Thomas Wolff wrote:
>>>> Am 09.08.2019 um 20:56 schrieb Achim Gratz:
>>>>> Jon Turney writes:
>>>>>> This gets a GTG from me.
>>>>>> I believe that according to our stated procedures additional approvals
>>>>>> are required, because this package is unique to cygwin.
>>>>> I'm not sure I remember correctly from when the discussion went on the
>>>>> first time, but wasn't there some mumbling about this partly going into
>>>>> groff?  If that's still the case, remind me what this would entail and
>>>>> I'll look into it.
>>>> There are multiple ways of activating the feature (also described in the man
>>>> page).
>>>> The previous strategy placed a shell script wrapper "groff" aside groff, so the
>>>> groff script and groff.exe would coexist in /bin. This was tricky to install and
>>>> particularly it reportedly did not survive a package update of groff.
>>>> The new approach does not use this wrapper anymore. Instead it redirects nroff
>>>> to the package-supplied iroff script by configuration in /etc/man_db.conf.
> How are updates to man-db, /etc/man_db.conf etc. handled?
I checked the man-db postinstall script, and it does not overwrite 
man_db.conf if it exists already, so the modification will persist.
> Is a permanent postinstall script provided to maintain the conf on man-db updates?
Not needed under the observation above. If it were, how would a 
permanent postinstall be deployed?
Thanks,
Thomas

>>> There's also use of the undocumented LESS_TERMCAP_... with GROFF_NO_SGR env vars
>>> (see attached - must be sourced from profile or rc) to remap bold, underline,
>>> etc. into italic and/or colour, or whatever else you want to change, in all less
>>> output.
>> So (without my package) LESS_TERMCAP_us=$(tput sitm) man ls
>> should have the same effect? Cannot reproduce. And what does GROFF_NO_SGR do?
> Those settings affect all *less* output, not just *man*.
> Some people can't stand any colours (white on black was good enough for my
> grandfather...) the same as I couldn't wait for decent fonts, graphics, and
> colour support on something other than plotters, like displays and printers, and
> then for files.
> Options are good, to allow users to choose where and what is affected, and how.
>
> Sorry, been messing around with colours, fonts, graphics, and SGR sequences so
> much, that I can't remember what led to what. You need the reset sequences also.
> Set GROFF_NO_SGR=1 to pass old bold/italic overstrikes thru for less to
> colourize - looks like if GROFF_NO_SGR just exists it works:
>
> 	$ LESS_TERMCAP_md=$(tput bold)$(tput setaf 4) \
> 	LESS_TERMCAP_me=$(tput sgr0) \
> 	LESS_TERMCAP_us=$(tput sitm)$(tput setaf 4) \
> 	LESS_TERMCAP_ue=$(tput ritm)$(tput sgr0) \
> 	GROFF_NO_SGR= man man
>
> bold is also bright blue, underline is shown as italic in blue: the attached now
> sets these up in the env.
>
> Other uses of SGR sequences are in e.g.:
> 	$ GREP_COLORS='mt=0;33;44;1;7:ln=34' grep -bnHi color ~/.bash*
> which on mt matches resets SGR, then sets fg colour yellow, background blue,
> enables bold, then reverses those colours, to display bold blue on bright
> yellow, line numbers in green, defaulting file names to magenta, and byte counts
> in blue; also e.g.:
> 	$ \
> GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'\
> 	gcc -g -Og -Wall -Wextra -c mintty_config.c
>
> as I run black fg text in white bg windows, and bright yellow fg warnings are
> invisible; just like blue fg messages in black bg windows, most combos of
> magenta and red, and many of cyan and green: those similar hues should be
> unmappable pairs in any colour palette!

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

* Re: [ITP] italic-man
  2019-08-10  9:07         ` Thomas Wolff
  2019-08-10 21:39           ` Thomas Wolff
@ 2019-08-10 22:29           ` Brian Inglis
  2019-08-11  9:33             ` Thomas Wolff
  1 sibling, 1 reply; 18+ messages in thread
From: Brian Inglis @ 2019-08-10 22:29 UTC (permalink / raw)
  To: cygwin-apps

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

On 2019-08-10 03:07, Thomas Wolff wrote:
> Am 09.08.2019 um 22:51 schrieb Brian Inglis:
>> On 2019-08-09 13:31, Thomas Wolff wrote:
>>> Am 09.08.2019 um 20:56 schrieb Achim Gratz:
>>>> Jon Turney writes:
>>>>> This gets a GTG from me.
>>>>> I believe that according to our stated procedures additional approvals
>>>>> are required, because this package is unique to cygwin.
>>>> I'm not sure I remember correctly from when the discussion went on the
>>>> first time, but wasn't there some mumbling about this partly going into
>>>> groff?  If that's still the case, remind me what this would entail and
>>>> I'll look into it.
>>> There are multiple ways of activating the feature (also described in the man
>>> page).
>>> The previous strategy placed a shell script wrapper "groff" aside groff, so the
>>> groff script and groff.exe would coexist in /bin. This was tricky to install and
>>> particularly it reportedly did not survive a package update of groff.
>>> The new approach does not use this wrapper anymore. Instead it redirects nroff
>>> to the package-supplied iroff script by configuration in /etc/man_db.conf.

How are updates to man-db, /etc/man_db.conf etc. handled?
Is a permanent postinstall script provided to maintain the conf on man-db updates?

>> There's also use of the undocumented LESS_TERMCAP_... with GROFF_NO_SGR env vars
>> (see attached - must be sourced from profile or rc) to remap bold, underline,
>> etc. into italic and/or colour, or whatever else you want to change, in all less
>> output.
> So (without my package) LESS_TERMCAP_us=$(tput sitm) man ls
> should have the same effect? Cannot reproduce. And what does GROFF_NO_SGR do?

Those settings affect all *less* output, not just *man*.
Some people can't stand any colours (white on black was good enough for my
grandfather...) the same as I couldn't wait for decent fonts, graphics, and
colour support on something other than plotters, like displays and printers, and
then for files.
Options are good, to allow users to choose where and what is affected, and how.

Sorry, been messing around with colours, fonts, graphics, and SGR sequences so
much, that I can't remember what led to what. You need the reset sequences also.
Set GROFF_NO_SGR=1 to pass old bold/italic overstrikes thru for less to
colourize - looks like if GROFF_NO_SGR just exists it works:

	$ LESS_TERMCAP_md=$(tput bold)$(tput setaf 4) \
	LESS_TERMCAP_me=$(tput sgr0) \
	LESS_TERMCAP_us=$(tput sitm)$(tput setaf 4) \
	LESS_TERMCAP_ue=$(tput ritm)$(tput sgr0) \
	GROFF_NO_SGR= man man

bold is also bright blue, underline is shown as italic in blue: the attached now
sets these up in the env.

Other uses of SGR sequences are in e.g.:
	$ GREP_COLORS='mt=0;33;44;1;7:ln=34' grep -bnHi color ~/.bash*
which on mt matches resets SGR, then sets fg colour yellow, background blue,
enables bold, then reverses those colours, to display bold blue on bright
yellow, line numbers in green, defaulting file names to magenta, and byte counts
in blue; also e.g.:
	$ \
GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'\
	gcc -g -Og -Wall -Wextra -c mintty_config.c

as I run black fg text in white bg windows, and bright yellow fg warnings are
invisible; just like blue fg messages in black bg windows, most combos of
magenta and red, and many of cyan and green: those similar hues should be
unmappable pairs in any colour palette!

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

[-- Attachment #2: .LESS_TERMCAP --]
[-- Type: text/plain, Size: 2171 bytes --]

#|/bin/sh
# .LESS_TERMCAP - set termcap properties  for man and other less paging
# What things in a manpage use which capabilities?
# man and less use:
# bold for headings, command synopses, and code font
# underline for proper names (for example, “termcap” and “terminfo” in the
# termcap manpage), variable names (“name”, “bp”, “id”, etc.), and type names
# in some manpages (such as dispatch_queue_create(3))
# standout for the prompt at the bottom
# It doesn’t seem like anything uses blinking.
#				termcap	terminfo  
#LESS_TERMCAP_ks=$(tput smkx)	# ks	smkx	make the keypad send commands
#LESS_TERMCAP_ke=$(tput rmkx)	# ke	rmkx	make the keypad send digits
#LESS_TERMCAP_vb=$(tput flash)	# vb	flash	emit visual bell
#LESS_TERMCAP_mb=$(tput blink)	# mb	blink	start blink
#LESS_TERMCAP_md=$(tput bold)	# md	bold	start bold
LESS_TERMCAP_md=$(tput bold)$(tput setaf 4)	# md	bold	set mode bold	4 set colour blue
#LESS_TERMCAP_mh=$(tput dim)	# mh	dim	mode half-bright
#LESS_TERMCAP_mr=$(tput rev)	# mr	rev	mode reverse video
LESS_TERMCAP_me=$(tput sgr0)	# me	sgr0	reset attributes
#LESS_TERMCAP_so=$(tput smso)	# so	smso	start standout (reverse video)
#LESS_TERMCAP_se=$(tput rmso)	# se	rmso	stop standout
#LESS_TERMCAP_us=$(tput smul)	# us	smul	start underline
LESS_TERMCAP_us=$(tput sitm)$(tput setaf 4)	# us	smul	start underline	set italic mode blue
#LESS_TERMCAP_ue=$(tput rmul)	# ue	rmul	stop underline
LESS_TERMCAP_ue=$(tput ritm)$(tput sgr0)	# ue	rmul	stop underline
#LESS_TERMCAP_ZN=$(tput ssubm)	# ZN	ssubm	set subscript mode
#LESS_TERMCAP_ZV=$(tput rsubm)	# ZV	rsubm	reset subscript mode
#LESS_TERMCAP_ZO=$(tput ssupm)	# ZO	ssupm	set superscript mode
#LESS_TERMCAP_ZW=$(tput rsupm)	# ZW	rsupm	reset superscript mode
#LESS_TERMCAP_ZH=$(tput sitm)	# ZH	sitm	set italic mode
#LESS_TERMCAP_ZR=$(tput ritm)	# ZR	ritm	reset italic mode
GROFF_NO_SGR=1			# for terminals
export					\
	LESS_TERMCAP_us LESS_TERMCAP_ue	\
	LESS_TERMCAP_md LESS_TERMCAP_me	\
	GROFF_NO_SGR
#	LESS_TERMCAP_mb LESS_TERMCAP_md	\
#	LESS_TERMCAP_mr LESS_TERMCAP_mh	\
#	LESS_TERMCAP_so LESS_TERMCAP_se	\
#	LESS_TERMCAP_ZN LESS_TERMCAP_ZV	\
#	LESS_TERMCAP_ZO LESS_TERMCAP_ZW	\

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

* Re: [ITP] italic-man
  2019-08-10  9:07         ` Thomas Wolff
@ 2019-08-10 21:39           ` Thomas Wolff
  2019-08-10 22:29           ` Brian Inglis
  1 sibling, 0 replies; 18+ messages in thread
From: Thomas Wolff @ 2019-08-10 21:39 UTC (permalink / raw)
  To: cygwin-apps

Am 10.08.2019 um 11:07 schrieb Thomas Wolff:
> Am 09.08.2019 um 22:51 schrieb Brian Inglis:
>> On 2019-08-09 13:31, Thomas Wolff wrote:
>>> Am 09.08.2019 um 20:56 schrieb Achim Gratz:
>>>> Jon Turney writes:
>>>>> This gets a GTG from me.
>>>>> I believe that according to our stated procedures additional 
>>>>> approvals
>>>>> are required, because this package is unique to cygwin.
>>>> I'm not sure I remember correctly from when the discussion went on the
>>>> first time, but wasn't there some mumbling about this partly going 
>>>> into
>>>> groff?  If that's still the case, remind me what this would entail and
>>>> I'll look into it.
>>> There are multiple ways of activating the feature (also described in 
>>> the man page).
>>> The previous strategy placed a shell script wrapper "groff" aside 
>>> groff, so the
>>> groff script and groff.exe would coexist in /bin. This was tricky to 
>>> install and
>>> particularly it reportedly did not survive a package update of groff.
>>> The new approach does not use this wrapper anymore. Instead it 
>>> redirects nroff
>>> to the package-supplied iroff script by configuration in 
>>> /etc/man_db.conf.
>> There's also use of the undocumented LESS_TERMCAP_... with 
>> GROFF_NO_SGR env vars
>> (see attached - must be sourced from profile or rc) to remap bold, 
>> underline,
>> etc. into italic and/or colour, or whatever else you want to change, 
>> in all less
>> output.
> So (without my package) LESS_TERMCAP_us=$(tput sitm) man ls
> should have the same effect? Cannot reproduce. And what does 
> GROFF_NO_SGR do?
Ah, this works:
GROFF_NO_SGR= LESS_TERMCAP_us="^[[3m" LESS_TERMCAP_ue="^[[23m" man ls
no matter what the value of GROFF_NO_SGR is. Which tool in the `man` 
chain interprets the latter?

Value-added of my package:
* automatic injection into the `man` pipe
* terminal-dependent enabling, after checking the terminal type

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

* Re: [ITP] italic-man
  2019-08-09 20:51       ` Brian Inglis
@ 2019-08-10  9:07         ` Thomas Wolff
  2019-08-10 21:39           ` Thomas Wolff
  2019-08-10 22:29           ` Brian Inglis
  0 siblings, 2 replies; 18+ messages in thread
From: Thomas Wolff @ 2019-08-10  9:07 UTC (permalink / raw)
  To: cygwin-apps

Am 09.08.2019 um 22:51 schrieb Brian Inglis:
> On 2019-08-09 13:31, Thomas Wolff wrote:
>> Am 09.08.2019 um 20:56 schrieb Achim Gratz:
>>> Jon Turney writes:
>>>> This gets a GTG from me.
>>>> I believe that according to our stated procedures additional approvals
>>>> are required, because this package is unique to cygwin.
>>> I'm not sure I remember correctly from when the discussion went on the
>>> first time, but wasn't there some mumbling about this partly going into
>>> groff?  If that's still the case, remind me what this would entail and
>>> I'll look into it.
>> There are multiple ways of activating the feature (also described in the man page).
>> The previous strategy placed a shell script wrapper "groff" aside groff, so the
>> groff script and groff.exe would coexist in /bin. This was tricky to install and
>> particularly it reportedly did not survive a package update of groff.
>> The new approach does not use this wrapper anymore. Instead it redirects nroff
>> to the package-supplied iroff script by configuration in /etc/man_db.conf.
> There's also use of the undocumented LESS_TERMCAP_... with GROFF_NO_SGR env vars
> (see attached - must be sourced from profile or rc) to remap bold, underline,
> etc. into italic and/or colour, or whatever else you want to change, in all less
> output.
So (without my package) LESS_TERMCAP_us=$(tput sitm) man ls
should have the same effect? Cannot reproduce. And what does 
GROFF_NO_SGR do?

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

* Re: [ITP] italic-man
  2019-08-09 19:31     ` Thomas Wolff
@ 2019-08-09 20:51       ` Brian Inglis
  2019-08-10  9:07         ` Thomas Wolff
  0 siblings, 1 reply; 18+ messages in thread
From: Brian Inglis @ 2019-08-09 20:51 UTC (permalink / raw)
  To: cygwin-apps

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

On 2019-08-09 13:31, Thomas Wolff wrote:
> Am 09.08.2019 um 20:56 schrieb Achim Gratz:
>> Jon Turney writes:
>>> This gets a GTG from me.
>>> I believe that according to our stated procedures additional approvals
>>> are required, because this package is unique to cygwin.
>> I'm not sure I remember correctly from when the discussion went on the
>> first time, but wasn't there some mumbling about this partly going into
>> groff?  If that's still the case, remind me what this would entail and
>> I'll look into it.
> There are multiple ways of activating the feature (also described in the man page).
> The previous strategy placed a shell script wrapper "groff" aside groff, so the
> groff script and groff.exe would coexist in /bin. This was tricky to install and
> particularly it reportedly did not survive a package update of groff.
> The new approach does not use this wrapper anymore. Instead it redirects nroff
> to the package-supplied iroff script by configuration in /etc/man_db.conf.

There's also use of the undocumented LESS_TERMCAP_... with GROFF_NO_SGR env vars
(see attached - must be sourced from profile or rc) to remap bold, underline,
etc. into italic and/or colour, or whatever else you want to change, in all less
output.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

[-- Attachment #2: .LESS_TERMCAP --]
[-- Type: text/plain, Size: 2157 bytes --]

#|/bin/sh
# .LESS_TERMCAP - set termcap properties  for man and other less paging
# What things in a manpage use which capabilities?
# man and less use:
# bold for headings, command synopses, and code font
# underline for proper names (for example, “termcap” and “terminfo” in the
# termcap manpage), variable names (“name”, “bp”, “id”, etc.), and type names
# in some manpages (such as dispatch_queue_create(3))
# standout for the prompt at the bottom
# It doesn’t seem like anything uses blinking.
#				termcap	terminfo  
#LESS_TERMCAP_ks=$(tput smkx)	# ks	smkx	make the keypad send commands
#LESS_TERMCAP_ke=$(tput rmkx)	# ke	rmkx	make the keypad send digits
#LESS_TERMCAP_vb=$(tput flash)	# vb	flash	emit visual bell
#LESS_TERMCAP_mb=$(tput blink)	# mb	blink	start blink
#LESS_TERMCAP_md=$(tput bold)	# md	bold	start bold
LESS_TERMCAP_md=$(tput bold)$(tput setaf 4)	# md	bold	set mode bold	4 set colour blue
#LESS_TERMCAP_mh=$(tput dim)	# mh	dim	mode half-bright
#LESS_TERMCAP_mr=$(tput rev)	# mr	rev	mode reverse video
#LESS_TERMCAP_me=$(tput sgr0)	# me	sgr0	reset attributes
#LESS_TERMCAP_so=$(tput smso)	# so	smso	start standout (reverse video)
#LESS_TERMCAP_se=$(tput rmso)	# se	rmso	stop standout
#LESS_TERMCAP_us=$(tput smul)	# us	smul	start underline
LESS_TERMCAP_us=$(tput sitm)$(tput setaf 6)	# us	smul	start underline
#LESS_TERMCAP_ue=$(tput rmul)	# ue	rmul	stop underline
LESS_TERMCAP_ue=$(tput ritm)$(tput sgr0)	# ue	rmul	stop underline
#LESS_TERMCAP_ZN=$(tput ssubm)	# ZN	ssubm	set subscript mode
#LESS_TERMCAP_ZV=$(tput rsubm)	# ZV	rsubm	reset subscript mode
#LESS_TERMCAP_ZO=$(tput ssupm)	# ZO	ssupm	set superscript mode
#LESS_TERMCAP_ZW=$(tput rsupm)	# ZW	rsupm	reset superscript mode
#LESS_TERMCAP_ZH=$(tput sitm)	# ZH	sitm	set italic mode
#LESS_TERMCAP_ZR=$(tput ritm)	# ZR	ritm	reset italic mode
#GROFF_NO_SGR=1			# for terminals
export					\
	LESS_TERMCAP_us LESS_TERMCAP_ue	\
	LESS_TERMCAP_md
#	LESS_TERMCAP_mb LESS_TERMCAP_md	\
#	LESS_TERMCAP_mr LESS_TERMCAP_mh	\
#	LESS_TERMCAP_me			\
#	LESS_TERMCAP_so LESS_TERMCAP_se	\
#	LESS_TERMCAP_ZN LESS_TERMCAP_ZV	\
#	LESS_TERMCAP_ZO LESS_TERMCAP_ZW	\
#	GROFF_NO_SGR

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

* Re: [ITP] italic-man
  2019-08-09 18:56   ` Achim Gratz
@ 2019-08-09 19:31     ` Thomas Wolff
  2019-08-09 20:51       ` Brian Inglis
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Wolff @ 2019-08-09 19:31 UTC (permalink / raw)
  To: cygwin-apps

Am 09.08.2019 um 20:56 schrieb Achim Gratz:
> Jon Turney writes:
>> This gets a GTG from me.
>>
>> I believe that according to our stated procedures additional approvals
>> are required, because this package is unique to cygwin.
> I'm not sure I remember correctly from when the discussion went on the
> first time, but wasn't there some mumbling about this partly going into
> groff?  If that's still the case, remind me what this would entail and
> I'll look into it.
There are multiple ways of activating the feature (also described in the 
man page).
The previous strategy placed a shell script wrapper "groff" aside groff, 
so the groff script and groff.exe would coexist in /bin. This was tricky 
to install and particularly it reportedly did not survive a package 
update of groff.
The new approach does not use this wrapper anymore. Instead it redirects 
nroff to the package-supplied iroff script by configuration in 
/etc/man_db.conf.
Thomas

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

* Re: [ITP] italic-man
  2019-08-09 12:59 ` Jon Turney
  2019-08-09 15:07   ` Ken Brown
@ 2019-08-09 18:56   ` Achim Gratz
  2019-08-09 19:31     ` Thomas Wolff
  1 sibling, 1 reply; 18+ messages in thread
From: Achim Gratz @ 2019-08-09 18:56 UTC (permalink / raw)
  To: cygwin-apps

Jon Turney writes:
> This gets a GTG from me.
>
> I believe that according to our stated procedures additional approvals
> are required, because this package is unique to cygwin.

I'm not sure I remember correctly from when the discussion went on the
first time, but wasn't there some mumbling about this partly going into
groff?  If that's still the case, remind me what this would entail and
I'll look into it.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves

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

* Re: [ITP] italic-man
  2019-08-09 12:59 ` Jon Turney
@ 2019-08-09 15:07   ` Ken Brown
  2019-08-09 18:56   ` Achim Gratz
  1 sibling, 0 replies; 18+ messages in thread
From: Ken Brown @ 2019-08-09 15:07 UTC (permalink / raw)
  To: cygwin-apps

On 8/9/2019 8:59 AM, Jon Turney wrote:
> On 28/07/2019 07:01, Thomas Wolff wrote:
>> I'm again proposing a package to enable italic display of manual pages (as 
>> originally intended).
>> I changed the deployment strategy, following comments in my previous attempt
>> (https://cygwin.com/ml/cygwin-apps/2017-04/msg00116.html).
>> A cygport file is included as suggested by Jon Turney but I haven't tested it 
>> as the Makefile works just fine without.
>> wget http://towo.net/cygwin/italic-man/italic-man-1.0-1-src.tar.xz
>> wget http://towo.net/cygwin/italic-man/italic-man-1.0-1.tar.xz
>> wget http://towo.net/cygwin/italic-man/setup.hint
>>
> 
> Thanks for taking another look at this.
> 
> This gets a GTG from me.
> 
> I believe that according to our stated procedures additional approvals are 
> required, because this package is unique to cygwin.

+1

Ken

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

* Re: [ITP] italic-man
  2019-07-28  6:01 Thomas Wolff
@ 2019-08-09 12:59 ` Jon Turney
  2019-08-09 15:07   ` Ken Brown
  2019-08-09 18:56   ` Achim Gratz
  0 siblings, 2 replies; 18+ messages in thread
From: Jon Turney @ 2019-08-09 12:59 UTC (permalink / raw)
  To: cygwin-apps; +Cc: Thomas Wolff

On 28/07/2019 07:01, Thomas Wolff wrote:
> I'm again proposing a package to enable italic display of manual pages 
> (as originally intended).
> I changed the deployment strategy, following comments in my previous 
> attempt
> (https://cygwin.com/ml/cygwin-apps/2017-04/msg00116.html).
> A cygport file is included as suggested by Jon Turney but I haven't 
> tested it as the Makefile works just fine without.
> wget http://towo.net/cygwin/italic-man/italic-man-1.0-1-src.tar.xz
> wget http://towo.net/cygwin/italic-man/italic-man-1.0-1.tar.xz
> wget http://towo.net/cygwin/italic-man/setup.hint
> 

Thanks for taking another look at this.

This gets a GTG from me.

I believe that according to our stated procedures additional approvals 
are required, because this package is unique to cygwin.

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

* [ITP] italic-man
@ 2019-07-28  6:01 Thomas Wolff
  2019-08-09 12:59 ` Jon Turney
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Wolff @ 2019-07-28  6:01 UTC (permalink / raw)
  To: cygwin-apps

I'm again proposing a package to enable italic display of manual pages 
(as originally intended).
I changed the deployment strategy, following comments in my previous attempt
(https://cygwin.com/ml/cygwin-apps/2017-04/msg00116.html).
A cygport file is included as suggested by Jon Turney but I haven't 
tested it as the Makefile works just fine without.
wget http://towo.net/cygwin/italic-man/italic-man-1.0-1-src.tar.xz
wget http://towo.net/cygwin/italic-man/italic-man-1.0-1.tar.xz
wget http://towo.net/cygwin/italic-man/setup.hint

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

end of thread, other threads:[~2023-06-25 16:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-21 17:04 [ITP] italic-man Thomas Wolff
2023-02-16 18:59 ` Jon Turney
2023-02-16 19:17   ` Thomas Wolff
2023-06-21 21:45     ` Thomas Wolff
2023-06-25 13:36       ` Jon Turney
2023-06-25 13:59         ` Thomas Wolff
2023-06-25 16:02           ` ASSI
  -- strict thread matches above, loose matches on Subject: below --
2019-07-28  6:01 Thomas Wolff
2019-08-09 12:59 ` Jon Turney
2019-08-09 15:07   ` Ken Brown
2019-08-09 18:56   ` Achim Gratz
2019-08-09 19:31     ` Thomas Wolff
2019-08-09 20:51       ` Brian Inglis
2019-08-10  9:07         ` Thomas Wolff
2019-08-10 21:39           ` Thomas Wolff
2019-08-10 22:29           ` Brian Inglis
2019-08-11  9:33             ` Thomas Wolff
2019-08-11 16:17               ` Achim Gratz

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