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

Re: PATCH: Implement zle -P



On Aug 31,  6:11pm, Peter Stephenson wrote:
} Subject: Re: PATCH: Implement zle -P
}
} On Mon, 31 Aug 2015 09:54:02 +0200
} Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
} > This lets you say
} > % zle -P mywidget prototypewidget myfunction
} > and it will work like zle -N mywidget myfunction except it will behave
} > like prototypewidget in Various Ways0x2122.
} 
} It's not entirely clear what this does without documentation, but as the
} flags are a bit obcsure anyway, it might not be all that clear how to
} document it, either.

I presume this is exactly like "zle -C name widget function" except that
"widget" doesn't have to be a completion widget and "function" defaults
to being the same as "name".

Presumably the idea is for wrapper widgets, e.g., something like this:

    zle -P bracketed-paste-magic bracketed-paste

which would then make b-p-magic behave exactly like b-p, and thereby,
e.g., eliminate the need for this stuff at the end of the former:

    # Arrange to display highlighting if necessary
    if [[ -n ${(M)zle_highlight:#paste:*} ]]; then
        zle -R
        zle .read-command && zle -U - $KEYS
    fi

If that's NOT what it accomplishes, then I'm uncertain why it's needed
at all.



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