zsh-workers
 help / color / mirror / code / Atom feed
* Making run-help smart?
@ 2018-12-28 11:19 Sebastian Gniazdowski
  2018-12-29  4:50 ` dana
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Gniazdowski @ 2018-12-28 11:19 UTC (permalink / raw)
  To: Zsh hackers list

I wonder if run-help could be made smart by mimicking what this function does:

zman () {
    PAGER="less -g -s '+/^       "$1"'" command man zshall
}

Basically, almost always a **term** that is being documented is placed
with 7-spaces gap from beginning of the line. Try this:

zman declare

to see how it works. It's very often directly successful, sometimes it
just limits the number of search results from e.g. 47 to 3 (like for
`zman typeset'), which is still very useful. It also allows to search
for *flags*, when the letter is appended with a few (4 or more)
spaces, like so:
zman "a    "

So, `run-help declare' would be directing the user to declare's
description in manual. Would this be useful?

The `run-help typeset' would point to 3 places, but I think that an
additional logic in run-help could point the user directly to the 3rd
item, the `typeset' manual entry.

The `run-help a' would automatically append 4-5 spaces after the flag
(because it would detect that a single-letter is being queried) and
this way find direct flag entries in the manual.
-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

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

* Re: Making run-help smart?
  2018-12-28 11:19 Making run-help smart? Sebastian Gniazdowski
@ 2018-12-29  4:50 ` dana
  0 siblings, 0 replies; 2+ messages in thread
From: dana @ 2018-12-29  4:50 UTC (permalink / raw)
  To: Sebastian Gniazdowski; +Cc: Zsh hackers list

On 28 Dec 2018, at 05:19, Sebastian Gniazdowski <sgniazdowski@gmail.com> wrote:
>So, `run-help declare' would be directing the user to declare's
>description in manual. Would this be useful?

That's already what it does, for the standard built-ins, if you have the help
files generated. You probably don't have them if you're using zsh from
Homebrew, or if you built from source without the documentation stuff, but the
zsh that ships with macOS and the one in the Debian/Ubuntu repos at least come
with them.

idk about your actual question. It seems problematic to force a specific pager
and pager options on the user, if nothing else

dana


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

end of thread, other threads:[~2018-12-29  4:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-28 11:19 Making run-help smart? Sebastian Gniazdowski
2018-12-29  4:50 ` dana

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).