[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [groff] Regularize (sub)section cross references.

From: Ingo Schwarze
Subject: Re: [groff] Regularize (sub)section cross references.
Date: Sun, 16 Dec 2018 23:32:45 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

Hi Branden,

G. Branden Robinson wrote on Sun, Dec 16, 2018 at 04:31:01PM -0500:

> Recent discussion revealed that Ingo and I agree that less(1) is pretty
> much part of the man page experience on terminals, so it's a bit bizarre
> that the program doesn't support this as well as it should.
> You have to know ahead of time that you want a case-insensitive search
> and call less with the "-i" flag.
> I've become quite spoiled by Vim's \c flag to the pattern-matcher:
>        */\c* */\C*
> When "\c" appears anywhere in the pattern, the whole pattern is handled like
> 'ignorecase' is on.  The actual value of 'ignorecase' and 'smartcase' is
> ignored.  "\C" does the opposite: Force matching case for the whole pattern.
> {only Vim supports \c and \C}

In OpenBSD vi(1), which is a superset of POSIX vi(1) with a small set
of exceptions, "\c" simply matches the literal character "c" and has
no effect on case sensitivity.  It's also documented that way
in re_format(7).

> If we could get Mark Nudelman to support these escapes in less, it
> would help.

Not really, it looks like an example of sprawling featurism, given
that switching with -i is even less work than typing \c every time.
Besides, it is better to have minimal divergence between standard
REs and less(1) REs.  If every program changes RE syntax in some
idiosyncratic way, that's annoying.  Not even talking about the
dangers of introducing bugs when attempting to pre-parse and modify
REs before handing them to regcomp(3).

> Until and unless that happens, there is man-db man(1)'s MANPAGER option,
> which people could set to "less -i" or ordinary "less" as they prefer.
> mandoc man seems to support this too.  Since Colin Watson and Ingo are
> both here, perhaps they could comment on the wisdom of switching to
> case-insensitive default searches.

I dislike the idea.

I can't see compelling arguments either way, and when something boils
down to personal preference, the status quo is best left untouched.

Even personally, i'm not sure i'd want to switch.  Searching in manual
pages, i often search for syntax elements, and those are almost always
case sensitive.  Searching for English words is possibly rarer.

Either way, it's no big deal; people can readily type "-i" inside
less or set the LESS, PAGER, or MANPAGER environment variables
according to their personal taste.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]