zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: Non-patch: zle argument handling
Date: Sun, 20 Jun 1999 16:44:02 +0000	[thread overview]
Message-ID: <990620164402.ZM14631@candle.brasslantern.com> (raw)
In-Reply-To: <9906201431.AA13678@ibmth.df.unipi.it>

On Jun 20,  4:31pm, Peter Stephenson wrote:
} Subject: Non-patch: zle argument handling
}
} Here is what I think I've done:

Sounds good to me.

} Another possible suggestion: We could remove all the feep()'s from the code
} and feep() if and only if the widget returned 1.

I like this idea.

} For user-defined widgets, we could have a special function to allow
} them to feep and a special option to zle that will suppress the feep
} for any other widget, so that simple zle -N's work without extra error
} handling.

I presume that in this scheme an un-suppressed feep() would abort the
widget, as I believe currently happens?

} (By the way, what does feep mean?)

It means "failure beep."  (Actually, it probably just means "beep", but
I think some curses packages already have a beep() function so PF had to
pick a different name.)

} --- Doc/Zsh/builtins.yo.argdoc	Thu Jun 17 16:53:03 1999
} +++ Doc/Zsh/builtins.yo	Sun Jun 20 16:09:55 1999
} @@ -682,12 +682,15 @@
}  With this flag set the return value is zero only if the character was
}  `tt(y)' or `tt(Y)'.  Note that this always reads from the terminal, even
}  if used with the tt(-p) or tt(-u) or tt(-z) flags or with redirected input.
} +May be called from a zle widget, in which case it will use zle to retrieve
} +a key.
}  )

How about:

   With this flag set the return value is zero only if the character was
   `tt(y)' or `tt(Y)'.  Note that this always reads from the terminal, even
   if used with the tt(-p) or tt(-u) or tt(-z) flags or with redirected input.
  +When called from a zle widget, zle is used to read from the terminal.

However, I don't see what possible difference this makes, as only one key
is read in any case, and it's still going to be interpreted as either `y'
for `yes' or anything else for `no'.

}  item(tt(-k) [ var(num) ])(
}  Read only one (or var(num)) characters.  All are assigned to the first
}  var(name), without word splitting.  This flag is ignored when tt(-q) is
}  present.  Input is read from the terminal unless one of tt(-u) or tt(-p)
} -is present.
} +is present.  May be called from a zle widget with no tt(-u)
} +or tt(-p) argument, in which case it will use zle to retrieve a key.
}  )

Does this imply when called from that var(num) is ignored and exactly one
key is read regardless?  That seems broken to me.  If that's not what it
means, then what difference does it make that zle is involved?  Things
should only get documented if they are visible behavior changes; and then
what you need to document is the behavior, not the implementation.

} +++ Doc/Zsh/zle.yo	Sun Jun 20 16:27:38 1999
} @@ -102,6 +102,8 @@
}  User-defined widgets, being implemented as shell functions,
}  can execute any normal shell command.  They can also run other widgets
}  (whether built-in or user-defined) using the tt(zle) builtin command.
} +They can use tt(read -k) or tt(read -q) to read characters from standard
} +input, which will use the appropriate tt(zle) key input mechanism.
}  Finally, they can examine and edit the ZLE buffer being edited by
}  reading and setting the special parameters described below.

Again, what does it *mean* to "use the appropriate key input mechanism"?

Otherwise this stuff all looks great.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1999-06-20 16:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-20 14:31 Peter Stephenson
1999-06-20 16:44 ` Bart Schaefer [this message]
1999-06-21  7:35   ` Peter Stephenson
1999-06-21  8:09 Sven Wischnowsky
1999-06-21  8:19 ` Andrej Borsenkow
1999-06-21  8:25 Sven Wischnowsky
1999-06-21  8:33 ` Andrej Borsenkow

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=990620164402.ZM14631@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).