zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Zefram <zefram@tao.co.uk>
Cc: zsh-workers@math.gatech.edu
Subject: Re: User-defined zle widgets and built-in widget failure
Date: Tue, 9 Jun 1998 12:12:03 -0700	[thread overview]
Message-ID: <980609121203.ZM6732@candle.brasslantern.com> (raw)
In-Reply-To: <199806091801.TAA04656@taos.demon.co.uk>

On Jun 9,  7:01pm, Zefram wrote:
} Subject: Re: User-defined zle widgets and built-in widget failure
}
} The mechanism I planned is that each thingy will include a single-bit
} flag, which can be tested and modified using the zle builtin.  Then all
} you do to test for error is "if zle -F feep; ...", where the value of
} "F" has yet to be determined.

I think we should tie the most common cases to standard scripting concepts;
e.g., failure should be a nonzero $?, and the numeric value of $? should
indicate the reason for failure.  It shouldn't be necessary to invoke "zle"
multiple times to find out this kind of basic information; further, it
makes it obvious how a widget writer sets the value, i.e., with "return".

} Or a more general possibility would be thingy array variables
} accessible via thingy names

Just how many thingys are we talking about here?

I suggest defining one array variable $ZLE (or whatever name you want),
and define the meanings of the array positions.  E.g., ZLE could be
equivlent to ($BUFFER $CURSOR $LBUFFER $RBUFFER) in the current scheme;
instead of BUFFER="the text here" you'd say ZLE[1]="the text here".
(I don't think you should literally do that, because the buffer chunks
are best accessed directly as scalars, but for purposes of example ...)

} (though I'd want to do a proper namespace separation, e.g., ${zle.feep}).

You're creeping dangerously close to Perl associative arrays, there.
Unless we're talking about a huge amount of data, just use numbered
positions in an array with a "sufficiently unique" name.

} That reminds me, more generally I'd like to move the zsh-specific
} parameter names to completely separate names that can't conflict
} with POSIX parameter names.  If we have ${zsh.module_path} instead of
} $module_path, then this can be available regardless of the name used to
} invoke zsh.  What do people think?

I think I'd rather not have to rewrite my .z* scripts again.  How much
"moving" are we talking about?

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


  reply	other threads:[~1998-06-09 19:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-09 17:09 Bart Schaefer
1998-06-09 18:01 ` Zefram
1998-06-09 19:12   ` Bart Schaefer [this message]
1998-06-09 20:02     ` Zefram
1998-06-10  6:26       ` Variable namespaces, goals for ZLE, etc Bart Schaefer
1998-06-10 10:55         ` Zefram
1998-06-10 17:37           ` Bart Schaefer
1998-06-10 18:01             ` Zefram
1998-06-10 18:36               ` Bart Schaefer
1998-06-10 10:24       ` Associative arrays, structured namespaces Bruce Stephens
1998-06-10 10:44         ` Zefram
1998-06-10 12:07           ` Bruce Stephens
1998-06-10 12:28             ` Bruce Stephens

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=980609121203.ZM6732@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zefram@tao.co.uk \
    --cc=zsh-workers@math.gatech.edu \
    /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).