From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: Non-patch: zle argument handling
Date: Mon, 21 Jun 1999 09:35:10 +0200 [thread overview]
Message-ID: <9906210735.AA31767@ibmth.df.unipi.it> (raw)
In-Reply-To: ""Bart Schaefer""'s message of "Sun, 20 Jun 1999 16:44:02 DFT." <990620164402.ZM14631@candle.brasslantern.com>
"Bart Schaefer" wrote:
> } 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?
Actually, it doesn't seem to at the moment. I haven't been keeping track
of this, so I don't know if it's changed, but
testwidget() { zle transpose-words; LBUFFER="${LBUFFER}Ha."; }
both beeps and inserts "Ha." when there's only one word on the line.
On the other hand, with an `&&' between the two it now works as expected
--- this is certainly new and is now the favo[u]red mechanism for returning
early.
> } 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.
No, var(num) is still used. The difference is that it now works with zle.
The version below is simplified.
--- /temp/pws/zsh-3.1.5/Doc/Zsh/builtins.yo.a2 Mon Jun 21 09:16:32 1999
+++ /temp/pws/zsh-3.1.5/Doc/Zsh/builtins.yo Mon Jun 21 09:28:19 1999
@@ -682,15 +682,13 @@
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.
+This option may also be used within zle widgets.
)
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. 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.
+is present. This option may also be used within zle widgets.
)
item(tt(-z))(
Read one entry from the editor buffer stack and assign it to the first
--- /temp/pws/zsh-3.1.5/Doc/Zsh/zle.yo.a2 Mon Jun 21 09:20:35 1999
+++ /temp/pws/zsh-3.1.5/Doc/Zsh/zle.yo Mon Jun 21 09:21:04 1999
@@ -103,8 +103,7 @@
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
+input. Finally, they can examine and edit the ZLE buffer being edited by
reading and setting the special parameters described below.
cindex(parameters, editor)
--
Peter Stephenson <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
next prev parent reply other threads:[~1999-06-21 8:04 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
1999-06-21 7:35 ` Peter Stephenson [this message]
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=9906210735.AA31767@ibmth.df.unipi.it \
--to=pws@ibmth.df.unipi.it \
--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).