From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 497cd9be for ; Fri, 28 Dec 2018 11:20:03 +0000 (UTC) Received: (qmail 13282 invoked by alias); 28 Dec 2018 11:19:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43948 Received: (qmail 2689 invoked by uid 1010); 28 Dec 2018 11:19:45 -0000 X-Qmail-Scanner-Diagnostics: from mail-oi1-f170.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.167.170):SA:0(-2.0/5.0):. Processed in 4.47335 secs); 28 Dec 2018 11:19:45 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xPLynb1PC6RXMuRs6O1M6HuLQugpH4HUQ0mkZ13S9UU=; b=M3rDQFG0p1stvKk9Bsqesruz10xjezNBZdflz2PqkcqQUCiBsg5E+r65ZU3aHSKWPy iWI73xVQmYAUxjBO05peb7MnF0/9czaLuwMMOSCFqCaF3MK6zUNxI6+QoAs+tc+Ftq5x uBJk21JrHwsP/aO8Ls0PvxRz6wpAgs2xaBwth204uBukYeswP/1fpY7KFIWRuedgSN1J lxmB8dpjrY45zgoKm+VGl21RbG7h4kYNp1tyDILkUjUDIuqwNrdg4rfn2ephDBNlsUyn xQ/uwIq+aAPu5S/S3oijLzWNY5+dzE6JPaFtHxv3bS7rTMx/zW3bMI7Xg9FaMbk1bVEQ jjeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xPLynb1PC6RXMuRs6O1M6HuLQugpH4HUQ0mkZ13S9UU=; b=rg6GWWFmI3O0exHnynIAPU61Sh4lJi3ue22DaZHP7ST69QaOQ4UCrBaQ6nOKSD++BS BixAArJPPMxT92kJJ68tSI79zWiazXmS9kOCWW+lGk74VAWPFptgt0jY2LkNtc8i9MoS gtmb7sLN4HIfV/ZEIZPNps9OIWvAzAFN0B4zkjZcht8zyJ2aaFSZTRn+9rpKxJoOPJOl W19uleKpJnWxuUobCC4T0IS/mJ+O3FlL0xJ51ukCEXHZE8r/d191VTJjDqJhQPbWwdQy PgQRpKNShgnyrPt7of+B8tn4zzWO3NvXLP/Ppeq7bMg4pOFoxO/hmLdDVxny5aghBJWv RJvg== X-Gm-Message-State: AA+aEWaR1hnjNIYHI5doqigLHJkLHbPWSaubUaHfL57g45dtpU+wVm8+ DucO9qZFsXpbmto3xQXuEApyhUskAaNB6ekikPQudCt4UVU= X-Google-Smtp-Source: AFSGD/Vb2lfx1MLp+j8lZBIeWgLto9d+6PuKt8Qw0iRk0PPSXlMWWyiwFWBcqSfZT0CjsGi9SI/RMOZMCz56k89Rs80= X-Received: by 2002:aca:195:: with SMTP id 143mr16464290oib.322.1545995977373; Fri, 28 Dec 2018 03:19:37 -0800 (PST) MIME-Version: 1.0 From: Sebastian Gniazdowski Date: Fri, 28 Dec 2018 12:19:26 +0100 Message-ID: Subject: Making run-help smart? To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" 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