zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Making run-help smart?
Date: Fri, 28 Dec 2018 12:19:26 +0100	[thread overview]
Message-ID: <CAKc7PVDkw1_q29S-m05ScoER_gu=oBfVHoh=ZCJVOpyk9zPURQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2018-12-28 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-28 11:19 Sebastian Gniazdowski [this message]
2018-12-29  4:50 ` dana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKc7PVDkw1_q29S-m05ScoER_gu=oBfVHoh=ZCJVOpyk9zPURQ@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).