Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Reserved namespaces



On Sun, Mar 12, 2023 at 9:46 AM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Will be creating own namespaces allowed?

Yes ... as of the current patches, namespaces are not significant
except that parameters in namespaces don't show up in "set" /
"typeset" output (unless asked for).  It's an unresolved question
whether to implement the ksh "namespace" keyword and its effects.

This thread is about whether (and potentially which) identifiers we
want to declare as reserved for the shell's own purposes.  To that end
...

On Fri, Mar 10, 2023 at 8:56 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> It occurs to me that the CORRECT options and their behavior do not
> depend on ZLE being active, so it might not be appropriate to put
> keyboard layouts in that namespace.  There are also the parameters
> CORRECT_IGNORE and CORRECT_IGNORE_FILE to consider.  Reserving
> "correct" as a namespace feels odd as well, but I think mostly because
> it can be used as both a verb and an adjective.  Other ideas?

I'm presently thinking about a namespace "interact" to group variables
that apply only (or mostly) to interactive shells.  Then for the
original "Colemak" question we'd have something like:

typeset -gA .interact.keyboards=(
 [QWERTY]=$'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'\
$'\t1234567890-=\t'\
$'\tqwertyuiop[]\t'\
$'\tasdfghjkl;\'\n\t'\
$'\tzxcvbnm,./\t\t\t'\
$'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'\
$'\t!@#$%^&*()_+\t'\
$'\tQWERTYUIOP{}\t'\
$'\tASDFGHJKL:\"\n\t'\
$'\tZXCVBNM<>?\n\n\t'\
$'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'
 [Dvorak]=$'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'\
$'\t1234567890[]\t'\
$'\t\',.pyfgcrl/=\t'\
$'\taoeuidhtns-\n\t'\
$'\t;qjkxbmwvz\t\t\t'\
$'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'\
$'\t!@#$%^&*(){}\t'\
$'\t\"<>PYFGCRL?+\t'\
$'\tAOEUIDHTNS_\n\t'\
$'\t:QJKXBMWVZ\n\n\t'\
$'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'
 [Colemak]=$'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'\
$'\t1234567890-=\t'\
$'\tqwfpgjluy;[]\t'\
$'\tarstdhneio\'\n\t'\
$'\tzxcvbkm,./\t\t\t'\
$'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'\
$'\t!@#$%^&*()_+\t'\
$'\tQWFPGJLUY:{}\t'\
$'\tARSTDHNEIO\"\n\t'\
$'\tZXCVBKM<>?\n\n\t'\
$'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'
)

.interact.layout=${.interact.keyboards[Colemak]}

and change utils.c:spdist() to check getsparam(".interact.layout")
before examining the DVORAK option (for backward compatibility).




Messages sorted by: Reverse Date, Date, Thread, Author