zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Michele Venturi <dardo82@gmail.com>,
	Peter Stephenson <p.w.stephenson@ntlworld.com>,
	zsh-workers@zsh.org
Subject: Re: How to fix run-help-* functions?
Date: Mon, 13 Mar 2023 13:31:34 -0700	[thread overview]
Message-ID: <CAH+w=7YL4_q5YHxC5GmuqaP1nNhUpmP7BKsxu==B-TpLB9zciA@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3R4T82A_SYQfqhmd+h8EN6QwCmPmTjMUSZZ4x-LkEzcMw@mail.gmail.com>

On Mon, Mar 13, 2023 at 11:19 AM Mikael Magnusson <mikachu@gmail.com> wrote:
>
> On 3/13/23, Bart Schaefer <schaefer@brasslantern.com> wrote:
> > Question for the audience is whether we want to consider this a bug
> > and make it possible to use run-help as a standalone function.
>
> It could/should at least output some diagnostic, because it is very
> easy for an end-user (or very confused developer) to do this:
> % git<invoke run-help>
> % git<now press page up and enter which changes this line to:>
> % run-help git
> git is /usr/bin/git
> run-help:shift:106: shift count must be <= $#

A reasonable point.

> Looking at the code for processcmd it seems to literally only insert
> the string "run-help git" on the command line, so what exactly is this
> preliminary setup? I can't find it.

It does a push-line so that the run-help function can retrieve it with
getln.  See workers/49218

If there's no line pushed, the run-help function is going to push a
blank one (with print -z) immediately after getln fails, so there's
several things that need to (not) happen if the widget is not used.


  reply	other threads:[~2023-03-13 20:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 14:30 Michele Venturi
2023-03-07 17:13 ` Philippe Troin
2023-03-13 11:09   ` Michele Venturi
2023-03-07 17:22 ` Bart Schaefer
2023-03-07 17:31   ` Peter Stephenson
2023-03-07 17:40     ` Bart Schaefer
2023-03-07 18:34       ` Michele Venturi
2023-03-08  0:03         ` Bart Schaefer
2023-03-13 11:14       ` Michele Venturi
2023-03-13 16:06         ` Bart Schaefer
2023-03-13 18:19           ` Mikael Magnusson
2023-03-13 20:31             ` Bart Schaefer [this message]
2023-03-13 20:41               ` Bart Schaefer
2023-03-20 14:37                 ` Michele Venturi
2023-03-21  1:05                   ` Bart Schaefer

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='CAH+w=7YL4_q5YHxC5GmuqaP1nNhUpmP7BKsxu==B-TpLB9zciA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=dardo82@gmail.com \
    --cc=mikachu@gmail.com \
    --cc=p.w.stephenson@ntlworld.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).