jed-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: isearch "wrap around" enhancements


G. Milde <g.milde@xxxxxx> wrote:
> static define get_bound_key (search_func, default)
> {
>    variable n, key;
>    if (n = which_key (search_func), n)
>      {
> 	key = (); n--;
> 	if (strlen (key) == 2)
> 	  {
> 	     if (key [0] == '^')
> 	       return (key [1] - '@');
> 	  }
>+ 	_pop_n(n);
>      }
>    return default;
> }

Your point is well-taken and I rewrote the function as:

static define get_bound_key (search_func, default)
{
   foreach ([which_key (search_func), pop()])
     {
	variable key = ();
	if (strlen (key) == 2)
	  {
	     if (key [0] == '^')
	       return (key [1] - '@');
	  }
     }
   return default;
}

Thanks,
--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]