• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

docs/H03-May-2022-277

docsource/H25-Jan-2002-3,1532,553

e93lib/H24-Apr-2005-3,3672,708

xgui/H30-Mar-2019-17,16713,480

CONTRIBH A D25-Jan-200217.2 KiB645591

INSTALLH A D02-Jan-20095.9 KiB175119

MakefileH A D03-May-20221.8 KiB8353

READMEH A D15-Jun-201324.8 KiB679493

README.e93H A D03-Jan-200947.6 KiB1,246986

README.rantsH A D25-Sep-20018 KiB194152

README.regexH A D29-Feb-200015.6 KiB420310

README.syntaxmapsH A D05-Aug-20004.7 KiB12087

TODOH A D07-Sep-20101.1 KiB3421

abort.cH A D03-Jan-20091.5 KiB5924

abort.hH A D03-Jan-200992 54

buffer.cH A D26-Dec-200912.8 KiB463342

buffer.hH A D02-Jan-20091.4 KiB3419

carray.cH A D02-Jan-200914.3 KiB424344

carray.hH A D02-Jan-2009960 194

channels.cH A D04-Nov-20097.9 KiB251174

channels.hH A D29-May-2004888 216

clipbrd.cH A D05-Jan-200913.5 KiB424328

clipbrd.hH A D04-Jan-20091,023 2611

defines.hH A D26-Dec-200917.5 KiB562484

docwin.cH A D02-Jan-20093.5 KiB12387

docwin.hH A D02-Jan-2009837 194

e93.cH A D03-Jan-20092.7 KiB132107

e93.specH A D25-May-2004384 1813

edit.cH A D07-Jan-201083.4 KiB3,3902,935

edit.hH A D26-Dec-20094.8 KiB7958

errors.cH A D04-Jan-20092.2 KiB8245

errors.hH A D03-Jan-2009654 216

globals.cH A D03-Jan-20094 KiB7149

globals.hH A D03-Jan-2009728 3012

guidefs.hH A D27-Dec-20096.9 KiB13898

includes.hH A D03-May-20221.3 KiB5938

keybind.cH A D02-Jan-20096 KiB221169

keybind.hH A D02-Jan-20091.1 KiB259

machdef.mkH A D03-May-20221.8 KiB608

regex.cH A D04-Dec-201487.1 KiB2,8052,484

regex.hH A D03-Jan-20092 KiB2610

search.cH A D26-Nov-201648.3 KiB1,5921,415

search.hH A D03-May-20222.7 KiB238

select.cH A D26-Dec-200919 KiB672504

select.hH A D02-Jan-20092.7 KiB4227

shell.cH A D03-May-202232 KiB1,1291,043

shell.hH A D02-Jan-2009910 238

shellcmd.cH A D26-Dec-2009161.2 KiB6,8626,042

shellcmd.hH A D02-Jan-2009555 161

sparsearray.cH A D24-Aug-201225.4 KiB778562

sparsearray.hH A D02-Jan-20092.2 KiB5134

style.cH A D02-Jan-20097 KiB245169

style.hH A D02-Jan-20091.5 KiB2711

syntax.cH A D03-Jan-200943.5 KiB1,4221,059

syntax.hH A D02-Jan-20093.3 KiB5540

text.cH A D04-Jan-200940.3 KiB1,2501,046

text.hH A D02-Jan-20091.8 KiB2813

tokens.cH A D02-Jan-20091.4 KiB6036

tokens.hH A D02-Jan-200971 21

undo.cH A D04-Jan-200922 KiB637514

undo.hH A D04-Jan-20091.2 KiB2813

varbind.cH A D02-Jan-20096.5 KiB236183

varbind.hH A D02-Jan-20091.1 KiB249

views.cH A D27-Dec-200925.3 KiB854633

views.hH A D02-Jan-20093.2 KiB6045

README

1e93 version 1.4r2 (X Windows version)
2http://www.e93.org
3
4Todd Squires
5Core Technologies
6215 N. Valley Hill Rd.
7Bull Valley, IL 60098
8(squirest@e93.org)
9
10What is e93?
11---- -- ---
12
13e93 is a portable window based text editor oriented to the needs of
14programmers. It was begun in 1993 (thus the name). It uses the mouse,
15selections, cut/copy/paste, and closely follows the model of editors
16on the Macintosh and NeXT platforms.
17
18e93 is portable to environments other than Unix/X Windows -- as long as
19those environments support virtual memory.
20
21e93 supports columnar selection. It achieves this by allowing multiple
22pieces of the text to be selected simultaneously (this is perhaps its
23most unique feature).
24
25e93 imposes no limits on the line length, file length, or number of
26simultaneous files which it can edit.
27
28e93 is able to handle all 8-bit binary codes without complaint, or
29confusion.
30
31e93 is highly configurable without recompiling because scripts which
32control the editor can be written in Tcl.
33
34e93 supports user-configurable syntax highlighting.
35
36
37To Install
38-- -------
39
40Please read "LICENSE.TXT" if you agree with it, follow
41the instructions given in the file "INSTALL."
42
43
44What's the deal with those version numbers?
45------ --- ---- ---- ----- ------- --------
46
47The version numbers in e93 work as follows:
48
49e93 1.4r2X means:
50
51Major version: 1    If it is ever rewritten, this will increment, and the
52                    numbers below will be reset to 0.
53Minor version: 4    If really significant changes are made, this will increment.
54Revision:      2    Any change will cause this will increment.
55Machine:       X    X windows implementation.
56
57
58Additional Information
59---------- -----------
60
61The material README.regex is taken from The GNU Emacs Manual, 9th edition.
62Copyright 1985, 1986, 1987, 1993 Free Software Foundation, Inc.
63and from the GNU regex library version 0.11.
64Copyright 1992 Free Software Foundation, Inc.
65
66
67Mail From e93 Users
68---- ---- --- -----
69
70Mail me useful tips, and I will place them here so that
71other users can benefit from them.
72
73From: Michael Zuelsdorff <micha@dolbyco.han.de>
74Subject: e93 on german linux box
75
76The only problem I ran into was my German keyboard. You
77might know, that we have Umlauts and other special characters
78instead of all those brackets and braces. My solution are
79some additional lines in my e93rc.tcl:
80
81bindkey 7      {00100000000} {InsertAndHome [ActiveWindowOrBeep] "\{"};
82bindkey 8      {00100000000} {InsertAndHome [ActiveWindowOrBeep] "\["};
83bindkey 9      {00100000000} {InsertAndHome [ActiveWindowOrBeep] "\]"};
84bindkey 0      {00100000000} {InsertAndHome [ActiveWindowOrBeep] "\}"};
85bindkey ssharp {00100000000} {InsertAndHome [ActiveWindowOrBeep] "\\"};
86bindkey q      {00100000000} {InsertAndHome [ActiveWindowOrBeep] "\@"};
87bindkey plus   {00100000000} {InsertAndHome [ActiveWindowOrBeep] "\~"};
88bindkey less   {00100000000} {InsertAndHome [ActiveWindowOrBeep] "|"};
89----------------------------------------------------------------
90
91Please send all bug reports to squirest@e93.org. (Todd Squires)
92
93Release of 1.4r3
94------- -- -----
95
96Cleaned up some math that wrapped around when buffers grew larger than
972GB. Scroll bars, etc should now all handle 4GB buffers.
98
99Added the control key as a selection modifier. When holding the
100control key and clicking in the document, it is now possible to easily
101make multiple disjointed selections.
102
103Got rid of cache of top level X window that was associated with each
104editor window. This was used to keep track of windows when the WM
105reparented them, but breaks when the WM is restarted, or a new WM
106is started. Instead, the code now hunts windows the hard way whenever
107it might be dealing with something that was reparented. This is slower,
108but shouldn't break as easily.
109
110Modified clipboard handling to export both XA_PRIMARY, and XA_CLIPBOARD
111to get along with more applications when cut/copy/pasting.
112
113Release of 1.4r2
114------- -- -----
115
116Added XSetClassHint calls to the various windows to help the Gnome
117Window List applet to figure out that all of our windows belong to the
118same class (so it groups them correctly).
119
120Added support for Xinerama (multiple head displays). e93 will now pick
121the 0th display as the "primary" one, and will open windows and menus
122on that display.
123
124Release of 1.4r1
125------- -- -----
126Sun Jan  4 18:25:40 CST 2009
127
128I had some time to play with e93 over the holiday. It had been a while
129since I had done any serious messing with the code.
130
131The new version of the X11 libraries that came with FC10 contain an
132assert if an application calls back into X from within a predicate
133routine. It turns out this is not allowed. The "XCheckIfEvent" man
134page says:
135
136"Your predicate procedure must decide if the event is useful without
137calling any Xlib functions."
138
139e93 had an errant case of this which triggered the assert. The problem
140has been corrected.
141
142All of the C variables called "theWhatever" have been renamed to just
143"whatever". Adding the "the" before variable names was a bad habit
144which I have broken since e93 was written, and I had always meant to
145go back and get rid of them. They're all gone now.
146
147The long-ago-broken-and-never-fixed user abort code has been repaired.
148It is now possible to hit 'escape' while a Tcl script is running, or
149while the editor is busy performing a search, and have the process
150abort. This is trickier than it seems, so if you notice any problems
151with it, be sure to let me know.
152
153Tk was removed from the editor. On some machines, Tk made the editor
154slow to load, and it never was really used very effectively anyway
155(mainly used for the about screen). If this really bothers anyone, let
156me know. It would not be incredibly hard to add back, but I'd probably
157work to make it a build option.
158
159Windows and dialogs have been made to update using an offscreen
160buffer. This reduces flicker as e93's windows are updated. The result
161should look cleaner than before without much of a performance hit.
162This change helps especially with window managers that do live updates
163as windows are resized.
164
165The code which draws the text cursor has changed. Previously, e93
166tried hard to manage the cursor outside of the usual invalidate/update
167mechanism that is used for all other screen updating (it used XORs to
168draw the cursor to the screen). This made sense in the days of old, as
169it was much more efficient. However, on modern machines the code
170complexity of the old method makes no sense given how little it
171matters speed-wise. Now the cursor is drawn just like everything else.
172
173Previously each editor window had its own graphics context. This was
174not necessary. Now there is only a single graphics context that is used
175for all drawing.
176
177Dialogs have been modified so that they can be sized. The editor does
178not yet remember the last size you asked for, not does it yet allow
179you to specify the size when they are opened, but I'll eventually get
180around to making those changes.
181
182Error handling has been improved.
183
184Release of 1.3r5
185------- -- -----
186Mon Dec 22 16:05:31 CST 2008
187
188Ok, I admit it. I had been upgrading my kernel happily without ever
189upgrading my Linux distribution (I have been using Fedora Core 2 for a
190very long time). Anyway, I finally decided it was time to upgrade to
191FC10. The upgrade brought with it a new version 4 gcc compiler, and a
192new version of the Metacity window manager.
193
194Both found reasons to complain about some of the things e93 was doing.
195
196IMHO, only gcc had any right to complain. Metacity wrongly decided to
197start ignoring XRaiseWindow requests... I'm sure the author thinks it
198was a good idea. It wasn't. One day, I would enjoy having a chat with
199him about it.
200
201Also, I've been sitting on a bunch of other little fixes given to me
202by various folks (especially Michael Manning (thanks, and sorry for
203taking so long to get these out)).
204
205So, here it is. No new features have been added. Just compile fixes
206and a few minor tweaks.
207
208
209Release of 1.3r4
210------- -- -----
211
212A bug in shellcmd.c which could cause 2 error messages to be output
213when the "setcolors" command was passed an invalid color was fixed --
214thanks to Michael Manning for pointing this out.
215
216Gordon J Milne added some missing keywords to the C syntax
217highlighting rules.
218
219Makefile was modified to link against libstdc++.
220
221Fixed a bug in Replace where the selection would be corrupted
222after a replace Tcl script failed.
223
224Added a check in xgui/misc.c to check to see if a window has
225children before deleting the child list -- thanks to Fred Allen
226for pointing that out.
227
228Mouse wheel support added -- also thanks to Fred Allen.
229
230Default fonts for all the various editor functions may now be
231specified in the startup scripts. Thanks to Adam Yellen for this
232change.
233
234"extract" Tcl function was added -- Thanks to John Duncan for the
235suggestion.
236
237New syntax maps added courtesy of Michael Manning.
238
239Modified the C Get Prototypes menu item to improve recognition of
240certain kinds of prototypes.
241
242Removed support for paletted displays -- colors are no longer
243allocated and freed. If you are still running in 8 bit color
244mode, you need help.
245
246Renamed a bunch of types to make them easier to read and more
247consistent with my current programming style.
248
249Added some new Tcl commands to the editor for manipulating
250marks in the text. Also added ability to have marks be visible
251in the view.
252
253Removed some outdated Tcl commands, and changed the names of some
254others. e93rc.tcl and other scripts were modified accordingly.
255
256Release of 1.3r3
257------- -- -----
258
259A variable called "not" in regex.c was changed to a new name, since
260"not" is a reserved keyword in 'C', and new compilers have started to
261complain.
262(Thanks to Adam Yellen, and Mark Maxon)
263
264The version of Gnome shipping with RedHat 7.0 did not like the way
265that dialog windows were being set up and was causing an inability
266to click in them. dialogs.c was modified to solve the problem.
267
268The following changes are thanks to Michael Manning:
269    Unnecessary "strings.h" was removed from includes.h.
270    Tcl commands: setmodal and getmodal were removed in favor of a
271      more transparent method of determining when a grab has occurred.
272    Dummy version of ShellCommand added to make errors in the startup
273      script a little less catastrophic.
274    fromfile was removed from the Tcl script GetDefaultStyleInfo
275    The about box was changed so that it no longer calls "uname" making
276      it more portable.
277    Some other problems were corrected in the startup script.
278
279Michael Manning also contributed the docsource directory which
280contains the beginnings of some real documentation for e93.
281
282Adam Yellen supplied some icons (in the e93lib/images directory) which
283can be used for Gnome or KDE.
284
285Adam also supplied the "colorme.tcl" module which can be used to
286dynamically modify the background color of editor windows.
287
288channels.c was changed to account for a change in the Tcl_ChannelType
289data structure. (Thanks to everyone who reported this.)
290
291Release of 1.3r2
292------- -- -----
293
294e93r was modified to allow files to be piped to it on its stdin.
295(Thanks to aweigp@autelca.ascom.ch)
296
297Setlocale is called at startup to allow keyboard input to work in other
298parts of the world. (Thanks to y_kozlov@chat.ru)
299
300
301Release of 1.3r1
302------- -- -----
303
304Fixed a crash bug which happens when replacing using tcl script as the
305replacement text, and the script is using "puts" to write to another buffer.
306
307Fixed a problem with closing stderr in Tcl which was causing e93's
308stderr to be closed as well -- this caused no error messages to be
309generated.
310
311Removed EDITORUNIVERSE concept -- folded it into EDITORBUFFER.
312
313Modified smart-open to take "# include" (with whitespace between
314the # and the include).
315
316Added private color map handling for X windows. If the
317environment variable E93_COLORMAP exists, e93 will use a private
318colormap. Otherwise, it shares the system's default color map.
319
320Many thanks to Peter TEX Weigand <aweigp@autelca.ascom.ch> for the following changes:
321    Modified Makefiles for easier multi-platform configuration
322    Added "install-strip" target to Makefile
323    Added SA_RESTART for Solaris in xgui/events.c
324    Added "Modified" icon for documents
325    Moved start-up scripts to "lib" instead of "bin"
326    Added vertical scroll-bar left/right-hand preference "scrollbarplacement"
327    Added "PrintWindows" command to e93rc
328    Modified e93rc mail command to use "sendmail" instead of "mail"
329    Added "subject" to mail dialog in e93rc
330    Added "MailWindows" menu item to e93rc
331    Enhanced "buffer info" dialog box
332    Enhanced find-selection so that empty selections work better
333    Enhanced modules/c.tcl so that prototype location is more robust for different coding styles
334    Updated the README.e93 document (BIG THANKS!)
335    Added .src to the extensions recognized as assembly code
336    Removed errno and sys_errlist from errors.c
337    Created "e93r" script for remote execution -- this allows you to pass files to a running e93
338    Fixed "dirty" flag so that it tracks the "undo" status of a buffer
339
340
341Release of 1.2r8
342------- -- -----
343
344Changed the way e93 finds and runs its startup scripts.
345
346Added the long awaited Syntax Highlighting.
347
348Changed the way e93 internally deals with fonts and colors.
349
350Modified the way e93 internally deals with selections.
351
352Added < and > to regular expression matcher to allow matches on
353word boundaries.
354
355Changed regular expression matcher to allow empty groups (as this
356helps with the syntax highlighting rules).
357
358Modified text drawing to allow fonts with characters which overhang
359their cell boundaries (such as serifed and italic fonts) to work
360without having the overhanging portions clipped.
361
362More code formatting changes.
363
364Bug fix: Reverting to a document which contained 0 bytes did not
365work correctly.
366
367Bug fix: When doing a replace, the cursor did not always end up
368in the correct spot.
369
370Modified task code to keep e93 from using pause() to give time
371back to the system when tasks have data for the editor. This resulted
372in a 30% speed increase when reading task data into buffers on fast
373machines.
374
375Allowed menu key definitions to be overwritten by subsequent menu
376definitions.
377
378Added "the Hand" function to the middle mouse button to allow
379easier text movement.
380
381Changed .e93rc to show modified files in the "Choose window" dialog.
382
383Changed .e93rc to remember the contents of some dialogs across invocations.
384
385Changed the function of SHIFT-Arrow keys to work more as expected:
386previously, the selection was always expanded. Now, it expands and
387contracts in a more intuitive way.
388
389Changed the columnar paste algorithm:
390OLD way: delete all selections in document, paste columnarly.
391NEW way: paste each selection of the clipboard over each selection in the
392document until we run out of selections in the clipboard or document.
393If there are no more selections in the document, then paste the remaining
394clipboard selections columnarly. If there are no more selections in the
395clipboard, delete the remaining selections in the document.
396
397Changed behavior of the horizontal scroll bar so that it is possible
398to scroll the text beyond the right-most position dictated by the
399thumb. This makes it possible to see and edit the ends of very long
400lines, but does add a small bit of strangeness to the behavior of the
401scroll bar.
402
403Changed the way the editor homes the view when text is being sent to
404a buffer from a task. Now, the editor will not scroll horizontally
405when it homes. This makes it much easier to see what is happening
406when tasks dump long lines into the view.
407
408Allowed the escape key to be used to abort searches and scripts.
409
410Release of 1.2r7
411------- -- -----
412
413Code formatting changes.
414
415Some problems with SIGALRM fixed under Linux and IRIX.
416
417
418Release of 1.2r6
419------- -- -----
420
421The fallback font list (fonts e93 looks for when it cannot locate the
422one it really wants) has been changed. This was done to make e93
423behave better on machines that do not have b&h fonts.
424
425Opening and closing of e93's menus has been made slightly more
426efficient. This was done to make it faster with some window managers
427(like fvwm) which tend to behave very slowly when e93 changes the size
428of its menu window.
429
430The open and save dialogs have been changed slightly to make them
431more friendly.
432
433The startup procedure which reads the .e93rc file has been improved to
434handle some error cases in a more friendly way.
435
4364 new Tcl commands have been added:
437
438  buffervariables
439  setbuffervariable
440  unsetbuffervariable
441  getbuffervariable
442
443These allow variables to be created which are local to any given buffer.
444This will make it much easier for Tcl scripts to hang information off
445of a buffer, and reference it later.
446
447Finally, .e93rc has been changed in the following way:
448
449Checks were added to see if the modification time of a file has
450changed while the file was being edited. (Warning you that another
451application did something to the file).
452
453Capitalization of function names has been standardized.
454
455The open selection command has been improved to handle globbing, and
456selecting the cursor line to open if no selections exist.
457
458Open Clipboard was added to the Edit/Clipboards menu.
459
460Release of 1.2r5
461------- -- -----
462
463Some minor cleanup to code calling Tcl.
464
465Some bugs related to reporting errors at inopportune times were
466located and removed. These usually showed themselves during very low
467memory conditions.
468
469Double click timer is now reset in the file dialog boxes. Clicking
470rapidly on the file list now works as expected.
471
472The initial delay before repeated scrolling/paging with scroll bars
473has been lengthened slightly.
474
475The allowable delay between consecutively typed characters in list
476boxes has been lengthened slightly.
477
478A bug in the menu code was removed. The bug was caused by clicking
479multiple mouse buttons at the same time while tracking menu items.
480
481The directory dialog has been modified to show only directories.
482Previously it also showed files.
483
484Color handling has been altered so that named colors are now
485recognized. Previous to this, all colors had to be specified as 6 hex
486digits RRGGBB. Now, if a machine supports color names, e93 will also
487accept them.
488
489.e93rc was modified:
490  Strip EOL Whitespace and line termination functions were added.
491  Align Left was added.
492  "About" was slightly modified.
493  Color names were added.
494  Line Wrap functions were added.
495
496Characters with diacritical marks such as umlauts and other special
497characters which are contained in the upper half of the character set
498will now be displayed properly by e93. Previously, any character above
4990x7F would have been displayed as its hexadecimal equivalent. e93 will
500now use the character contained in the current font (as long as it is
501not of 0 width, in which case, it will display the hex equivalent as
502before).
503
504Two new relative cursor movement modes have been defined:
505STARTPARAGRAPH and ENDPARAGRAPH which will move the cursor to the
506start or end of a paragraph. These modes can be used with the
507following commands:
508
509movecursor
510delete
511expandselection
512reduceselection
513
514
515Release of 1.1r4
516------- -- -----
517
518.e93rc was modified:
519  Mark, Directory and C menus were added. Some more cleanup.
520  Views menu became Windows menu. Printing menus were added.
521
522All dialogs were modified to handle error conditions more
523consistently.
524
525The Ok dialog was modified to wrap text instead of drawing it off the
526edge.
527
528Open/save file dialogs were modified to handle more cases. Also a "/"
529was added after all items in the dialogs which point to directories.
530
531A new Path selection dialog was written, and a Tcl command
532(pathdialog) was added.
533
534Menus were modified so that you do not have to hold the mouse button
535down while making menu selections. You can now click on the various
536submenus one at a time to make a selection. This is more consistent
537with most window managers, and easier to use.
538
539Text routines were sped up by adding a cache mechanism that allows e93
540to locate positions in the text more quickly. The speed increase
541should be especially noticeable when editing large files (>1MB).
542Assuming you have enough virtual memory, e93 should now be able to
543edit very large (<2GB) files without a noticeable slow down.
544
545When treating replacement text as a Tcl script, 10 new variables (in
546addition to $found) are available if the search string was a selection
547expression: $0 - $9 are now set to the \0 through \9 matches of the
548selection expression.
549
550A bug that caused a rare memory leak related to search and replace was
551found and fixed.
552
553A bug in realpath2 that caused extra '/' characters to appear in its
554output was fixed.
555
556The clipboard interface with X windows has changed. Previously, e93
557used the clipboard mechanism to import/export to the X windows
558environment. However, most X windows applications do not use the
559clipboard. Instead, they use the X selection mechanism. Users
560complained that they could not easily communicate with programs that
561used only the selection mechanism (most programs). So, e93 now does
562the following to support communication with other X applications:
563Whenever text is copied into e93's current clipboard, e93 takes
564ownership of the current selection. If another application does a
565"paste selection" (many use the middle mouse button for this) while
566e93 owns the selection, the application will get the text in e93's
567current clipboard. Conversely, If another application owns the current
568selection, attempts to paste from the current clipboard within e93
569will cause it to copy the selected text from the current selection
570owner into the current clipboard before pasting. This all seems
571somewhat convoluted, but since e93 supports multiple selections
572simultaneously across multiple windows, and X does not, this is the
573best solution I can currently offer.
574
575The editor startup scheme was modified so that it looks for the .e93rc
576file in your home directory first, but if it is not found, it will now
577also look through the path given by $PATH in its environment. As soon
578as it locates a .e93rc file that it can open, it will execute it and
579stop looking. A Tcl global variable SCRIPTPATH is set to the path of
580the script that is executed.
581
582The font selection dialog was written. It is better than what it
583replaces (a dialog that made you type in the font you wanted) but it
584still could use some work.
585
586Release of 1.0r3
587------- -- -----
588
589The increment of the minor version number (1.0->1.1) indicates lots
590of changes.
591
592.e93rc was modified:
593  Some new functions added, some old ones cleaned up slightly. The
594  "unknown" function was modified so that if it launches a task that
595  wants input from stdin, it will get an EOF, instead of hanging
596  e93.
597
598README.e93 was written, as a first cut at a manual. Read it, if you
599have suggestions, let me know. There is a lot more to do in this
600arena, but I hate writing documentation, so this is it for a while.
601
602A proper open/save file dialog was written. It is kind of different.
603Let me know how you like it.
604
605There is also a new listdialog function which allows choices from a
606Tcl list. This dialog was used to implement the new "Windows..." menu
607function.
608
609Dialog management has changed significantly.
610
611Color handling was improved, so the editor should not just quit if it
612cannot get colors at startup. The new behavior is to just get either
613black, or white depending on which color is closer to the one asked
614for.
615
616Tasks are now hung off of buffers, instead of windows as they were
617previously. This allows for tasks to be running in buffers which do
618not have associated windows.
619
620EOF can now be sent to a task by closing the input pipe.
621
622Task error handling has been improved.
623
624A speed governor was installed on all scrolling items so you folks
625with screaming fast machines will not have things scrolling so fast as
626to be annoying. This should not slow down slow machines.
627
628LOTS of minor source code changes.
629
630Release of 1.0r2
631------- -- -----
632
633.e93rc was modified:
634  Some defaults were made easier to change.
635  Error reporting during file save functions was improved.
636  Menu names were made more consistent.
637  Some features were added to the "Misc" menu.
638
639The call to the library function "realpath" in xgui/misc.c was
640replaced by a call to a new internal routine "realpath2" which does
641the same thing. This was done for those machines that do not include
642"realpath" in their libraries.
643
644Release of 1.0r1
645------- -- -----
646
647xgui/includes.h was modified to include <sys/time.h> because some
648machines require it.
649
650Two bugs in keybind.c were found and corrected.
651
652Error reporting at init time was enhanced so that users would know if
653e93 failed to start up because of a lack of available colors.
654
655Startup script execution has been changed so that the editor will not
656startup if it cannot locate the startup script.
657
658The default .e93rc was slightly modified to change the colors of some
659windows.
660
661guidefs.h was modified to get rid of an array of 0 length that
662offended some compilers.
663
664Release of 1.0r0
665------- -- -----
666
667The makefile was altered to get rid of -L$(LIB) in the link line which
668was causing trouble.
669
670killpg in xgui/tasks.c was modified to kill(-pid...) because some
671systems do not have killpg.
672
673xgui/events.c was modified to make sigaction a little more portable.
674
675The clipboard is now imported when the editor starts.
676
677A new Tcl command called "version" was added to allow users to find
678out which version of the editor they are using.
679

README.e93

1e93 Manual
2July 19, 2000
3
4e93 is a portable window based text editor oriented to the needs of
5programmers. It was written to take advantage of the windowing systems
6found on today's workstations, and PCs. e93 is based on the Tcl
7scripting language, and relies on this language for most of its high
8level functionality.
9
10e93 supports a model of editing which emphasizes limiting the number
11of modes, and maximizing the use of a small, easily learned set of
12editing commands.
13
14To install e93, please read the file "INSTALL" that came with this
15distribution.
16
17NOTE: Since e93 is portable, I have attempted to keep this manual
18machine/OS independent to a reasonable extent. However, since e93 was
19first written for UN*X machines, there is a slight bias towards them
20in this documentation.
21
22
23Starting e93
24-------- ---
25To start e93 from a command line interface (if your machine/OS has
26one), type:
27
28e93 <fileToEdit> <fileToEdit> ...
29
30e93 will start up, and open all of the specified files for editing.
31There are no command line options, just filenames.
32
33NOTE: each time you run e93 it creates an entirely new instance
34of the editor.
35
36
37Environment variables
38----------- ---------
39There is one environment variable that will affect the operation of
40e93 (X windows version only).
41
42E93_COLORMAP
43
44If this variable is defined, e93 will attempt to allocate its own
45color map at start-up. This may allow it to work better on 256-color
46displays.
47
48If it is not defined, e93 will attempt to share the system's default
49colormap.
50
51
52Windows and Buffers
53------- --- -------
54When e93 opens a file for editing, it reads the contents of the file
55into a "buffer", and then closes the file. All editing takes place
56within the buffer, and changes are not written back to the file until
57the buffer is "Saved".
58
59A buffer is an area of memory where text is stored while it is being
60edited. Buffers can contain arbitrary amounts of text, and do not
61place any limits on the characters they contain (ASCII \0 is allowed
62in a buffer). Although buffers are usually used to hold the contents
63of files, they are also used to hold other things, like new documents,
64clipboards, and the text that is used by the Find and Replace
65functions.
66
67All buffers have names. These names are needed so that buffers can be
68referred to from Tcl scripts. The name of each buffer must be unique.
69buffer names can be of arbitrary length, and can contain any character
70except '\0'. A buffer open to a file is typically named with the full
71path name of that file. Buffer names are case sensitive.
72
73Buffers can have "windows" associated with them. A window can be
74thought of as a view onto the contents of a buffer. Windows are where
75most editing commands are carried out. It is important to understand
76that buffers do not NEED to have windows associated with them. In
77fact, certain buffers (like clipboards) typically are not associated
78with windows.
79
80Each window on the other hand, is always associated with a buffer.
81Windows also have names, and each takes the name of the buffer it is
82associated with.
83
84Many of the features of a window can be changed from Tcl scripts.
85Some of these are:
86	Foreground Color
87	Background Color
88	Font
89	Tab Size
90	Location
91	Width/Height
92
93See Appendix A for detailed information on commands that modify
94windows.
95
96e93 maintains the concept of an "active window". This is the window
97that is top-most. Most menu commands operate on the active window.
98
99Each window has a "Status bar" which gives useful information about
100the buffer being edited. The status bar indicates if a buffer has been
101modified, how many lines of text it contains, how many characters of
102text it contains, and gives information about the current
103cursor/selection position. Also, if there is a task running in the
104window, the status bar will let you know.
105
106
107Cursors
108-------
109The cursor is a small flashing vertical line that appears in the text
110of the active window. Its position indicates where the next editing
111operation will take place. e93's editing model considers the cursor to
112be akin to a selection of 0 characters. By contrast, in some editors,
113you can have both a cursor, and a selection active simultaneously. In
114e93, the selection and the cursor are really the same thing, so if you
115have a selection, that IS your cursor.
116
117
118Selections
119----------
120e93's selection mechanism is one of its more distinguishing features.
121At first glance, e93 selects text in the same way as many other modern
122editors, namely:
123
124To select text for cut, copy, paste, or other operations, first move
125the mouse pointer to the position where the selection should begin,
126click the left button, and while holding it down, drag the mouse
127pointer to the end of the desired selection. The process "highlights"
128the selected text (by drawing it in inverse colors). The highlighted
129selection can then be operated on by a number of editor functions. e93
130also supports word, line, and document selection by double, triple,
131and quadruple clicking respectively. (Double clicking is clicking the
132mouse button twice in rapid succession). If you double click, holding
133the left button down after the second click, e93 will then select words
134as you drag the mouse along. This also works for lines when triple
135clicking.
136
137To adjust a selection, hold down the shift key on the keyboard, and
138click the left mouse button in the document. This will either enlarge,
139or reduce the current selection, depending on where you click.
140Clicking outside the current selection will enlarge it so that it
141extends to the point where you clicked. Clicking inside the selection
142will reduce it by pulling the nearest edge in to the point where you
143clicked. You can also shift-double, shift-triple or shift-quadruple
144click, and get the expected results.
145
146Segmented Selection
147
148A powerful feature of e93 not found in most other modern editors is
149known as "Segmented Selection." This means that e93 is capable of
150creating a discontiguous selection (one which has "holes" in it). This
151feature is used by e93 to implement a more familiar form of selection:
152
153Columnar Selection
154
155To create a columnar selection, click the right mouse button (if your
156mouse has more than one button) and drag the mouse over the document.
157This will create a selection that is rectangular. NOTE: if your mouse
158only has one button, you can create a columnar selection by holding
159the "Command" key on the keyboard down, while clicking and dragging.
160You would typically use columnar selection to manipulate data that
161appears in columns of text. As above, double clicking will force the
162selection to begin and end at word boundaries. Triple and quadruple
163clicking will also work as expected. You can also use the shift key as
164described above to expand or reduce the columnar selection.
165
166NOTE: although a columnar selection looks rectangular to you, it is
167important to understand that e93 does not really think of it that way.
168As far as e93 is concerned, a columnar selection is nothing more than
169a discontinuous selection which spans pieces of the text. (In this
170case, a small portion of one line, followed by a portion of the line
171below it, and so on...) This distinction will become important as
172operations that work on selections are discussed.
173
174
175Marks
176-----
177Sometimes it is desirable to remember a given place in the text, and
178be able to return to it later. Most editors refer to this feature as
179"marking", or "book-marking". In e93, marks do not simply remember a
180place in the text. Instead, they remember an entire selection. e93
181allows for an arbitrary number of marks of arbitrary complexity. As
182you edit the text, e93 attempts to update each mark so that it points
183to what it used to, even though you may be making modifications above
184or in the text which is marked. The default e93rc.tcl file sets things up
185so that marks can be set in a buffer by typing CMD-F1 through CMD-F4
186on the keyboard. The respective mark can be recalled by F1 through F4.
187
188
189Cut, Copy, and Paste
190---  ----  --- -----
191Like other editors, e93 supports Cut, Copy, and Paste. When the
192selected text is Cut from a buffer, it is removed from that buffer,
193and placed into another buffer referred to as the "clipboard." When
194the selected text is Copied from a buffer, it is not removed, but is
195just copied into the clipboard. Each time a Cut or Copy operation
196takes place, the text that is placed into the clipboard completely
197overwrites the text that was there. Once you have text in the
198clipboard, it can be placed into another buffer by pasting. Pasting
199does not destroy the contents of the clipboard.
200
201The clipboard in e93 is nothing more than a buffer which has been
202designated as the clipboard. It is possible to designate any buffer as
203the clipboard, and it is also possible to switch on the fly. This
204allows e93 to support an arbitrary number of clipboards. The default
205e93rc.tcl creates 10 buffers to be used as clipboards, and provides menu
206operations to switch between these buffers.
207
208NOTE: clipboard buffers in e93 do not typically have windows open onto
209them, but it is possible, and sometimes desirable to attach a window
210to a clipboard. The command to open a window onto clipboard 0 would
211be:
212
213OpenDefaultWindow clip0
214
215NOTE: the command OpenDefaultWindow is not a command built into e93,
216instead, it is a Tcl procedure, defined in the e93rc.tcl file (described
217below).
218
219Cut, Copy, Paste, and fun with Segmented Selections
220
221Since e93 allows a selection to have "holes" in it, Cut, Copy, and
222Paste take on a slightly different flavor than in most other editors.
223When a selection is Cut, or Copied, the text of each segment of the
224selection is placed into the clipboard sequentially. As each segment
225is placed into the clipboard buffer, it is also selected as a segment
226in the clipboard buffer. The result is a clipboard that not only
227contains the pieces of text that were selected, but also one that
228remembers where each piece begins and ends (since each piece is
229selected individually in the clipboard).
230
231When text is pasted from the clipboard, each segment is pasted
232individually. The process works as follows:
233
234Each selection in the clipboard is pasted over each selection in
235the document until e93 runs out of selections in the clipboard or
236document. If there are no more selections in the document, then the
237remaining clipboard selections are pasted columnarly with each
238successive segment placed into the line immediately below the
239previous one..... If there are no more selections in the clipboard,
240then the remaining selections in the document are deleted.
241
242NOTE: e93 does not care how selections were placed into the clipboard.
243It always pastes them in this columnar fashion. Also note that in the
244case of a selection with just one segment (no discontinuity) that the
245paste operation works exactly as it would in an editor without
246segmented selection.
247
248
249Scripting
250---------
251e93 utilizes the Tcl scripting language. This allows it great
252flexibility. Users of e93 are able to write scripts to perform complex
253editing tasks, as well as use them to configure the editor to personal
254taste.
255
256When e93 starts, it attempts to locate a file with the name e93rc.tcl
257(some implementations use slightly different names). This file is
258meant to contain a Tcl script. The script is charged with the task of
259setting up all menus, key bindings, and defaults that will be
260available when the editor starts. It is also the responsibility of
261this script to interpret all of the command line parameters passed to
262e93. That includes opening any files present on the command line.
263Without this script, e93 would not do very much. Therefore, if the
264script cannot be located at startup, e93 will complain, and quit.
265
266This script is the primary means by which e93 is customized to the
267taste of the user. Given the number of things defined by this script,
268a fair amount of customization is available, but at the cost of some
269complexity. See Appendix B for information on how to customize
270e93 at startup time.
271
272Once e93 has started, Tcl commands may be executed by typing them into
273any window, and pressing the enter key on the numeric keypad. The
274results of the command (if they are not piped elsewhere) are then
275placed into the window.
276
277If you are viewing this file from within e93, do the following:
278Place the cursor anywhere on the following line, and press keypad
279enter:
280
281beep; okdialog {Hmmm, that was interesting}
282
283You should hear a beep, and then a dialog should pop up with a useless
284message in it. This works, because the e93rc.tcl script has bound the
285keypad enter key to a function that grabs the line the cursor is on
286(or the currently selected text), and sends it to Tcl for processing.
287
288The list of built in commands that e93 currently understands is given
289in Appendix A.
290
291
292Keyboard Input
293-------- -----
294e93 separates the keyboard into three types of keys: modifiers,
295characters, and functions.
296There are 11 modifier keys defined by e93:
297	caps-lock
298	shift
299	control
300	modifier 0  (command)
301	modifier 1  (option)
302	modifier 2 - modifier 7 (implementation specific)
303
304The character keys are a-z, numbers, tab, escape, return, etc...
305These are the keys which would be expected to insert a character
306when typed.
307
308The function keys are:
309Arrows, Backspace, F1, F2, Undo, Help, Break, etc... These are keys
310which do not insert characters, but instead, perform actions.
311
312When no keys are bound (See the section on Key binding below), e93
313relies on a default set of bindings that are "hardwired" into the code.
314NOTE: key bindings can be used to override this default behavior. Here
315is a list of keys, and default actions:
316
317All unmodified, or shift modified characters are inserted into the
318active window.
319
320All control modified characters are inserted into the active window
321(e93 does not treat the control key specially by default, since
322programmers often want to be able to enter control sequences into text
323with a minimum of bother).
324
325Unmodified Arrows move the cursor up/down by line, left/right by character.
326Control Left/Right Arrow moves cursor by word left/right.
327Control Up/Down Arrow scrolls the document down/up without moving the cursor.
328Command Left/Right moves to start or end of line.
329Command Up/Down moves up or down by page.
330Shift can be used with the above combinations to expand or reduce the
331selection.
332
333Page up, Page down move the cursor up or down by a page.
334Shift can be used with the page up/down to expand or reduce the
335selection.
336
337Home, and End move the cursor to the start or end of a line.
338Command Home/End moves to start/end of the document.
339Shift can be used with the home/end to expand the selection.
340
341Unmodified Backspace deletes the character to the left of the cursor.
342Command Backspace deletes to end of line.
343Command Shift Backspace deletes to beginning of line.
344Command Option Backspace deletes to end of buffer.
345Command Shift Option Backspace deletes to beginning of buffer.
346Control Backspace deletes word left.
347Control Shift Backspace deletes word right.
348
349Unmodified Delete deletes the character to the right of the cursor.
350Command Delete deletes to beginning of line.
351Command Shift Delete deletes to end of line.
352Command Option Delete deletes to beginning of buffer.
353Command Shift Option Delete deletes to end of buffer.
354Control Delete deletes word right.
355Control Shift Delete deletes word left.
356
357Return does an autoindent (except in some dialog windows where it
358selects the "Ok" option). NOTE: if you wish to place a new-line
359character into the text of a dialog window, type Control J.
360
361Tab inserts a tab (except in some dialog windows where it may move
362between fields). NOTE: if you wish to insert a tab character into the
363text of a dialog window, type Control I.
364
365Escape inserts an escape (except in some dialog windows where it
366selects the "Cancel" option). NOTE: if you wish to insert an escape
367character into the text of a dialog window, type Control [.
368
369Cut, Copy, Paste, Undo, Redo (if you have these keys) perform their
370respective actions.
371
372
373Menus and Key Bindings
374----- --- --- --------
375Menus are used to place functions that are executed often in a
376convenient place where they can be accessed quickly. The menuing
377system in e93 is dynamic. Menus can be added or deleted at any time.
378There are two Tcl commands used to add/delete menus:
379
380addmenu    - adds or replaces a menu in the menu bar.
381deletemenu - deletes a menu, and its children from the menu bar.
382
383Examples:
384
385addmenu {} LASTCHILD 1 "Test" {\KA} {okdialog "Testing 123"}
386
387This command adds a menu at the end (LASTCHILD) of the root menu {}.
388The new menu is called Test, it has a keyboard equivalent of
389CMD-SHIFT-a, and when selected, it will bring up a dialog box with a
390test message in it. NOTE: if you are viewing this file from e93, place
391the cursor on the example line above, and press keypad enter. You
392should see the menu item being added to the menu bar.
393
394To delete the menu:
395
396deletemenu {Test}
397
398Appendix A contains a more detailed description of these commands.
399
400Keys can also be bound to functions within e93. Key binding is much
401the same as defining menus. The major difference is that key bindings
402have no visual representation (as in a menu item that the user can
403see). Also depending on the implementation of e93, key bindings may be
404more versatile than menu key equivalents, allowing a richer set of key
405combinations to be bound to functions. For example, in the X windows
406version of e93, menu key equivalents only function when the command
407key is pressed, but bound keys can be bound to virtually all
408combinations.
409
410There are two major key binding functions:
411
412bindkey   - bind a key combination to a Tcl script.
413unbindkey - remove a bound key combination.
414
415Using the menu example from above, if we wanted to bind the function
416key F5 to bring up the test dialog box, the command would be:
417
418bindkey F5 00000000000 {okdialog "Testing 123"}
419
420To get rid of the binding:
421
422unbindkey F5 00000000000
423
424All those 0s are called the "modifier string" they tell which modifier
425keys should be in which states for the binding to take effect. In this
426example, no modifiers can be pressed when F5 is pressed if the binding
427is to take effect. As usual, see Appendix A for a more detailed
428description.
429
430NOTE: the key binding, and menu key equivalent functions are
431completely separate. If you define a menu that has a key equivalent,
432and also bind that combination of keys to some other function, e93
433does not guarantee which will take precedence, only that one of them
434will be executed, and not both.
435
436
437Find and Replace
438---- --- -------
439e93 performs search and replace like most other modern editors, with
440the following exceptions:
441
442Find All
443
444This simply locates, and selects (using a segmented selection) all
445occurrences of the search string.
446
447Limit Scope
448
449e93 can limit the scope of Find All/Replace All functions so that they
450do not go outside the boundaries of the current selection (even if the
451current selection is discontiguous (in which case it searches the
452pieces individually)).
453
454Tcl Procedures as Replacement Text
455
456You can specify that e93 should treat the text of the replacement
457string as a Tcl script to execute each time it is about to replace
458something. e93 will execute the script, using the results of that
459execution as the text to actually replace with. NOTE: when doing this,
460the editor creates a set of Tcl variables which contain various
461portions of the matched text. These variables can be used from within
462the script to reference the text which is about to be replaced. The
463variables are:
464$found   - contains the entire text which is about to be replaced.
465If the search is done using regular expressions, then:
466$0-$9    - contain the contents of the matching subexpressions.
467
468Information on e93's regular expression syntax is contained in the
469file 'README.regex'.
470
471As an example of why this might be useful, consider the task of
472changing a bunch of numbers in a document from decimal to hex.
473To do this in e93, you could enter the following into the find/replace
474dialog:
475
476Find (selection expression):
477[0-9]+
478
479Replace (treated as a Tcl script):
480format 0x%X $found
481
482The find part will locate numbers, the replace part will pass
483these numbers to the Tcl "format" command which will convert
484them to hex, and return the converted string. e93 takes this
485string, and uses it as the replacement.
486
487
488Undo and Redo
489---- --- ----
490e93 remembers undo/redo information only for operations which change
491the text of a buffer. It does not remember cursor movements, or
492selections.
493
494Unlimited amounts of undo information are recorded separately for each
495buffer. e93 groups multiple contiguous character insertions and
496deletions so that they become single undo items.
497
498Each time you undo in a buffer, e93 remembers what was undone as redo
499information. However, once you make a change in a buffer, all redo
500information is lost.
501
502
503                                Appendix A
504                                -------- -
505This appendix lists the Tcl commands which are implemented by e93, and
506gives a short description of each. These are in logical, not
507alphabetical order.
508
509Buffers and Windows
510------- --- -------
511	newbuffer bufferName
512Create a new buffer with the name bufferName. If bufferName already
513exists, this will return an error.
514
515	openbuffer pathName
516Open a buffer to the file at the end of pathName. This will return the
517fully expanded path name for the buffer if it is successfully opened.
518If asked to open a buffer to a file which is already opened, this will
519return the previously opened buffer name. If asked to open a file
520which cannot be opened, this will return an error.
521
522	closebuffer bufferName
523Close bufferName. NOTE: this does not ask any questions, it just
524closes the buffer.
525
526	savebuffer bufferName
527If bufferName is linked to a file, this will save the buffer to its
528file.
529
530	savebufferas bufferName newPath
531Save bufferName to newPath, if the save succeeds, the buffer is
532renamed, and the new name is returned.
533
534	savebufferto bufferName newPath
535Save bufferName to newPath, do not rename the buffer, only complain if
536the save could not be completed.
537
538	revertbuffer bufferName
539Revert bufferName to last loaded state, no questions asked.
540
541	isdirty bufferName
542Return a boolean value that tells if bufferName has been modified
543since it was last loaded, or saved.
544
545	fromfile bufferName
546Return a boolean value that tells if bufferName is associated with a
547file. A buffer is associated with a file, if e93 has read the buffer
548from a file, or has done a savebufferas.
549
550	haswindow bufferName
551Return a boolean value that tells if bufferName has an associated
552window.
553
554	cleardirty bufferName
555Set bufferName as unmodified.
556
557	bufferlist
558Return a Tcl list of all of the currently open buffer names.
559
560	windowlist
561Return a Tcl list of all of the currently open window names.
562
563	openwindow bufferName x y w h fontName tabSize foregroundColor backgroundColor
564Open a window onto bufferName. Place the window at x,y and give it size w,h.
565The text will be displayed in font fontName. NOTE: if e93 cannot
566locate the specified font, it will default to one of its own choosing.
567tabSize is used as the initial tab size.
568foregroundColor specifies the foreground color of the window as 3
569hexadecimal digits, one each for R, G, B. (e.g. white=FFFFFF,
570green=00FF00, gray=808080) backgroundColor specifies the background
571color of the window.
572
573	closewindow windowName
574Close windowName if it exists, but do not close its associated buffer.
575
576	setrect windowName x y w h
577Change the position and size of windowName.
578
579	getrect windowName
580Report the position and size of windowName.
581
582	setfont windowName fontName [styleIndex]
583Change the font used by a window. If the font cannot be located,
584default to one that can.
585
586	getfont windowName [styleIndex]
587Report the font in use by windowName.
588
589	settabsize windowName tabSize
590Set the tab size for windowName.
591
592	gettabsize windowName
593Report the tab size for windowName.
594
595	setcolors windowName foregroundColor backgroundColor [styleIndex]
596Set the colors for windowName.
597
598	getcolors windowName [styleIndex]
599Report the colors for windowName.
600
601	buffervariables bufferName
602Report all variable definitions assigned to bufferName.
603
604	setbuffervariable bufferName variableName variableText
605Assign a variable with variableName to bufferName. These variables are
606kept local to each buffer. This makes it convenient for Tcl scripts to
607hang information off of each buffer, then reference it later.
608
609	getbuffervariable bufferName variableName
610Get the text of variableName contained in bufferName. If no such
611variable exists, an error is returned.
612
613	settopwindow windowName
614Make windowName the top-most window.
615
616	minimizewindow windowName
617attempt to minimize (in whatever way the current OS supports) the given document window
618
619	unminimizewindow windowName
620attempt to un-minimize (in whatever way the current OS supports) the given document window
621
622	activewindow
623Report which window is top-most.
624
625	updatewindows
626Redraw all invalid areas of all windows.
627
628	screensize
629Report the screen's width, and height.
630
631
632Menus and Key bindings
633----- --- --- --------
634	addmenu menuPathList relationship active menuName menuModifiers menuFunction
635Add a menu to the menu tree.
636menuPathList is a Tcl List that tells where the add should take place.
637relationship tells how the new item should be linked to the path:
638	NEXTSIBLING	- link as next sibling of the given path.
639	PREVIOUSSIBLING - link as previous sibling of the given path.
640	FIRSTCHILD - link as the first child of the given path.
641	LASTCHILD - link as the last child of the given path.
642menuName is the name of the new element to add.
643menuModifiers is a string that is used to change the menu item:
644	\FfontName can be used to specify a new font for the menu item.
645	\S makes the item a separator line.
646	\KkeyName assigns keyName as a command key for the menu item.
647menuFunction is a Tcl script to run when the menu item is selected.
648
649	deletemenu menuPathList ?menuPathList ...?
650Delete the menus at the end of menuPathList. (e.g. to delete all
651menus, use deletemenu {})
652
653	bindkey keyName modifiers keyFunction
654Set up a binding between a keyboard key, and a Tcl script.
655keyName is the system dependent name of the key to bind.
656	(in X windows, it is the keysym name)
657modifiers is a string of 11 characters that tell e93 which
658	modifier keys should be in which states for this binding to
659	take effect. The string can contain X, 0, or 1 in each character
660	position.
661		X - don't care which state the modifier is in.
662		0 - modifier must not be pressed.
663		1 - modifier must be pressed.
664	The 11 modifier keys are (in order:)
665		Caps lock
666		Shift
667		Control
668		Mod 0	- system dependent modifiers
669		Mod 1
670		Mod 2
671		Mod 3
672		Mod 4
673		Mod 5
674		Mod 6
675		Mod 7
676For example: binding the combination Control-F5 to beep:
677bindkey F5 00100000000 {beep}
678
679	unbindkey keyName modifiers
680Remove binding of keyName, modifiers.
681Example:
682unbindkey F5 00100000000
683
684	keybindings
685Report current list of keys, modifiers, and what they are bound to.
686
687	waitkey
688Wait for user to type a key, report keyName, and modifiers.
689
690	getkey
691See if a key has been pressed, if so, return keyName and modifiers
692if not, return error.
693
694
695Undo and Clipboard
696---- --- ---------
697	undotoggle bufferName
698If there is redo information for bufferName, redo. If not, then if
699there is undo information for bufferName, undo. If not, return an
700error.
701
702	undo bufferName
703Perform a undo on bufferName. If there are no undos, return an error.
704
705	redo bufferName
706Perform a redo on bufferName. If there are no redos, return an error.
707
708	breakundo bufferName
709Put a break into the flow of undo information for bufferName.
710
711	flushundos bufferName
712Throw away all undo-redo information for bufferName.
713
714	cut bufferName ?clipboardbuffer?
715Cut the selected text from bufferName into the current clipboard, or
716clipboardbuffer if specified.
717
718	copy bufferName ?clipboardbuffer?
719Copy the selected text from bufferName into the current clipboard,
720or clipboardbuffer if specified.
721
722	paste bufferName ?clipboardbuffer?
723Paste the contents of the current clipboard, or clipboardbuffer if
724specified into bufferName in a columnar fashion.
725
726	getclipboard
727Report the buffer which is currently assigned as the clipboard.
728
729	setclipboard clipboardbuffer
730Set the current clipboard as the buffer given by clipboardbuffer.
731
732
733Dialogs
734-------
735	textdialog dialogTitle ?initialText?
736Open a text entry dialog, with dialogTitle, and if specified, place
737initialText into the dialog. If the user exits the dialog with Ok,
738return the text that was entered. If he exits with cancel, return an
739error.
740
741	listdialog dialogTitle inputList
742Open a list selection dialog, with dialogTitle, and place inputList
743(which is a Tcl list) into the dialog. If the user exits the dialog
744with Ok, return the sub-list (which is a Tcl list) of items that were
745selected. If he exits with cancel, return an error.
746
747	opendialog dialogTitle ?initialText?
748Open a file open dialog, with dialogTitle, and if specified, place
749initialText into the dialog. If the user exits the dialog with Ok,
750return the list of files that were selected. If he exits with cancel,
751return an error.
752
753	savedialog dialogTitle ?initialText?
754Open a file save dialog, with dialogTitle, and if specified, place
755initialText into the dialog. If the user exits the dialog with Ok,
756return the file name that was selected. If he exits with cancel,
757return an error.
758
759	pathdialog dialogTitle ?initialText?
760Open a path choose dialog, with dialogTitle, and if specified, place
761initialText into the dialog. If the user exits the dialog with Ok,
762return the path name that was selected. If he exits with cancel,
763return an error.
764
765	okdialog dialogText
766Open a dialog with just one button, containing dialogText.
767
768	okcanceldialog dialogText
769Open a dialog with Ok, and Cancel buttons, containing dialogText. If
770the user exits the dialog with Ok, return without error. If he exits
771with cancel, return an error.
772
773	yesnodialog dialogText
774Open a dialog with Yes, No, and Cancel buttons, containing dialogText.
775If the user exits the dialog with Yes, return 1, if he exits with No,
776return 0. If he exits with cancel, return an error.
777
778	fontdialog dialogTitle ?initialFont?
779Open a font selection dialog, with dialogTitle, and if specified,
780place initialFont into the dialog. If the user exits the dialog with
781Ok, return the font that was entered. If he exits with cancel, return
782an error.
783
784	searchdialog dialogTitle findbuffer replacebuffer backwardsVar wrapAroundVar selectionExprVar ignoreCaseVar limitScopeVar replaceProcVar
785Open a search/replace dialog, with dialogTitle.
786findbuffer is the name of the buffer that find text will be placed into.
787replacebuffer is the name of the buffer that replace text will be placed into.
788backwardsVar is the name of a variable which contains a boolean that tells
789	if search should be done in reverse.
790wrapAroundVar tells if search should wrap around.
791selectionExprVar tells if find text should be interpreted as a regex.
792ignoreCaseVar tells if case should be ignored during the search.
793limitScopeVar tells if the scope of the search should be limited to the
794	current selection.
795replaceProcVar tells if the replace text should be interpreted as
796	a Tcl script.
797This dialog has 5 buttons which can be clicked on to exit
798Find        - returns string "find".
799Find all    - returns string "findall".
800Replace     - returns string "replace".
801Replace all - returns string "replaceall".
802Cancel      - returns Tcl error.
803
804
805Search and Replace
806------ --- -------
807the following options are available (see the command to know which options may apply):
808	-backward		search backwards.
809	-wrap			wrap the search or replace around the end of searchInbuffer.
810	-regex			treat findbuffer as a regular expression.
811		NOTE on replace:
812		also, treat the contents of replacebuffer as a selection expression
813		replacement string (unless -replacescript is present).
814	-ignorecase		ignore case during the search.
815	-limitscope		search only the selected text of searchInbuffer.
816		NOTE: when limiting the search scope by the selected text of searchInbuffer,
817		the regular expression characters ^, and $ will match the ends of a
818		selection segment.
819	-replacescript		treat the contents of replacebuffer as a Tcl
820		script that should be executed when a match is found, the results
821		of which will be placed into searchInbuffer. NOTE: when a match
822		is found, the text that matched is copied to a Tcl global variable
823		called $found, this variable can be referenced by the replace procedure.
824
825	find searchInbuffer findbuffer [options]
826Attempt to locate the text contained in findbuffer in searchInbuffer.
827	options: -backward, -wrap, -regex, -ignorecase
828
829	findall searchInbuffer findbuffer [options]
830Attempt to locate all occurrences of the text contained in findbuffer
831	in searchInbuffer.
832	options: -backward, -wrap, -regex, -ignorecase, -limitscope
833
834	replace searchInbuffer findbuffer replacebuffer [options]
835Attempt to locate the text contained in findbuffer in searchInbuffer,
836	if it is found, replace it with the contents of replacebuffer.
837	options: -backward, -wrap, -regex, -ignorecase, -replacescript
838
839	replaceall searchInbuffer findbuffer replacebuffer [options]
840Attempt to locate all occurrences of the text contained in findbuffer
841	in searchInbuffer, when each is found, replace it with the contents
842	of replacebuffer.
843	options: -backward, -wrap, -regex, -ignorecase, -limitscope, -replacescript
844
845
846Cursors and Selection
847------- --- ---------
848	selectall bufferName
849Select all of the text in the given buffer.
850
851	selectedtextlist bufferName
852Return a Tcl list, each element of which is a segment of the selection
853in bufferName.
854
855	selectline bufferName lineNumber
856Select lineNumber in bufferName. If lineNumber is out of range, select
857the line closest to the one given.
858
859	getselectionends bufferName
860Return the start and end positions (in characters) of the current
861selection in bufferName. If there is no selection, the cursor position
862is reported as both the start, and the end.
863
864	setselectionends bufferName startPosition endPosition
865Set the start and end positions of the selection in bufferName. If the
866start and end positions are the same, place the cursor at that
867position. If either position is out of range, it will be substituted
868with the position nearest it.
869
870	getselectionendlist bufferName
871return offsets of the ends of each selection segment
872if there is no selection, an empty list is returned
873
874	addselectionendlist bufferName list
875add list of ends given to the selection
876if any position is out of range, it will be forced in range
877if there is any overlap, the new segment boundaries will remain
878
879	getselectionatposition bufferName position
880return information about the selection at the given character position in the text
881The result is a value (0 if no selection, 1 if selection) and the position <= the given
882one where the current selection begins, and the position just after the end of the selection
883
884	setmark bufferName markName
885Create a mark with the given name in bufferName. If there is already a
886mark in bufferName with markName, it will be overwritten.
887
888	clearmark bufferName markName
889Delete markName from bufferName. If either the mark, or buffer
890specified does not exist, and error is returned.
891
892	gotomark bufferName markName
893Set the selection in bufferName to the one marked by markName. If
894either the mark, or buffer specified does not exist, and error is
895returned.
896
897	marklist bufferName
898Return a Tcl list, each element of which contains the name of a mark
899in bufferName.
900
901	homewindow windowName ?position? ?STRICT|SEMISTRICT|LENIENT?
902Move the view of windowName so that position (in characters) is
903showing, if position is not specified, the current cursor position, or
904start of the current selection is used.
905STRICT     - Forces the view to change so that the given position is
906	1/3 the way down the window.
907SEMISTRICT - If the given position is off the view, this does the same
908	thing as STRICT, else it does nothing.
909LENIENT    - Move the view as little as possible to get the given
910	position to be displayed.
911
912	gettopleft windowName
913Report the line number that is currently positioned at the top of
914windowName, and the offset in pixels from the left.
915
916	settopleft windowName topLine leftPixel
917Set the line number to display at the top of windowName, and the
918number of pixels from the left that windowName should display. NOTE:
919if any value is out of range, it will be set to the nearest allowable
920value.
921
922	textinfo bufferName
923Return the total number of lines and characters contained in
924bufferName. NOTE: the total number of lines is actually the total
925number of newline characters.
926
927	selectioninfo bufferName
928Return the following information about the selection in bufferName:
929startPosition      - position where selection starts (in characters).
930endPosition        - position where selection ends (in characters).
931startLine          - line number where selection starts.
932endLine            - line number where selection ends.
933startLinePosition  - offset into startLine where selection starts.
934endLinePosition    - offset into endLine where selection ends.
935totalSegments      - total number of selection segments.
936totalSpan          - total number of character selected.
937
938	positiontolineoffset bufferName position
939Given a character position within bufferName this will return the line
940number which contains that position, and the offset into the line of
941that position. NOTE: if position is out of range, it will be set to
942the nearest legal position.
943
944	lineoffsettoposition bufferName lineNumber offset
945Inverse of positiontolineoffset. Given a line number, and a character
946offset within the line, return the position in bufferName. NOTE: if
947lineNumber, or offset is out of range, they will be set to the nearest
948legal value.
949
950	movecursor windowName relativeMode
951Move the cursor in windowName in the direction given by relativeMode.
952Valid modes are:
953	LEFTCHAR       - move left by one (wrap to previous line if needed).
954	RIGHTCHAR      - move right by one (wrap to next line if needed).
955	LEFTWORD       - move left by one word (wrap lines as needed).
956	RIGHTWORD      - move right by one word (wrap lines as needed).
957	UPLINE         - move up by one line, attempt to stay at same horizontal offset.
958	DOWNLINE       - move down by one line, attempt to stay at same horizontal offset.
959	STARTLINE      - move to the start of the current line.
960	ENDLINE        - move to the end of the current line.
961	STARTPARAGRAPH - move to the start of the current paragraph.
962	ENDPARAGRAPH   - move to the end of the current paragraph.
963	UPPAGE         - move up by one page (as defined by the window size).
964	DOWNPAGE       - move down by one page (as defined by the window size).
965	STARTDOC       - move to the start of the document.
966	ENDDOC         - move to the end of the document.
967
968	delete windowName relativeMode
969Delete the characters in windowName between the cursor, and relative
970mode away from it. relativeModes are the same as in movecursor.
971
972	expandselection windowName relativeMode
973Expand the selection in windowName, by growing in relativeMode.
974relativeModes are the same as in movecursor.
975
976	reduceselection windowName relativeMode
977Reduce the selection in windowName, by shrinking in relativeMode.
978relativeModes are the same as in movecursor.
979
980
981Editing functions
982------- ---------
983	clear bufferName
984Delete all selected characters in bufferName.
985
986	extract bufferName startOffset endOffset
987Extract characters from bufferName between startOffset and endOffset.
988
989	insert bufferName textToInsert
990Delete all selected characters in bufferName, then insert textToInsert
991at the cursor position.
992
993	insertfile bufferName pathName
994Delete all selected characters in bufferName, then insert the contents
995of the file given by pathName at the cursor position.
996
997	autoindent bufferName
998Delete all selected characters in bufferName, insert a new line, then
999move over by the amount of white space that is contained at the start
1000of the previous line.
1001
1002
1003Styles and Syntax highlighting
1004------ --- ------ ------------
1005Information on e93's styles and syntax highlighting is contained in the
1006file 'README.syntaxmaps'.
1007
1008	getstyleatposition bufferName position
1009return information about the style at the given character position in the text
1010The result is a value (style index) and the position <= the given
1011one where the style begins, and the position just after the end of the
1012style
1013
1014	setstyle bufferName startPosition endPosition styleNum
1015set the style of text of the passed buffer
1016if the given end position is < the start position,
1017the positions will be reversed
1018if any position is out of range, it will be forced in range
1019
1020	selectiontostyle bufferName styleNum
1021Set the style of a buffer to a given value anywhere text is selected
1022
1023	styletoselection bufferName styleNum
1024Set the selection in a buffer everywhere a given style is in the buffer
1025NOTE: this does not clear the old selection, it will just add to it
1026
1027	addsyntaxmap syntaxMapName syntaxMap
1028create a syntax highlighting map from a list of expressions and a list of
1029mappings from expressions to styles
1030NOTE: this can be used to replace an existing syntax map, but
1031if the existing map is in use by any buffer which is busy, this will fail
1032before it does anything
1033
1034	deletesyntaxmap syntaxMap
1035delete a syntax map that was created by "syntaxmap"
1036Remove the map from all buffers which are using it
1037NOTE: if any buffer which is using the map is currently busy, this will
1038fail before it does anything.
1039
1040	syntaxmaps
1041return the list of currently defined syntax maps
1042
1043	setsyntaxmap bufferName syntaxMapName
1044Set the syntax map in use for the given buffer
1045If an empty map string is specified, then remove any map from the current buffer
1046
1047	getsyntaxmap bufferName
1048read back the syntax map in use for the given buffer
1049
1050	syntaxmapbuffers syntaxMapName
1051Return the list of buffer names which are currently using the given syntax map
1052
1053
1054Misc
1055----
1056	setwordchars wordCharacters
1057Set the editor's understanding of which characters are considered part
1058of words, and which are not. wordCharacters is a string containing all
1059of the characters to be considered parts of words. The editor uses
1060this information when double clicking, and when moving the cursor in a
1061relative direction by word.
1062
1063	getwordchars
1064Get the string which lists all the characters which are parts of words.
1065
1066	execute bufferName script
1067Execute the given Tcl script, place the results in bufferName if it still
1068exists after the script is finished, otherwise throw them away.
1069
1070	task bufferName taskData
1071If there is no task running in bufferName, start one running by passing
1072taskData to a shell. If there is a task running, place taskData on its
1073stdin.
1074
1075	updatetask bufferName
1076If there is a task running in bufferName, see if it has any output
1077ready, and if so, get it, and place it into bufferName.
1078
1079	eoftask bufferName
1080If there is a task running in bufferName, send it an EOF.
1081
1082	killtask bufferName
1083If there is a task running in bufferName, send it a Kill signal.
1084
1085	taskbytes bufferName
1086return the number of characters the last/current task has dumped into the given buffer
1087NOTE: this count is only reset when a task is launched
1088
1089	hastask bufferName
1090Return TRUE if there is a task running in bufferName.
1091
1092	beep
1093Make e93 emit an annoying beep sound.
1094
1095	checkbuffer bufferName
1096Run a sanity check on bufferName. If there is no problem (which there
1097never should be unless there is a bug in e93) report some statistics
1098about bufferName. If there is a problem, e93 may CRASH, or if you are
1099lucky, it will tell you what is wrong. This should NEVER report any
1100problems. If it does, please let me know!
1101
1102	forceQUIT
1103Rude unforgiving command which will make e93 QUIT without saving, or
1104asking to save any modified buffers. This is the only way to ask e93
1105to quit, so Tcl scripts must take care of the niceties of asking to
1106save modified buffers before this is executed.
1107
1108	version
1109Report the version number of the e93 that you are running.
1110
1111	settclstdout
1112set the buffer to be used for Tcl's stdout
1113if the buffer does not exist, complain, but if it is deleted while it
1114is being used as the output, that's ok -- the output is just discarded
1115
1116	gettclstdout
1117return the buffer being used for Tcl's stdout
1118if the buffer does not exist, fail
1119
1120	settclstderr bufferName
1121set the buffer to be used for Tcl's stderr
1122if the buffer does not exist, complain, but if it is deleted while it
1123is being used as the output, that's ok -- the output is just discarded
1124
1125	gettclstderr
1126return the buffer being used for Tcl's stderr
1127if the buffer does not exist, fail
1128
1129
1130Environment-specific commands
1131-------------------- --------
1132There are some commands in e93 which are specific to the environment
1133it was compiled for. These commands allow for a more fine-grained
1134integration of e93 into various OSs and windowing systems.
1135
1136X-Windows:
1137
1138	raiserootmenu
1139Force the root menu window to the top of the window hierarchy.
1140
1141	scrollbarplacement where
1142sets the scrollbar position to the left (where="left") or right
1143(where="right") for the next opened document/dialog windows. Default
1144is "right".
1145
1146
1147M$ Windows:
1148(these will be documented in detail later)
1149	windowscascade
1150	windowstilehorz
1151	windowstilevert
1152	windowsarrangeicons
1153	windowsprint
1154	windowssetglobalstatusfield
1155	windowssetglobalstatusbutton
1156	windowssetglobalstatusbarfont
1157	windowssetwindowstatusbarfont
1158	windowsgetstatusbarstringwidth
1159	windowsgetlocaltime
1160	windowswinhelp
1161	windowsgetregistrystringvalue
1162	windowssetregistrystringvalue
1163	windowssettaskseperator
1164	windowsdopopupmenu
1165	windowssetfiletranslationmode
1166	windowsgetfiletranslationmode
1167	windowsgetmousescrollspeed
1168	windowssetmousescrollspeed
1169	windowsgetscrollbarspeed
1170	windowssetscrollbarspeed
1171	windowsopenanothere93
1172	windowssetwindowtitle
1173	windowsrunapplication
1174
1175
1176
1177                                Appendix B
1178                                -------- -
1179e93 can be customized by creating scripts that are executed when the
1180editor starts up. By default, e93 locates and executes the script
1181"e93rc.tcl". This script contains the base information for a typical
1182e93 setup. Although it is possible to modify this script to change
1183e93's configuration, it is not generally recommended, since with each
1184update of e93, you will have to reintegrate your changes with the new
1185version.
1186
1187To help reduce the need to modify the "e93rc.tcl" script, and to allow
1188each user on a given machine to have a customized version of the
1189editor, the base startup script attempts to locate and execute various
1190user-specific script files.
1191
1192In Unix, these files reside in the user's home directory (in the
1193directory ~/.e93), and allow the user to add to e93's functionality in
1194a convenient way.
1195
1196The user's ".e93" directory may contain the following sub-directories:
1197
1198syntaxmaps
1199syntaxmaps_aux
1200highlightschemes
1201highlightschemes_aux
1202modules
1203modules_aux
1204prefs
1205
1206If the "syntaxmaps" directory is present, e93 will use the syntax map
1207definition files it contains in preference to the defaults it would
1208normally load. When this directory exists, e93 will NOT load its
1209default syntax maps. All syntax map definition files contained in this
1210subdirectory must have a name which ends in ".tcl" to be recognized.
1211
1212If the "syntaxmaps_aux" directory is present, e93 will add the syntax
1213map definitions it contains to the defaults it normally loads. All
1214syntax map definition files contained in this subdirectory must have
1215a name which ends in ".tcl" to be recognized.
1216
1217If the "highlightschemes" directory is present, e93 will use the
1218highlight schemes it contains in preference to the defaults it would
1219normally load. When this directory exists, e93 will NOT load its
1220default highlight schemes. All highlight scheme definition files
1221contained in this subdirectory must have a name which ends in ".tcl"
1222to be recognized.
1223
1224If the "highlightschemes_aux" directory is present, e93 will add the
1225highlight schemes it contains to the defaults it normally loads. All
1226highlight scheme definition files contained in this subdirectory must
1227have a name which ends in ".tcl" to be recognized.
1228
1229If the "modules" directory is present, e93 will use the modules (just
1230additional Tcl scripts, menu items, or whatever) it contains in
1231preference to the modules it would normally load. When this directory
1232exists, e93 will NOT load its default modules. All modules contained
1233in this subdirectory must have a name which ends in ".tcl" to be
1234recognized. Modules are typically used to define functions specific
1235to any given user's tasks.
1236
1237If the "modules_aux" directory is present, e93 will add the modules it
1238contains to the defaults it normally loads. All modules contained in
1239this subdirectory must have a name which ends in ".tcl" to be
1240recognized.
1241
1242Finally, if the "prefs" directory is present, e93 will execute all the
1243scripts contained within it as the last step in the initialization
1244procedure. It is at this point, that you can alter any preferences
1245that you desire before the editor opens any files.
1246

README.rants

1Here is a collection of random rants from e93's author.
2
3This may help you understand why the editor does some things and does
4not do others.
5
6If this sounds pompous to you, it is because I can be a pompous
7bastard. Please excuse me.
8
9Control key vs. Alt key
10-----------------------
11This is for all Windows users out there who might be wondering why e93
12uses the "Alt" key to select menus (like Alt-X for cut, or Alt-C for
13copy...) instead of the "Control" key which they might be used to using...
14
15Let's see. Hmmm. How to put this gently...
16
17When the Mac came out, (and introduced the world at large to windowing
18systems) it had that strange looking clover key which was used to
19select menu items. It was quickly learned by users that that key did
20one and only one thing -- it accessed menu items from the keyboard.
21
22The Mac also had a Control key. That key did what all Control keys are
23supposed to do -- It allowed users to enter control codes which could
24be used to Control TTY style devices -- you remember those things??
25Guess what. Those things still exist, and although admittedly they are
26less important today than they used to be, the Control key is still
27needed.
28
29Anyway, if I ever had to write a Telnet client or terminal program for
30Windows, I would probably get fairly angry when I realized that I
31needed to give my users the ability to copy text (which is Control-C
32in Windows) AND the ability to send an ETX character to a process
33(which is Control-C in the rest of the world). If I used Control to
34send control codes (the original purpose for the Control key), it
35means that my users would not be able to access menus in the way that
36they were accustomed to. If I used the Control for menu shortcuts,
37users would have a difficult time using my program for its intended
38purpose (try using Telnet without a Control key).
39
40I don't know why the "engineers" at M$ chose the Control key over the
41Alt key when they were copying the Mac, but it is clear that they did
42not consider the consequences too carefully.
43
44Since I (thankfully) spend most of my time working in Unix, I think
45I'll use the Control key for its traditional purpose -- entering
46control codes.
47
48BTW: the above applies only to the Unix/X version of e93. For the
49Windows version (which fortunately I do not work on), it is clear that
50Control needs to be used for menu keys, since trying to use Alt when
51every other application uses Control (except maybe the terminal
52program ;-) would annoy people more than an inability to enter control
53codes into their documents.
54
55Oh, and if this rant gave you the impression that I am in love with
56the way X handles user interface, let me correct you now: X is my
57*least* favorite windowing system. It addresses almost no user
58interface issues, and in the process, causes every application running
59under it to be different. I tolerate X because it is the only GUI
60environment which runs on top of Unix, and is open source.
61(If there is another, I would appreciate someone letting me know.)
62
63
64Copy/Paste -- X style vs. Mac style
65-----------------------------------
66What could be more convenient? Just select some text with the left
67mouse button, and then paste it by pressing the middle button. Your
68hand would never have to leave the mouse. Sounds better than having to
69select the text with the mouse, then go to a menu, or hit a key
70combination to copy it, then do the same thing to paste -- right?
71
72Perhaps. But in practice I find the X selection mechanism annoyingly
73cumbersome.
74
75First, it is far too easy to hit the middle mouse button by accident,
76and paste unwanted text into whatever you happen to be working on. How
77many people reading this have ever pasted a bunch of garbage into an
78xterm, and ended up creating random files, or worse yet, deleting or
79over-writing important ones??
80
81Second, the copy-on-select mentality means that if I want to select a
82bunch of text to delete it, I end up putting it into the clipboard,
83writing over what I really wanted there. A good example of this is
84trying to copy a URL from some document into the address entry window
85of a browser -- Invariably I select the text of my document containing
86the URL, bring the browser window forward, notice that the address
87entry field is occupied by the last address I was looking at, select
88that address to get rid of it, hit delete, then try to paste... Oops.
89Damn. Now I go back to the original document and get the address
90again... Grrrr.
91
92Finally, having one selection for the entire windowing system means
93that I cannot leave text selected in one window or application, move
94to another to do something, then come back to the first without having
95my selections wiped out.
96
97
98Bracketing style
99----------------
100I do not really have a rant here, except that
101
102    if(blah)
103    {
104        printf("blah\n");
105    }
106    else
107    {
108        printf("no blah\n");
109    }
110
111is MUCH easier for me to follow than the K&R style.
112
113    if(blah) {
114        printf("blah\n");
115    }
116    else {
117        printf("no blah\n");
118    }
119
120If you submit code to be added to e93, do me a favor, and put it in
121the style I like :-) It will save me the time of doing the conversion
122myself, and make it more likely that I will take your code.
123
124
125Tabs vs. Spaces
126---------------
127This one is a bit more sticky. Lots of people like to use only spaces
128in their text documents. The argument is that spaces are always
129spaces, and the text will always look the same to anyone who reads it.
130If tabs are used, the argument is that different tools expand tabs
131differently, and therefore, documents with tabs in them may not always
132look as expected.
133
134I understand this argument.
135
136However, spaces are not as convenient as tabs when editing code.
137
138If you are editing code, it is nice to have the various indentation
139levels of the code represented as tabs. Tabs make it convenient to
140move over to the next indent level, or back up to the previous one.
141
142Many editors attempt to solve this tab/space issue by trying to guess
143what the user intends. When the tab key is hit, these editors add the
144correct number of spaces to the document to take the cursor to the
145next tab stop. When the user hits a backspace, the editor must guess
146that the intention was to back up over the "tab" and get rid of the
147correct number of spaces. The problem is that the editor cannot really
148know if what it is backing up over was typed as a tab, or was typed as
149spaces. Therefore, it can guess wrong, which I find confusing/bad.
150
151The best solution in my opinion is to have the editor do what the
152user asked it to do with a minimum of guessing. This means that if the
153user types a tab, he gets a tab. If the user hits backspace, he gets a
154backspace. To me, this is the most convenient way to edit code.
155
156If I need to export code to others who might be using tools which
157are different than mine, and I want them to be able to see the code
158as I intended it to look, I will convert tabs to spaces as a separate
159step. See expand(1), unexpand(1).
160
161
162Magic
163-----
164Some editors try to do things for their users by guessing what they
165would find useful, then doing those things without being asked.
166Here are some examples:
167
168Changing line termination into the default for the current platform.
169For example, some Unix editors might read a file which contained CRLF line
170termination, and convert it to LF-only line termination without asking.
171
172Adding a linefeed to the last line of a document.
173For example, some editors may discover that the last line of a document
174is lacking a line feed character, and automatically add one in.
175
176Deletion of extraneous control characters.
177
178Deletion of excess whitespace at the ends of lines.
179
180Conversion of tabs to spaces, or spaces to tabs.
181
182etc...
183
184e93 can be made to do any of these. But by default, it will never do
185*anything* to the text of a document without being explicitly
186commanded to do so. This guarantees that you can load any document
187into e93, make changes, save it, and know that the only differences are
188the changes *you* made.
189As a programmer's tool, I find this to be an important ability.
190
191If you want the editor to do these things automatically for you, e93
192is scriptable in Tcl. As a programmer, hopefully you will find such
193scripts easy to create.
194

README.regex

1This material is derived from The GNU Emacs Manual, 9th edition.
2Copyright 1985, 1986, 1987, 1993 Free Software Foundation, Inc.
3and from the GNU regex library version 0.11.
4Copyright 1992 Free Software Foundation, Inc.
5
6The Free Software Foundation gives permission for the use of this
7material in e93, with different distribution terms from those stated
8in the Emacs manual, because e93 is free software, and thus worthy
9of cooperation.
10
11
12NOTE: this has been modified to reflect e93's syntax.
131/22/00 TMS (squirest@e93.org)
14
15Regular Expression Syntax
16
17Common Operators
18
19* Match-self Operator::                 Ordinary characters.
20* Match-any-character Operator::        .
21* Concatenation Operator::              Juxtaposition.
22* Repetition Operators::                *  +  ? {}
23* Alternation Operator::                |
24* List Operators::                      [...]  [^...]
25* Grouping Operators::                  (...)
26* Back-reference Operator::             \digit
27* Anchoring Operators::                 ^  $  <  >
28
29Repetition Operators
30
31* Match-zero-or-more Operator::  *
32* Match-one-or-more Operator::   +
33* Match-zero-or-one Operator::   ?
34* Interval Operators::           {}
35
36List Operators (`[' ... `]' and `[^' ... `]')
37
38* Range Operator::          start-end
39
40Anchoring Operators
41
42* Match-beginning-of-word Operator::  <
43* Match-end-of-word Operator::        >
44* Match-beginning-of-line Operator::  ^
45* Match-end-of-line Operator::        $
46
47
48Overview
49********
50
51  A "regular expression" (or "regexp", or "pattern") is a text string
52that describes some (mathematical) set of strings.  A regexp R
53"matches" a string S if S is in the set of strings described by R.
54
55  Some regular expressions match only one string, i.e., the set they
56describe has only one member.  For example, the regular expression
57`foo' matches the string `foo' and no others.  Other regular
58expressions match more than one string, i.e., the set they describe has
59more than one member.  For example, the regular expression `f*' matches
60the set of strings made up of any number (including zero) of `f's.  As
61you can see, some characters in regular expressions match themselves
62(such as `f') and some don't (such as `*'); the ones that don't match
63themselves instead let you specify patterns that describe many
64different strings.
65
66Regular Expression Syntax
67*************************
68
69  "Characters" are things you can type.  "Operators" are things in a
70regular expression that match one or more characters.  You compose
71regular expressions from operators, which in turn you specify using one
72or more characters.
73
74  Most characters represent what we call the match-self operator, i.e.,
75they match themselves; we call these characters "ordinary".  Other
76characters represent either all or parts of fancier operators; e.g.,
77`.' represents what we call the match-any-character operator (which, no
78surprise, matches any character); we call these characters
79"special".
80
81  In the following sections, we describe these things in more detail.
82
83The Backslash Character
84=======================
85
86  The `\' character quotes (makes ordinary, if it's special,
87  or possibly special if it's ordinary) the next character.
88
89	'\' sequences:
90
91	\n			-- stands for new line (0x0A).
92	\b			-- stands for backspace (0x08).
93	\r			-- stands for return (0x0D).
94	\t			-- stands for tab (0x09).
95	\x##		-- allows specification of arbitrary characters in hex
96				   for example \x0A is equivalent to \n.
97	\0 to \9	-- backreference to register (not valid within [])
98
99
100Common Operators
101****************
102
103  You compose regular expressions from operators.  In the following
104sections, we describe the regular expression operators.
105
106
107* Match-self Operator::                 Ordinary characters.
108* Match-any-character Operator::        .
109* Concatenation Operator::              Juxtaposition.
110* Repetition Operators::                *  +  ? {}
111* Alternation Operator::                |
112* List Operators::                      [...]  [^...]
113* Grouping Operators::                  (...)
114* Back-reference Operator::             \digit
115* Anchoring Operators::                 ^  $  <  >
116
117
118The Match-self Operator (ORDINARY CHARACTER)
119============================================
120
121  This operator matches the character itself.  All ordinary characters
122represent this operator.  For example, `f' is always an ordinary character,
123so the regular expression `f' matches only the string `f'.
124In particular, it does *not* match the string `ff'.
125
126
127The Match-any-character Operator (`.')
128======================================
129
130  This operator matches any single printing or nonprinting character except
131  newline (it is equivalent to `[^\n]').
132
133  NOTE: if you wish to match absolutely anything, use `[-]', or `[^]'.
134
135  The `.' (period) character represents this operator.  For example,
136`a.b' matches any three-character string beginning with `a' and ending
137with `b'.
138
139The Concatenation Operator
140==========================
141
142  This operator concatenates two regular expressions A and B. No
143character represents this operator; you simply put B after A.  The
144result is a regular expression that will match a string if A matches
145its first part and B matches the rest.  For example, `xy' (two
146match-self operators) matches `xy'.
147
148Repetition Operators
149====================
150
151  Repetition operators repeat the preceding regular expression a
152specified number of times.
153
154* Match-zero-or-more Operator::  *
155* Match-one-or-more Operator::   +
156* Match-zero-or-one Operator::   ?
157* Interval Operators::           {}
158
159The Match-zero-or-more Operator (`*')
160-------------------------------------
161
162  This operator repeats the smallest possible preceding regular
163expression as many times as necessary (including zero) to match the
164pattern. `*' represents this operator.  For example, `o*' matches any
165string made up of zero or more `o's.  Since this operator operates on
166the smallest preceding regular expression, `fo*' has a repeating `o',
167not a repeating `fo'.  So, `fo*' matches `f', `fo', `foo', and so on.
168
169  Since the match-zero-or-more operator is a suffix operator, it may
170not be applied when no regular expression precedes it.  This is the
171case when it:
172
173   * is first in a regular expression, or
174
175   * follows a match-beginning-of-line, match-end-of-line, open-group,
176     or alternation operator.
177
178  The matcher processes a match-zero-or-more operator by first matching
179as many repetitions of the smallest preceding regular expression as it
180can. Then it continues to match the rest of the pattern.
181
182  If it can't match the rest of the pattern, it backtracks (as many
183times as necessary), each time discarding one of the matches until it
184can either match the entire pattern or be certain that it cannot get a
185match.  For example, when matching `ca*ar' against `caaar', the matcher
186first matches all three `a's of the string with the `a*' of the regular
187expression.  However, it cannot then match the final `ar' of the
188regular expression against the final `r' of the string.  So it
189backtracks, discarding the match of the last `a' in the string.  It can
190then match the remaining `ar'.
191
192The Match-one-or-more Operator (`+')
193------------------------------------
194
195  This operator is similar to the match-zero-or-more operator except
196that it repeats the preceding regular expression at least once; *note
197Match-zero-or-more Operator::., for what it operates on, and how Regex
198backtracks to match it.
199
200  For example, supposing that `+' represents the match-one-or-more
201operator; then `ca+r' matches, e.g., `car' and `caaaar', but not `cr'.
202
203The Match-zero-or-one Operator (`?')
204------------------------------------
205
206  This operator is similar to the match-zero-or-more operator except
207that it repeats the preceding regular expression once or not at all;
208*note Match-zero-or-more Operator::., to see what it operates on, and
209how Regex backtracks to match it.
210
211  For example, supposing that `?' represents the match-zero-or-one
212operator; then `ca?r' matches both `car' and `cr', but nothing else.
213
214Interval Operators (`{' ... `}')
215----------------------------------
216
217Supposing that `{' and `}' represent the open-interval
218and close-interval operators; then:
219
220`{COUNT}'
221     matches exactly COUNT occurrences of the preceding regular
222     expression.
223
224`{MIN,}'
225     matches MIN or more occurrences of the preceding regular
226     expression.
227
228`{MIN, MAX}'
229     matches at least MIN but no more than MAX occurrences of the
230     preceding regular expression.
231
232  The interval expression (but not necessarily the regular expression
233that contains it) is invalid if:
234
235   * MIN is greater than MAX
236
237The Alternation Operator (`|')
238==============================
239
240  Alternatives match one of a choice of regular expressions: if you put
241the character(s) representing the alternation operator between any two
242regular expressions A and B, the result matches the union of the
243strings that A and B match.  For example, supposing that `|' is the
244alternation operator, then `foo|bar|quux' would match any of `foo',
245`bar' or `quux'.
246
247  The alternation operator operates on the *largest* possible
248surrounding regular expressions.  (Put another way, it has the lowest
249precedence of any regular expression operator.) Thus, the only way you
250can delimit its arguments is to use grouping.  For example, if `(' and
251`)' are the open and close-group operators, then `fo(o|b)ar' would
252match either `fooar' or `fobar'.  (`foo|bar' would match `foo' or
253`bar'.)
254
255  The matcher tries each combination of alternatives in order until it
256is able to make a match.
257
258List Operators (`[' ... `]' and `[^' ... `]')
259=============================================
260
261  "Lists", also called "bracket expressions", are a set of zero or more
262items.  An "item" is a character, or a range expression.
263
264  A "matching list" matches a single character represented by one of
265the list items.  You form a matching list by enclosing one or more items
266within an "open-matching-list operator" (represented by `[') and a
267"close-list operator" (represented by `]').
268
269  For example, `[ab]' matches either `a' or `b'. `[ad]*' matches the
270empty string and any string composed of just `a's and `d's in any
271order.  Regex considers invalid a regular expression with a `[' but no
272matching `]'.
273
274  "Nonmatching lists" are similar to matching lists except that they
275match a single character *not* represented by one of the list items.
276You use an "open-nonmatching-list operator" (represented by `[^')
277instead of an open-matching-list operator to start a nonmatching list.
278
279  For example, `[^ab]' matches any character except `a' or `b'.
280
281  Most characters lose any special meaning inside a list.  The special
282characters inside a list follow.
283
284`]'
285     ends the list unless quoted by '\'.
286
287`\'
288     quotes the next character.
289
290`-'
291     represents the range operator unless quoted by '\'.
292
293All other characters are ordinary.  For example, `[.*]' matches `.' and
294`*'.
295
296The Range Operator (`-')
297------------------------
298
299  Regex recognizes "range expressions" inside a list. They represent
300those characters that fall between two elements in the current
301collating sequence.  You form a range expression by putting a "range
302operator" between two characters. `-' represents the range operator.
303 For example, `a-f' within a list represents all the characters from `a'
304through `f' inclusively.
305
306  Since `-' represents the range operator, if you want to make a `-'
307character itself a list item, you must quote it with '\'.
308
309  Ranges do not need a start and end, if the start is omitted
310for example, `[-a]' matches all characters through lowercase 'a';
311if the end is omitted: '[a-]' matches lowercase 'a' through 0xFF;
312[-] matches all characters.
313
314Grouping Operators (`(' ... `)')
315=================================================
316
317  A "group", also known as a "subexpression", consists of an
318"open-group operator", any number of other operators, and a
319"close-group operator".  Regex treats this sequence as a unit, just as
320mathematics and programming languages treat a parenthesized expression
321as a unit. Groups can be empty.
322
323  Therefore, using "groups", you can:
324
325   * delimit the argument(s) to an alternation operator (*note
326     Alternation Operator::.) or a repetition operator (*note
327     Repetition Operators::.).
328
329   * keep track of the indices of the substring that matched a given
330     group. *Note Using Registers::, for a precise explanation. This
331     lets you:
332
333        * use the back-reference operator (*note Back-reference
334          Operator::.).
335
336        * use registers (*note Using Registers::.).
337
338The Back-reference Operator ("\"DIGIT)
339======================================
340
341A back reference matches a specified preceding group.
342The back reference operator is represented by `\DIGIT' anywhere after
343the end of a regular expression's DIGIT-th group (*note Grouping
344Operators::.).
345
346  DIGIT must be between `0' and `9'.  The matcher assigns numbers 0
347through 9 to the first ten groups it encounters.  By using one of `\0'
348through `\9' after the corresponding group's close-group operator, you
349can match a substring identical to the one that the group does.
350
351  Back references match according to the following (in all examples
352below, `(' represents the open-group, `)' the close-group, `{' the
353open-interval and `}' the close-interval operator):
354
355   * If the group matches a substring, the back reference matches an
356     identical substring.  For example, `(a)\0' matches `aa' and
357     `(bana)na\0bo\0' matches `bananabanabobana'.  Likewise, `(.*)\0'
358     matches any string that is composed of two identical halves; the `(.*)'
359     matches the first half and the `\0' matches the second half.
360
361   * If the group matches more than once (as it might if followed by,
362     e.g., a repetition operator), then the back reference matches the
363     substring the group *last* matched.  For example, `((a*)b)*\0\1'
364     matches `aabababa'; first group 0 (the outer one) matches `aab'
365     and group 1 (the inner one) matches `aa'.  Then group 0 matches
366     `ab' and group 1 matches `a'.  So, `\0' matches `ab' and `\1'
367     matches `a'.
368
369   * If the group doesn't participate in a match, i.e., it is part of an
370     alternative not taken or a repetition operator allows zero
371     repetitions of it, then the back reference makes the whole match
372     fail.
373
374  You can use a back reference as an argument to a repetition operator.
375 For example, `(a(b))\1*' matches `a' followed by one or more `b's.
376Similarly, `(a(b))\1{3}' matches `abbbb'.
377
378  If there is no preceding DIGIT-th subexpression, the regular
379expression is invalid.
380
381Anchoring Operators
382===================
383
384  These operators can appear anywhere (except lists) within a pattern
385and force that point in the pattern to match only at the beginning or end of a word or line.
386
387* Match-beginning-of-word Operator::  <
388* Match-end-of-word Operator::        >
389* Match-beginning-of-line Operator::  ^
390* Match-end-of-line Operator::        $
391
392
393The Match-beginning-of-word Operator (`<')
394------------------------------------------
395
396  This operator can match the empty string either at the beginning of
397the text or the beginning of a word. Thus, it is said to "anchor" the
398pattern to the beginning of a word.
399
400The Match-end-of-word Operator (`>')
401------------------------------------
402
403  This operator can match the empty string either at the end of the text
404or the end of a word. Thus, it is said to "anchor" the pattern to the
405end of a word.
406
407The Match-beginning-of-line Operator (`^')
408------------------------------------------
409
410  This operator can match the empty string either at the beginning of
411the text or after a newline character.  Thus, it is said to "anchor"
412the pattern to the beginning of a line.
413
414The Match-end-of-line Operator (`$')
415------------------------------------
416
417  This operator can match the empty string either at the end of the
418text or before a newline character in the text.  Thus, it is said
419to "anchor" the pattern to the end of a line.
420

README.syntaxmaps

1VERY PRELIMINARY DOCUMENTATION ON SYNTAX MAPS
2
3NOTE: while reading this, it will be very helpful to be looking
4at an addsyntaxmap command from the e93rc.tcl file....
5
6The addsyntaxmap command in Tcl creates a new syntax map.
7
8A syntax map is the data structure which gives e93 all the information
9it needs to search through a document, and apply styles to the text
10which the map specifies.
11
12The first argument of the addsyntaxmap command is the name of the map,
13and the second argument is the mapping data itself.
14
15Syntax maps are assigned to e93 windows with the command:
16setsyntaxmap bufferName syntaxMapName
17
18The mapping data is composed of keyword, parameter pairs. The only
19valid keywords are:
20
21exp
22map
23at
24root
25
26"exp" defines a regular expression in the map. You can define as many
27as you want but the more you have, the slower the highlighting. The 2
28parameters to exp are simply its name, and the expression being
29defined. The expressions are matched using e93's regular expression
30matching routines (The same ones which are used when you specify a
31regular expression in the "Find" dialog.)
32
33"map" describes how expressions are mapped to styles. There are 6
34parameters to the map command.
35
36The first is the name of the map. This will be important later. The
37second parameter is the name of the expression which introduces a
38given mapping -- it is called the start expression.
39
40The third parameter is a (potentially empty) list of names of ending
41expressions.
42
43The remaining 3 parameters are the start-style, the between-style, and
44the end-style. Styles are nothing more than integers which index
45styles assigned to text. You can assign styles to the text by using
46e93's commands:
47
48setcolors windowName foregroundColor backgroundColor ?styleNum?
49setfont windowName fontName ?styleNum?
50
51maps work like this:
52If e93 encounters text which matches the starting expression, it is
53colored in start-style. If the list of ending expressions is
54non-empty, then e93 searches for text which matches any of the ending
55expressions. The text between the start and ending expression is
56colored in the between-style. Finally, the text of the matching ending
57expression is colored in the end-style. If the ending expression list
58is empty, then e93 ends the mapping immediately after the text which
59matches the start expression.
60
61The "at" keyword is used to tell e93 which mappings to search for, and
62when. "at" works like this: The first parameter is the name of the
63mapping during which this "at" takes place -- the "parent map". The
64next parameter is a list of mappings which are allowed to start within
65the "parent map".
66
67During the text between the starting and ending expressions of a given
68mapping, e93 will search for the starting expressions of any mapping
69which is specified by an "at" command for the given mapping.
70
71The "root" keyword is just a special case of "at". It tells which
72mappings are in effect when no other mapping is in effect.
73
74As an example, consider rules to color 'C' strings. To color them, you
75need to locate the start quote, and the end quote. But, while looking
76at the string, you may encounter a '\' character which tells 'C' to
77treat the next character specially. So.... The mapping would look like
78this:
79
80addsyntaxmap "C Strings" \
81{
82        exp {e_string_delimiter         "\""}	<<< expression which matches a double quote character
83        exp {e_quoted_char              "\\\\\[-\]"}    <<< expression which matches a \ followed by ANYTHING
84
85        map {m_string                   e_string_delimiter	{e_string_delimiter}	$style_delimiter	$style_string	$style_delimiter}
86        map {m_string_quoted_char       e_quoted_char		{}						$style_char			0				0}
87
88        at {m_string                    {m_string_quoted_char}} <<< within strings, look for \'s
89
90        root {m_string}					<<< look for strings at the root level
91}
92
93NOTE: in the above example, \'s need to be quoted multiple times to
94hide them from Tcl.
95
96So, if you are not thoroughly confused, you are ready to write
97syntax highlighting rules. :-)
98
99There is one more tiny little detail that is very useful, but
100was difficult to explain in the midst of the discussion above.
101
102When specifying a "map", the start and end expressions are allowed to
103take the form:
104
105e_expressionName:#
106
107where # is a number from 0-9. This number corresponds to the tagged part
108of the regular expression given by e_expressionName.
109For instance, if I had an expression, say...
110        exp {e_sample_expression		"([a-z]+)([0-9]+)"}
111
112I could have a mapping:
113
114        map {m_sample_mapping	e_sample_expression:0		{}		$style_blah	0	0}
115
116This means that the entire expression e_sample_expression needs to be
117matched to start the mapping, but that the part which is used as the
118start-expression is simply the [a-z]+ (tag 0)
119
120