RFC + sanity check, Tk::Text with Vi interface



I've been pulling together a module that acts as a replacement for
Tk::Text but handles keyboard input similar to Vi (originally to stop
me from sticking "dd" all over my config files, but it seems like one
of those things silly enough that others might get some use out of
it). This is the first time I've tried something like this, so I'd
appreciate any suggestions or corrections. Is Tk::TextVi a reasonable
name? Does my interface have any serious flaws? Am I missing and
features that have to be there? etc.

A few excerpts from the POD is below or the full archive can be found
here: http://omega0.xepher.net/stuff/Tk-TextVi-0.01.tar.gz

use Tk::TextVi;
$textvi = $window->TextVi( -option => value, ... );

Tk::TextVi is a Tk::Text widget that replaces InsertKeypress() to
handle user input similar to vi. All other methods remain the same
(and most code should be using $text->insert( ... ) rather than $text-
InsertKeypress()). This only implements the text widget and key
press logic; the status bar must be drawn by the application (see
TextViDemo.pl for an example of this).

Functions in Vi that require interaction with the system (such as
reading or writing files) are not (currently) handled by this module
(This is a feature since you probably don't want :quit to do exactly
that).

OPTIONS

-statuscommand

Callback invoked when the mode or the keys in the pending command
change. The current mode and pending keys will be passed to this
function.

-messagecommand

Callback invoked when messages need to be displayed.

-systemcommand

Callback invoked when the parent application needs to take action. If
you return 'undef' the widget will pretend that command doesn't exist
and do nothing. Currently, the argument can be:

'quit' The :quit command has been entered

SUPPORTED COMMANDS
Normal: a d f ga gg h i j k l m n o p q r t v x y D G O V 0 @ ` $ % /
Command: :quit :nohlsearch :split :map

.



Relevant Pages

  • Re: RFC + sanity check, Tk::Text with Vi interface
    ... Tk::Text but handles keyboard input similar to Vi (originally to stop ... me from sticking "dd" all over my config files, ... (This is a feature since you probably don't want:quit to do exactly ... Callback invoked when the mode or the keys in the pending command ...
    (comp.lang.perl.modules)
  • Re: commenting out blocks of code
    ... Exit) in every GUI API I know of. ... Ctrl+Q is not reserved for Quit on every platform. ... never used Windows where Exit does not normally have a distinct command key of its own but can be performed with Alt+F4 for single window applications. ...
    (comp.lang.python)
  • Re: Retrieve an array using non-subscript data
    ... The way to stop the loop is with a quit command (which you see later ... retrieve the nodes on a global (or array). ...
    (comp.lang.mumps)
  • Re: [SLE] TVTIME 1.0.1
    ... one you cannot figure out how to exit!). ... Then use this command to find the process ID of the ... modified buffer and without asking if you want to do that. ... simple:q command will quit only if the buffer is not modified. ...
    (SuSE)
  • Re: A Batch File query
    ... The bad news is, Choice isn't included in the XP commands. ... There's an excellent DOS group at microsoft.public.msdos-batch, ... @ECHO Do you want to delete these files or quit? ... 'CHOICE' is not recognised as an internal or external command, ...
    (microsoft.public.windowsxp.customize)