zsh-workers
 help / color / mirror / code / Atom feed
* Re: WORDCHARS, etc.
@ 1999-06-15  6:57 Sven Wischnowsky
  0 siblings, 0 replies; 8+ messages in thread
From: Sven Wischnowsky @ 1999-06-15  6:57 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> > - The read builtin uses `getkey()' when called from a zle widget and
> >   when reading from stdin.
> 
> is that when (called from a zle widget && reading from stdin)? in which
> case that's a good idea.

Yes.

> > - Finally, my suggestion for enhancing aliases. I've used a different
> >   option character for this and because I couldn't think of a good
> >   one, I've just taken `X':
> > 
> >     zle -X new-name old-name numeric args...
> 
> I'm not sure we need both this and zle -A.  And having this the other way
> round from zls -A is just creating more confusion, even if the -A choice
> was non-optimal (though it is in the UNIX tradition of things like mv and
> ln; if -L hadn't been used it would have been more obvious).
> 
> There was some opposition to enhancing aliases anyway, since you can
> always define a function widget.  One reason why I like them is it raises
> the possibility of having builtin widgets implemented as aliases at shell
> startup, which is a non-starter if you need a function.

This is almost the only reason why I would want such (more powerful)
aliases: to have a way to define them built in. If we ever decide to
change widgets to accept arguments and to make some of the builtin
widgets aliases to them at all, we can of course easily hide this
completely from the users. They will still only be able to use `-A'
but internally we use aliases with arguments and document it as `foo
behaves like bar with arguments...' or something like that.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: WORDCHARS, etc.
  1999-06-14  9:19 Sven Wischnowsky
@ 1999-06-14 14:42 ` Peter Stephenson
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Stephenson @ 1999-06-14 14:42 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky wrote:
> I've prepared a patch for this argument-passing thing, too. I haven't
> tried, but I'm sure this will clash with Peter's patch. So I'll just
> explain what it does and append it below if some of you want to try
> it. Those parts that are considered good things can then be merged
> with Peter's.

I'd better leave both of these out of pws-22 and we can decide later.  No
doubt Bart will have impartial views.

> - The zle functions (the C-functions) have been changed to get an
>   `char **args' argument and to return an integer. The return value is 
>   currently only used to signal some kind of error condition. Of
>   course, it is also returned when invokiing widgets via `zle'.

This is more far-reaching than mine.

> - I've taken {vi-,}history-search-{for,back}ward as examples that use
>   the arguments -- they all accept one string which is then searched.

I just made it put the string given in the buffer, but your idea is
probably more useful, since mine doesn't lend itself to subsequent
programming.

> - The read builtin uses `getkey()' when called from a zle widget and
>   when reading from stdin.

is that when (called from a zle widget && reading from stdin)? in which
case that's a good idea.

> - Another option for `zle': -R makes the command line be re-displayed.
>   It gets an optional argument: a string to display in the status
>   line.

This is useful

> - Finally, my suggestion for enhancing aliases. I've used a different
>   option character for this and because I couldn't think of a good
>   one, I've just taken `X':
> 
>     zle -X new-name old-name numeric args...

I'm not sure we need both this and zle -A.  And having this the other way
round from zls -A is just creating more confusion, even if the -A choice
was non-optimal (though it is in the UNIX tradition of things like mv and
ln; if -L hadn't been used it would have been more obvious).

There was some opposition to enhancing aliases anyway, since you can
always define a function widget.  One reason why I like them is it raises
the possibility of having builtin widgets implemented as aliases at shell
startup, which is a non-starter if you need a function.

-- 
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: WORDCHARS, etc.
@ 1999-06-14 13:12 Sven Wischnowsky
  0 siblings, 0 replies; 8+ messages in thread
From: Sven Wischnowsky @ 1999-06-14 13:12 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> One problem remains with the $NUMERIC mechanism:  there's no way of
> differentiating between the case where the prefix was given as 1 and where
> no prefix was given.  This is already noticeable in the completion code for
> specifying numbers of correction.  Possibilities are either a separate
> parameter, which is clumsy, or altering NUMERIC in some way:  I would
> prefer that it is still numerically 1 in either case to avoid confusing
> functions, but maybe it could be '+1' if the prefix wasn't set.  That would
> mean making it a string instead of an integer parameter.

I wouldn't like it to be such a string because we can't easily get at
the default value then. How about leaving it unset if no numeric
argument is given? To be able to say ${NUMERIC:-1}.
(I had this idea some time ago but then forgot to ask...)


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: WORDCHARS, etc.
@ 1999-06-14  9:19 Sven Wischnowsky
  1999-06-14 14:42 ` Peter Stephenson
  0 siblings, 1 reply; 8+ messages in thread
From: Sven Wischnowsky @ 1999-06-14  9:19 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> OK, here's an attempt at passing arguments to widgets.  I've used
> Wayne's suggestions (incompatible with what was previously implemented),

Oh, damn. I was too slow.

I've prepared a patch for this argument-passing thing, too. I haven't
tried, but I'm sure this will clash with Peter's patch. So I'll just
explain what it does and append it below if some of you want to try
it. Those parts that are considered good things can then be merged
with Peter's.
All this was only considered as an example anyway.

- The zle functions (the C-functions) have been changed to get an
  `char **args' argument and to return an integer. The return value is 
  currently only used to signal some kind of error condition. Of
  course, it is also returned when invokiing widgets via `zle'.
- I've taken {vi-,}history-search-{for,back}ward as examples that use
  the arguments -- they all accept one string which is then searched.
- The read builtin uses `getkey()' when called from a zle widget and
  when reading from stdin.
- Another option for `zle': -R makes the command line be re-displayed.
  It gets an optional argument: a string to display in the status
  line.
- Finally, my suggestion for enhancing aliases. I've used a different
  option character for this and because I couldn't think of a good
  one, I've just taken `X':

    zle -X new-name old-name numeric args...

  Without `numeric' and `args', this is like `-A' only with the
  arguments the other way round (I'm always confused by the order of
  the arguments to `-A'). If they are given, `numeric' gives the value 
  to set the numeric argument to -- if this is the empty string, the
  numeric argument is not changed. Well, and the `args' give the
  strings that are passed to the widget functions. All of these
  arguments are expanded (using singsub()) with the special widget
  parameters in place.


Putting everything together, one could do:

  zle -X search-foo vi-history-search-backward '' foo

to search the last foo (not that useful, I admit)

  zle -X correct _complete_expand-or-complete '' _approximate

a bit more intersting...

  zle -N isearch isearch

  isearch() {
    local key
  
    zle down-history
    zle vi-history-search-backward '' "$searchstr" || zle up-history
    zle -R "find: ${searchstr}_"
    read -k key
    while [[ '#key' -ne 10 ]]; do
      if [[ '#key' -eq 8 || '#key' -eq 127 ]]; then
        searchstr="$searchstr[1,-2]"
        while zle vi-history-search-forward '' "$searchstr"; do ; done
      else
        searchstr="$searchstr$key"
        zle down-history
        zle vi-history-search-backward '' "$searchstr" || zle up-history
      fi
      zle -R "find: ${searchstr}_"
      read -k key
    done
  }

which isn't really good, but shows some of the features...


Currently I like to think about changing the zle code to offer a
(relatively) small and clean set of generic functions that get options 
and arguments (even with a builtin option-parsing mechanism in the
same way as we do it already for builtins). For example, we could have 
a widget `complete' that accepts some options which say if
menucompletion should be used, expansion, listing, and so on. It would 
also accept optional arguments. Without arguments it uses the builtin
completion code and with arguments it takes the first one as the name
of a shell function which is then invoked the way we invoke completion 
widgets. And voila, we could get rid of the (notion of) completion
widgets. The builtin completion widgets we have now would then be
builtin aliases for `complete' with the appropriate options.

Of course, that would be quite a bit of work: find out which functions 
should be offered, with which options and arguments, changing all the
zle functions, adding support for builtin aliases, etc. But I think
shell function widgets would be much more interesting then.


Bye
 Sven

begin 600 patch-zle.gz
M'XL("/B_9#<"`W!A=&-H+7IL90#L/?USVS:R/]-_!>+.)&1$I:*^;,5U6S=V
M6E_]D4F<:]_E^CPT!5D<4Z1"4G:<-O_[VUT`)/@ER8[3WMV[S%@2`7"QV%TL
M=A<+9.Q/)JR]8.V81<G7_PCXUV,>I)$W=>-G'GL3>^6RC7:[7=/4.(Y"]K=%
MR)P^<SK/>\[S?H\YH]%HH]5JU<$IO]!]WAF*%[[_GK5[/7N;M>CS^^\W6)*Z
MJ>^Q7_SQ)4_9S3G`X2D7H'8VV`;[^NG3KS?:LMEUY(\WVEE?)CY;&RU9ZX?I
M1BNOQ`_V]*D;7R;6!OM]@^$_:,,\MLN@MRM^:W8LFXUYDD*)E]@LNH(?'9N%
M\/5QM@A21`&Q'H[L(6O!YQ9AC?\^28`39CZ*KJ`'8\+YW+1V-EI8'O-T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O&\RY(MDMIP6
MZ>!T7M3D)4'E?O<[%(ZET>LCY@I+$4*U9D23^5.+NR#T:J(_>.C&/MEA8*93
M@C5<W$K9IE'<]\GQJ<!E&EKMR*X$L$:/7G\-:W1:MZ$)@7I+6*)X(C?M]FT$
M'>5ZR@(`%::-*4.)>A+?(I0%'.RCW$@F_WL,&Z57`/L0.&J<*(YRH</AKU*!
MP[\\VIN1K;TIEBNJ;M"*EVQY59Q7["`2+Y\25'H3ODR3^?(RAJ_`A2:71'#$
M*Q`[,.$;368MY*(Z#!H*"!^%U(/%\1.KK3U1(U(/WM=PB.L<DOBSZ`P=2[XZ
M^O*';_[$\DV:7]"T17;"$S2_34.<-=,/[!W!\&)C&8=X)*SMS]A%Y<>C]]\<
MG;SY[OAOQR=:911IMY,&C[EJDO+("V00FI!E-85.N5Q<L)=@^_!/_P=;`TJG
$YR\!`/AO
`
end

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: WORDCHARS, etc.
  1999-06-13 11:17     ` Bart Schaefer
@ 1999-06-14  7:15       ` Peter Stephenson
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Stephenson @ 1999-06-14  7:15 UTC (permalink / raw)
  To: Zsh hackers list

(I sent this yesterday, but it's still stuck in the mail queue.  The other
version may appear any moment between now and Christmas.)

OK, here's an attempt at passing arguments to widgets.  I've used
Wayne's suggestions (incompatible with what was previously implemented),

} If we're going to start allowing arbitrary arguments to be specified
} then we need some kind of option syntax so we can set either or both
} args for a function.  How about adding the -n# option to set an actual
} value, and the -N option to set the number as unspecified (i.e. "use
} the default").
}
} Alternately, current commands like isearch can be tweaked to look for
} a string arg and only read the keyboard if no string input was
} specified.

To make it transparent between builtin and function widgets, the latter get
passed all the remaining arguments to the zle command as positional
parameters (though there's nothing to stop you calling the function
directly which should have virtually the same effect inside another widget
function), while builtin commands have to look at a new global variable
zleargs.

Only two functions currently use zleargs; we can take suggestions for any
other possibilities, such as the word stuff.

The incremental search commands get a bindkey-like string, i.e. it can have
control characters in it.  This is safe in that any remaining characters
after the isearch finishes are junked, e.g. `zle
history-incremental-search-backwards "foo\nbar\n"' looks back for foo and
accepts the first line it finds, but the "bar\n" has no effect.  Control
returns to the keyboard immediately, i.e. you can edit the buffer if you
didn't stick a control character at the end.  If you want, I could make it
so that the string was always interpreted as literal characters (this would
take some hackery).  Currently, you can't repeat with the same key; I'm not
sure if this is a bug or not but maybe it can be changed.

Also, universal-argument can take a string which will be used to give a
value to the numeric argument.  This is the same as NUMERIC=<num>.

"Bart Schaefer" wrote:
> Which reminds me to again repeat my bug report from 4099:
> 
> zagzig<1> fnord() { zle digit-argument ; BUFFER="$BUFFER $NUMERIC" }
> zagzig<2> zle -N fnord   
> zagzig<3> bindkey '^X^F' fnord
> zagzig<4>  1 6 66 666 6666 66666 666666 6666666 66666666 666666666 -192326792
> 6
> 
> (the last line comes from repeatedly hitting ^X^F).

This was because digit-argument took ^F as the digit typed.  I've made it
feep if the digit isn't between '0' and '9'.  Code like

digarg() { zle digit-argument; }
zle -N digarg
bindkey '^X0' digarg

remains valid.

One problem remains with the $NUMERIC mechanism:  there's no way of
differentiating between the case where the prefix was given as 1 and where
no prefix was given.  This is already noticeable in the completion code for
specifying numbers of correction.  Possibilities are either a separate
parameter, which is clumsy, or altering NUMERIC in some way:  I would
prefer that it is still numerically 1 in either case to avoid confusing
functions, but maybe it could be '+1' if the prefix wasn't set.  That would
mean making it a string instead of an integer parameter.  I haven't done
anything about this yet.

By the way, somebody deleted or caused never to have existed the
documentation for getkeystring(), which I had to work out.

--- Doc/Zsh/mod_zle.yo.zargs	Mon Feb 15 12:11:29 1999
+++ Doc/Zsh/mod_zle.yo	Sun Jun 13 16:19:47 1999
@@ -166,7 +166,7 @@
 xitem(tt(zle) tt(-A) var(old-widget) var(new-widget))
 xitem(tt(zle) tt(-N) var(widget) [ var(function) ])
 xitem(tt(zle) tt(-C) var(widget) var(completion-widget) var(function))
-item(tt(zle) var(widget))(
+item(tt(zle) var(widget) tt([ -n) var(num) tt(]) tt([ -N ]) var(args) ...)(
 The tt(zle) builtin performs a number of different actions concerning
 ZLE.  Which operation it performs depends on its options:
 
@@ -203,9 +203,20 @@
 ifnzman(noderef(Completion Widgets))\
 .
 )
-item(var(widget))(
+item(var(widget) tt([ -n) var(num) tt(]) tt([ -N ]) var(args) ...)(
 Invoke the specified widget.  This can only be done when ZLE is
 active; normally this will be within a user-defined widget.
+
+With the options tt(-n) and tt(-N), the current numerical argument will be
+saved and then restored after the call to tt(widget); `tt(-n) var(num)'
+sets the numerical argument temporarily to var(num), while `tt(-N)' sets it
+to the default, i.e. as if there were none.
+
+Any further arguments will be passed to the widget.  If it is a shell
+function, these are passed down as postional parameters; for builtin
+widgets it is up to the widget in question what it does with them.
+Currently arguments are only handled by the incremental-search commands and
+by tt(universal-argument). 
 )
 enditem()
 )
--- Doc/Zsh/zle.yo.zargs	Sat Jun 12 14:14:05 1999
+++ Doc/Zsh/zle.yo	Sun Jun 13 16:39:22 1999
@@ -414,6 +414,17 @@
 is not bound to one of the above functions, or tt(self-insert) or
 tt(self-insert-unmeta), will have the same effect but the function will be
 executed.
+
+When called from a widget function by the tt(zle) command, the incremental
+search commands can take a string argument.  This will be treated a string
+of keys, as for arguments to the tt(bindkey) command, and used as initial
+input for the command.  Any characters in the string which are unused by
+the incremental search will be silently ignored.  For example,
+
+example(zle history-incremental-search-backward forceps)
+
+will search backwards for tt(forceps), leaving the minibuffer containing
+the string `tt(forceps)'.
 )
 tindex(history-incremental-search-forward)
 item(tt(history-incremental-search-forward) (^S ^Xs) (unbound) (unbound))(
@@ -800,7 +811,11 @@
 tindex(digit-argument)
 item(tt(digit-argument) (ESC-0..ESC-9) (1-9) (unbound))(
 Start a new numeric argument, or add to the current one.
-See also tt(vi-digit-or-beginning-of-line).
+See also tt(vi-digit-or-beginning-of-line).  This only works if bound to a
+key sequence ending in a decimal digit.
+
+Inside a widget function, a call to this function treats the last key of
+the key sequence which called the widget as the digit.
 )
 tindex(neg-argument)
 item(tt(neg-argument) (ESC--) (unbound) (unbound))(
@@ -815,6 +830,10 @@
 twice, followed immediately by tt(forward-char), move forward sixteen
 spaces; if instead it is followed by tt(-2), then tt(forward-char),
 move backward two spaces.
+
+Inside a widget function, if passed an argument, i.e. `tt(zle
+universal-argument) var(num)', the numerical argument will be set to
+var(num); this is equivalent to `tt(NUMERIC=)var(num)'.
 )
 enditem()
 texinode(Completion)(Miscellaneous)(Arguments)(Zsh Line Editor)
--- Src/Zle/zle_hist.c.zargs	Wed Jun  2 09:14:53 1999
+++ Src/Zle/zle_hist.c	Sun Jun 13 16:04:03 1999
@@ -648,7 +648,7 @@
     int sbptr = 0, top_spot = 0, pos, sibuf = 80;
     int nomatch = 0, skip_line = 0, skip_pos = 0;
     int odir = dir, sens = zmult == 1 ? 3 : 1;
-    int hl = histline;
+    int hl = histline, savekeys = -1;
     Thingy cmd;
     char *okeymap = curkeymapname;
     static char *previous_search = NULL;
@@ -657,6 +657,14 @@
 
     clearlist = 1;
 
+    if (*zleargs) {
+	int len;
+	char *arg;
+	savekeys = kungetct;
+	arg = getkeystring(*zleargs, &len, 2, NULL);
+	ungetkeys(arg, len);
+    }
+
     strcpy(ibuf, ISEARCH_PROMPT);
     memcpy(ibuf + NORM_PROMPT_POS, (dir == 1) ? "fwd" : "bck", 3);
     remember_edits();
@@ -863,6 +871,12 @@
     }
     statusline = NULL;
     selectkeymap(okeymap, 1);
+    /*
+     * Don't allow unused characters provided as a string to the
+     * widget to overflow and be used as separated commands.
+     */
+    if (savekeys >= 0 && kungetct > savekeys)
+	kungetct = savekeys;
 }
 
 /**/
--- Src/Zle/zle_main.c.zargs	Mon Jun  7 13:29:36 1999
+++ Src/Zle/zle_main.c	Sun Jun 13 16:02:37 1999
@@ -72,6 +72,11 @@
 /**/
 Widget compwidget;
 
+/* arguments for the current command */
+
+/**/
+char **zleargs;
+
 /* the status line, and its length */
 
 /**/
@@ -111,6 +116,11 @@
 /**/
 int feepflag;
 
+/* Number of characters waiting to be read by the ungetkeys mechanism */
+
+/**/
+int kungetct;
+
 #ifdef FIONREAD
 static int delayzsetterm;
 #endif
@@ -262,7 +272,7 @@
 }
 
 static char *kungetbuf;
-static int kungetct, kungetsz;
+static int kungetsz;
 
 /**/
 void
@@ -540,7 +550,7 @@
 		break;
 	    }
 	    if (bindk) {
-		execzlefunc(bindk);
+		execzlefunc(bindk, NULL);
 		handleprefixes();
 		/* for vi mode, make sure the cursor isn't somewhere illegal */
 		if (invicmdmode() && cs > findbol() &&
@@ -592,11 +602,12 @@
 
 /**/
 void
-execzlefunc(Thingy func)
+execzlefunc(Thingy func, char **argptr)
 {
     int r = 0;
     Widget w;
 
+    DPUTS(useheap, "BUG: heap allocation in execzlefunc");
     if(func->flags & DISABLED) {
 	/* this thingy is not the name of a widget */
 	char *nm = niceztrdup(func->nam);
@@ -607,8 +618,15 @@
 	zsfree(msg);
 	feep();
     } else if((w = func->widget)->flags & (WIDGET_INT|WIDGET_NCOMP)) {
+	/*
+	 * For internal widgets, we pass arguments in the array zleargs.
+	 * These never get modified directly.
+	 */
+	char **oldzleargs = zleargs, *dummyargs[] = { "", NULL};
 	int wflags = w->flags;
 
+	zleargs = argptr ? argptr : dummyargs;
+
 	if(!(wflags & ZLE_KEEPSUFFIX))
 	    removesuffix();
 	if(!(wflags & ZLE_MENUCMP)) {
@@ -627,7 +645,13 @@
 	if (!(wflags & ZLE_NOTCOMMAND))
 	    lastcmd = wflags;
 	r = 1;
+
+	zleargs = oldzleargs;
     } else {
+	/*
+	 * For function widgets, we pass arguments by the usual
+	 * function mechanism.
+	 */
 	List l = getshfunc(w->u.fnnam);
 
 	if(l == &dummy_list) {
@@ -641,11 +665,17 @@
 	    feep();
 	} else {
 	    int osc = sfcontext, osi = movefd(0);
+	    LinkList args;
 
 	    startparamscope();
 	    makezleparams(0);
 	    sfcontext = SFC_WIDGET;
-	    doshfunc(w->u.fnnam, l, NULL, 0, 1);
+	    args = newlinklist();
+	    addlinknode(args, func->nam);
+	    while (*argptr)
+		addlinknode(args, *argptr++);
+	    doshfunc(w->u.fnnam, l, args, 0, 1);
+	    freelinklist(args, (FreeFunc) NULL);
 	    sfcontext = osc;
 	    endparamscope();
 	    lastcmd = 0;
--- Src/Zle/zle_misc.c.zargs	Sun Jun 13 15:28:22 1999
+++ Src/Zle/zle_misc.c	Sun Jun 13 16:46:38 1999
@@ -444,6 +444,11 @@
 {
     int sign = (zmult < 0) ? -1 : 1;
 
+    if (c < '0' || c > '9') {
+	feep();
+	return;
+    }
+
     if (!(zmod.flags & MOD_TMULT))
 	zmod.tmult = 0;
     if (zmod.flags & MOD_NEG) {
@@ -475,6 +480,11 @@
 universalargument(void)
 {
     int digcnt = 0, pref = 0, minus = 1, gotk;
+    if (*zleargs) {
+	zmod.mult = atoi(*zleargs);
+	zmod.flags |= MOD_MULT;
+	return;
+    }
     while ((gotk = getkey(0)) != EOF) {
 	if (gotk == '-' && !digcnt) {
 	    minus = -1;
--- Src/Zle/zle_thingy.c.zargs	Tue May 11 11:20:53 1999
+++ Src/Zle/zle_thingy.c	Sun Jun 13 14:43:01 1999
@@ -357,10 +357,6 @@
 
     /* check number of arguments */
     for(n = 0; args[n]; n++) ;
-    if(!op->o && n != 1 && n != 2) {
-	zerrnam(name, "wrong number of arguments", NULL, 0);
-	return 1;
-    }
     if(n < op->min) {
 	zerrnam(name, "not enough arguments for -%c", NULL, op->o);
 	return 1;
@@ -517,29 +513,61 @@
 {
     Thingy t;
     struct modifier modsave;
+    int saveflag = 0;
 
     if(!zleactive || incompctlfunc || incompfunc) {
 	zerrnam(name, "widgets can only be called when ZLE is active",
 	    NULL, 0);
 	return 1;
     }
-    if (args[1]) {
-	modsave = zmod;
-	if (isdigit(*args[1])) {
-	    zmod.mult = atoi(args[1]);
-	    zmod.flags |= MOD_MULT;
+
+    while (*args && **args == '-') {
+	char *num;
+	if (!args[0][1] || args[0][1] == '-') {
+	    args++;
+	    break;
 	}
-	else {
-	    zmod.mult = 1;
-	    zmod.flags &= ~MOD_MULT;
+	while (*++(*args)) {
+	    switch (**args) {
+	    case 'n':
+		num = args[0][1] ? args[0]+1 : args[1];
+		if (!num) {
+		    zwarnnam(name, "number expected after -%c", NULL, **args);
+		    return 1;
+		}
+		if (!args[0][1])
+		    args++;
+		modsave = zmod;
+		saveflag = 1;
+		zmod.mult = atoi(num);
+		zmod.flags |= MOD_MULT;
+		break;
+	    case 'N':
+		modsave = zmod;
+		saveflag = 1;
+		zmod.mult = 1;
+		zmod.flags &= ~MOD_MULT;
+		break;
+	    default:
+		zwarnnam(name, "unknown option: %s", *args, 0);
+		return 1;
+	    }
 	}
+	args++;
     }
-    t = rthingy(args[0]);
+    if (!args[0]) {
+	zwarnnam(name, "wrong number of arguments", NULL, 0);
+	if (saveflag)
+	    zmod = modsave;
+	return 1;
+    }
+
+    t = rthingy(*args++);
     PERMALLOC {
-      execzlefunc(t);
+      execzlefunc(t, args);
     } LASTALLOC;
     unrefthingy(t);
-    if (args[1])
+    if (saveflag)
 	zmod = modsave;
     return 0;
 }
--- Src/Zle/zle_vi.c.zargs	Wed Mar 17 09:37:43 1999
+++ Src/Zle/zle_vi.c	Sun Jun 13 14:06:57 1999
@@ -175,7 +175,7 @@
 	    /* The command key is repeated: a number of lines is used. */
 	    dovilinerange();
 	else
-	    execzlefunc(k2);
+	    execzlefunc(k2, NULL);
 	if(vichgrepeat)
 	    zmult = mult1;
 	else
--- Src/utils.c.zargs	Thu Jun 10 16:38:50 1999
+++ Src/utils.c	Sun Jun 13 15:15:59 1999
@@ -3080,6 +3080,22 @@
 }
 #endif
 
+/*
+ * Decode a key string, turning it into the literal characters.
+ * The length is returned in len.
+ * fromwhere determines how the processing works.
+ *   0:  Don't handle keystring, just print-like escapes.
+ *       Expects misc to be present.
+ *   1:  Handle Emacs-like \C-X arguments etc., but not ^X
+ *       Expects misc to be present.
+ *   2:  Handle ^X as well as emacs-like keys; don't handle \c
+ *       for no newlines.
+ *   3:  As 1, but don't handle \c.
+ *   4:  Do $'...' quoting.  Overwrites the existing string instead of
+ *       zhalloc'ing 
+ *   5:  As 2, but \- is special.  Expects misc to be defined.
+ */
+
 /**/
 char *
 getkeystring(char *s, int *len, int fromwhere, int *misc)


-- 
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: WORDCHARS, etc.
  1999-06-13  6:53   ` Wayne Davison
@ 1999-06-13 11:17     ` Bart Schaefer
  1999-06-14  7:15       ` Peter Stephenson
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 1999-06-13 11:17 UTC (permalink / raw)
  To: Peter Stephenson, Zsh hackers list, Wayne Davison

On Jun 12,  5:41pm, Peter Stephenson wrote:
} Subject: Re: WORDCHARS, etc.
}
} Sven Wischnowsky wrote:
} > The more I read about this the more I think that we should just go
} > ahead and allow all zle widget functions to get (an arbitrary number
} > of) arguments (strings). If no arguments are given, the function uses
} > its defaults.
} 
} Just thinking about this again.  I've moved the discussion to zsh-workers.
} 
} - How do we decide whether an argument is going to be a digit argument or a
}   string?

I suggest they simply always be strings and let the function parse them
as it wants.  If what's wanted is only to change the numeric argument,
one can always use a little wrapper function that sets NUMERIC.

Which reminds me to again repeat my bug report from 4099:

zagzig<1> fnord() { zle digit-argument ; BUFFER="$BUFFER $NUMERIC" }
zagzig<2> zle -N fnord   
zagzig<3> bindkey '^X^F' fnord
zagzig<4>  1 6 66 666 6666 66666 666666 6666666 66666666 666666666 -1923267926

(the last line comes from repeatedly hitting ^X^F).

Back on the original topic, the string arguments can be passed to user-
defined widget functions as $argv.  Probably there's an analogous way
that built-ins can get at them.

BTW, have you looked at zsh-workers/4098 and 4101 lately?  The advent of
NUMERIC has made bits of 4098 moot, but it shows how to pass arguments
to widget functions.  Works great; I've been merging it into every -pws-N
release for my private use as the code around it changes, so I could give
you an updated patch quite easily.

} - Then we presumably need to add two flags, saying whether the command just
}   expects typed input, like isearches (which will be treated like bindkey
}   -s strings and put into the unget buffer), or whether it actually wants a
}   string argument

Hmm; here you're talking about built-in widgets rather than user-defined
ones, right?  I think we should define a convention used by the built-ins
for parsing the string arguments and simply tell people (in the manual)
that the Right Thing to do is to write their widget functions to follow
the same conventions.

}   If you think it's useful to have more than one
}   argument, then presumably a counter giving the max number of string
}   arguments is more useful than a second flag.

That counter is called $#, obviously ...

}   Where would more than one
}   argument be useful (apart from specifying a numeric as well as a string
}   argument)?

Isn't that tantamount to asking "When is &optional useful in elisp?"

Suppose I want to write a widget that takes three arguments: a command
name to search the history for, a word in the resulting command line
that I want to change, and the new word that I want to change it to.
Are you really going to make me parse all that out of a single string
myself when zsh could easily set $1 $2 $3 for me?

} - The extended alias mechanism, if it's a good idea, would presumably allo
}   `zle -A old-widget new-widget args-to-pass-to-old-widget'.  Then you can
}   create, for example, an ad hoc isearch command with just a zle -A command
}   without needing to define a function.  That would mean adding room for
}   either a char * or a char ** or a LinkList in the thingy struct, though.

I don't think it's necessary to extend the alias mechanism like that.  It
should be sufficient to write:

    zle -A old-widget renamed-old-widget
    new-widget() { zle renamed-old-widget args-to-pass-to-old-widget }
    zle -N old-widget new-widget

On Jun 12, 11:53pm, Wayne Davison wrote:
} Subject: Re: WORDCHARS, etc.
}
} If we're going to start allowing arbitrary arguments to be specified
} then we need some kind of option syntax so we can set either or both
} args for a function.  How about adding the -n# option to set an actual
} value, and the -N option to set the number as unspecified (i.e. "use
} the default").  For instance:
} 
} zle up-line -n 5  # goes up 5 lines, restores numeric arg afterward
} zle up-line       # goes up current-numeric-arg # of lines
} zle up-line -N    # goes up default # of lines, restores numeric arg
} 
} zle vi-fetch-history -N      # goes to last history event
} zle vi-fetch-history -n3847  # goes to history event 3847
} 
} What do you think?

This seems like a fine convention for my suggestion above.  We need more,
of course, like maybe: `-I string' means interpret `string' as if it were
typed input; and so on.

} Alternately, current commands like isearch can be tweaked to look for
} a string arg and only read the keyboard if no string input was
} specified.

That's an equally good (I think even better) idea.

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: WORDCHARS, etc.
  1999-06-12 15:41 ` Peter Stephenson
@ 1999-06-13  6:53   ` Wayne Davison
  1999-06-13 11:17     ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Wayne Davison @ 1999-06-13  6:53 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

On Sat, 12 Jun 1999, Peter Stephenson wrote:
> - How do we decide whether an argument is going to be a digit
>   argument or a string?

If we're going to start allowing arbitrary arguments to be specified
then we need some kind of option syntax so we can set either or both
args for a function.  How about adding the -n# option to set an actual
value, and the -N option to set the number as unspecified (i.e. "use
the default").  For instance:

zle up-line -n 5  # goes up 5 lines, restores numeric arg afterward
zle up-line       # goes up current-numeric-arg # of lines
zle up-line -N    # goes up default # of lines, restores numeric arg

zle vi-fetch-history -N      # goes to last history event
zle vi-fetch-history -n3847  # goes to history event 3847

What do you think?

> (Wayne, how does your patch for `zle widget <num>' work?

Since there is currently no non-numeric-argument support in the zle,
my code just assumed that an optional trailing arg wanted to affect
the numeric arg.  If no arg is specified, it assumes that the command
should use the current value of the numeric arg.  It also assumes that
a non-numeric value will override the current numeric arg into the
arg-wasn't-specified state.

> It seems to assume it should set the digit argument to 1 if <num>
> didn't begin with a digit.  Is that important?

Yes.  Most zle functions default to 1 if no argument is specified,
so the zle code allows functions to be lazy about doing a proper arg
check:  any function that defaults to 1 can simply use the value of
zmult and it will be right.  For those unusual functions that default
to a different value, they first check if an actual arg was present
(if MOD_MULT was set in the flags), and only use zmult if it is a
real value.

> And shouldn't it handle negative numbers?)

Yes, it certainly should -- looks like I missed that.

> - Then we presumably need to add two flags, saying whether the
>   command just expects typed input, like isearches (which will be
>   treated like bindkey -s strings and put into the unget buffer),
>   or whether it actually wants a string argument, like the
>   proposed modifications to the movement commands.

Alternately, current commands like isearch can be tweaked to look for
a string arg and only read the keyboard if no string input was
specified.

>   Where would more than one argument be useful (apart from
>   specifying a numeric as well as a string argument)?

Maybe we should just keep the trailing argument(s) (sans any -n/-N
parsing) as a single string and let the command choose to parse
it as it sees fit (some commands may wish to break up the string
using whitespace, and some may not).

..wayne..


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: WORDCHARS, etc.
       [not found] <199906101042.MAA23616@beta.informatik.hu-berlin.de>
@ 1999-06-12 15:41 ` Peter Stephenson
  1999-06-13  6:53   ` Wayne Davison
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Stephenson @ 1999-06-12 15:41 UTC (permalink / raw)
  To: Zsh hackers list

Sven Wischnowsky wrote:
> The more I read about this the more I think that we should just go
> ahead and allow all zle widget functions to get (an arbitrary number
> of) arguments (strings). If no arguments are given, the function uses
> its defaults. We could than probably have a couple of generic
> functions (e.g. for word movement) and define aliases to them with
> fixed arguments (as Peter suggested with flags), probably even for
> some of the functions that are currently real builtin widgets.

Just thinking about this again.  I've moved the discussion to zsh-workers.

- How do we decide whether an argument is going to be a digit argument or a
  string?  (Wayne, how does your patch for `zle widget <num>' work?  It
  seems to assume it should set the digit argument to 1 if <num> didn't
  begin with a digit.  Is that important?  And shouldn't it handle negative
  numbers?) There's no way of telling whether an arbitrary widget wants a
  digit or a string; should be add a flag for the latter?

- Then we presumably need to add two flags, saying whether the command just
  expects typed input, like isearches (which will be treated like bindkey
  -s strings and put into the unget buffer), or whether it actually wants a
  string argument, like the proposed modifications to the movement
  commands.  If you think it's useful to have more than one
  argument, then presumably a counter giving the max number of string
  arguments is more useful than a second flag.  Where would more than one
  argument be useful (apart from specifying a numeric as well as a string
  argument)?

- The extended alias mechanism, if it's a good idea, would presumably allo
  `zle -A old-widget new-widget args-to-pass-to-old-widget'.  Then you can
  create, for example, an ad hoc isearch command with just a zle -A command
  without needing to define a function.  That would mean adding room for
  either a char * or a char ** or a LinkList in the thingy struct, though.

-- 
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-06-15  6:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-15  6:57 WORDCHARS, etc Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
1999-06-14 13:12 Sven Wischnowsky
1999-06-14  9:19 Sven Wischnowsky
1999-06-14 14:42 ` Peter Stephenson
     [not found] <199906101042.MAA23616@beta.informatik.hu-berlin.de>
1999-06-12 15:41 ` Peter Stephenson
1999-06-13  6:53   ` Wayne Davison
1999-06-13 11:17     ` Bart Schaefer
1999-06-14  7:15       ` Peter Stephenson

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).