xe -- X windows editor implemented as a tcl/tk script
contents
[usage]
[buttons]
[operations]
[widgets]
[functions]
xe [file]
Edits the file if given, a temp file in $HOME/tmp if no file is given.
Attempts to execute $HOME/xerc as a wish script if it exists.
The simple button operations are
- quit -- quits the editor
NOTE: it does NOT currently check for unsaved edits.
This has not been a problem for me, so beware if you use this editor.
- write -- write the current content of the text buffer to the file.
- commit -- checkpoint for one-level explicit undo
- revert -- revert text to last commit
- tcl -- execute the current X selection as a tcl script
The rest of the buttons pop up new operations, with arguments. In each
case, the new operation has a mini-button-panel, with a"del" button (to
remove it when no longer needed), and any operations the panel controls.
Each mini-panel has a text entry next to it, which is used as an
argument to the operation.
Buttons that pop up persistent customized operations are
- tclop -- runs the argument as a tcl script
- mark -- creates a "bookmark" tclop, to page back to a marked location
- search -- creates a search operation, with "next" and "prev" button;
next positions the next line that contains the regular
expression argument to the top of the screen, and prev
positions the previous such line. An argument with a
leading -i is taken as case-insensitive.
- filter -- runs a unix pipeline over the current X selection,
then inserts the pipeline at the insert cursor.
Used for spell checking, sorting, indenting,
parenthesis balancing, MIME encapsulation/decoding,
uuencode/decode,
and many more; these suboperations
are then simply packaged as ordinary unix scripts.
The widgets are simply arranged, with a button panel frame .panel,
with the buttons named by their lables, an .ops frame which contains
the operations mini-button-panels, and .scroll and .text wigets
for the text being edited.
The widget names can thus be used in .xerc to select custom fonts,
colors, initial operations based on filename extension (ie, edit modes),
and so on. There are also some helper functions to simplify some of
the chores most often done in .xerc or tclop text.
- s -- returns the current x selection
- t -- returns the whole .text content via .text get; if arguments
are given, they are used as the "get" parameters
- set-fn -- used to change the filename to write to during an edit
session, eg, if an edit session started on a temporary
or nameless file is to be saved.
- set-file -- abandon the current edit, and switch to the named file
(note differences from set-fn)
- xd -- pop up a read-only editor on the results of tcl-eval-in $args
- newop -- used to create new operations to
customize the notional "edit mode", eg
newop tcl {xd s}
newop filter {spell}
newop search {-i rumplestiltskin}
- search -- use the search functions in a tclop, rc file, or binding; eg
search next {^end$}
set endidx [.text index insert+1line]
search prev {^begin$}
would make the lines between "begin" and "end" the current X selection.
Note also these global variables
- title -- icon and title bar text, normally "xe filename"
- fn -- filename currently being edited, regardless of title bar
- opnum -- number of the current operation panel; eg, in .xerc
newop tcl {somecontent}; .ops.$opnum.text configure -height 5
Would give an extra-large argument text area to a tcl op.
- commit -- text last commited with the commit button
(or the original text of the file as loaded).`
Last edited Mon Jun 3 13:47:31 1996 - Last generated Mon Jun 3 13:47:32 1996