Home | History | Annotate | Line # | Download | only in dist
README revision 1.1.1.1.2.1
      1  1.1.1.1.2.1  snj       Xedit is a simple text editor for X.
      2  1.1.1.1.2.1  snj 
      3  1.1.1.1.2.1  snj       Please check xedit(1) for  information about resources  and configurable
      4  1.1.1.1.2.1  snj   options.
      5  1.1.1.1.2.1  snj 
      6  1.1.1.1.2.1  snj       The authors  file should  list the  original authors  of all  files, but
      7  1.1.1.1.2.1  snj   unfortunately most  collaborators and  people that  changed portions  of the
      8  1.1.1.1.2.1  snj   code is not listed.
      9  1.1.1.1.2.1  snj 
     10  1.1.1.1.2.1  snj 
     11  1.1.1.1.2.1  snj       List of default keyboard commands.
     12  1.1.1.1.2.1  snj   Uppercase letters means both, uppercase and lowercase.
     13  1.1.1.1.2.1  snj   Lowercase letter usually means Shift key is not pressed.
     14  1.1.1.1.2.1  snj   C-    Means Control key.
     15  1.1.1.1.2.1  snj   M-    Means Meta key.
     16  1.1.1.1.2.1  snj         Usually Alt key has the same effect.
     17  1.1.1.1.2.1  snj   S-    Means Shift key.
     18  1.1.1.1.2.1  snj 
     19  1.1.1.1.2.1  snj   C-A   Move cursor to beginning of line.
     20  1.1.1.1.2.1  snj   C-B or Left
     21  1.1.1.1.2.1  snj         Move cursor backwards one character.
     22  1.1.1.1.2.1  snj   C-C   Insert CUT_BUFFER0 selection at cursor position.
     23  1.1.1.1.2.1  snj   C-D   Delete next character.
     24  1.1.1.1.2.1  snj   C-E   Move cursor to end of line.
     25  1.1.1.1.2.1  snj   C-F or Right
     26  1.1.1.1.2.1  snj         Move cursor forwards one character.
     27  1.1.1.1.2.1  snj   C-G   Keyboard reset.
     28  1.1.1.1.2.1  snj         Use it to switch direction in the Undo stack, i.e. switch between
     29  1.1.1.1.2.1  snj         Undo and Redo.
     30  1.1.1.1.2.1  snj         It can also be used to stop the lisp interpreter if it is executing
     31  1.1.1.1.2.1  snj         code.
     32  1.1.1.1.2.1  snj   C-H   Deletes character before cursor.
     33  1.1.1.1.2.1  snj   C-J   Adds a newline and indent.
     34  1.1.1.1.2.1  snj         If the current buffer is the *scratch* buffer, it will work
     35  1.1.1.1.2.1  snj         like C-X,C-E, but print the lisp output directly to the scratch
     36  1.1.1.1.2.1  snj         buffer. Examples:
     37  1.1.1.1.2.1  snj         (list 1 2 3) C-J will print (1 2 3) and move the cursor to
     38  1.1.1.1.2.1  snj         the next line.
     39  1.1.1.1.2.1  snj   C-K   Deletes text from cursor position to end of line.
     40  1.1.1.1.2.1  snj   C-L   Redraw text window.
     41  1.1.1.1.2.1  snj   C-M   Adds a newline.
     42  1.1.1.1.2.1  snj   C-N or Down
     43  1.1.1.1.2.1  snj         Move cursor to next line.
     44  1.1.1.1.2.1  snj   C-O   Adds one newline at cursor position without moving cursor.
     45  1.1.1.1.2.1  snj   C-P or Up
     46  1.1.1.1.2.1  snj         Move cursor to previous line.
     47  1.1.1.1.2.1  snj   C-R   Opens search dialog, searching backwards.
     48  1.1.1.1.2.1  snj   C-S   Opens search dialog, searching forwards.
     49  1.1.1.1.2.1  snj   C-T   Transpose characters.
     50  1.1.1.1.2.1  snj   C-U   Starts multiply mode.
     51  1.1.1.1.2.1  snj         Multiply mode means that most keyboard commands will be repeated
     52  1.1.1.1.2.1  snj         by its parameter. After pressing C-U type a number, that can be
     53  1.1.1.1.2.1  snj         negative. Examples:
     54  1.1.1.1.2.1  snj         C-U 10 C-F  will move the cursor 10 characters forwards
     55  1.1.1.1.2.1  snj         C-U -10 C-F will move the cursor 10 characters backwards
     56  1.1.1.1.2.1  snj         If no number is specified, or if the number zero is specified,
     57  1.1.1.1.2.1  snj         the default value is 4.
     58  1.1.1.1.2.1  snj   C-V or PageDown
     59  1.1.1.1.2.1  snj         Move cursor to next page.
     60  1.1.1.1.2.1  snj   C-W   Kills current selection.
     61  1.1.1.1.2.1  snj         C-W is also useful when there is no active selection, to return to
     62  1.1.1.1.2.1  snj         the previous position the left mouse was clicked in the text window.
     63  1.1.1.1.2.1  snj   C-Y   Inserts SECONDARY selection.
     64  1.1.1.1.2.1  snj         This usually means text delete with commands other than by just
     65  1.1.1.1.2.1  snj         pressing Backspace or Delete (that can be multiplied)
     66  1.1.1.1.2.1  snj   C-Z   Scroll one line up.
     67  1.1.1.1.2.1  snj   M-B or C-Left
     68  1.1.1.1.2.1  snj         Move cursor backwards one word.
     69  1.1.1.1.2.1  snj         C-Left only moves over alphabetic or numeric characters
     70  1.1.1.1.2.1  snj   M-C   Capitalize word under cursor position, or next word.
     71  1.1.1.1.2.1  snj   M-F or C-Right
     72  1.1.1.1.2.1  snj         Move cursor forwards one word.
     73  1.1.1.1.2.1  snj         C-Right only moves over alphabetic or numeric characters.
     74  1.1.1.1.2.1  snj   M-I   Opens  a dialog prompting for a file name to be inserted at the
     75  1.1.1.1.2.1  snj         cursor position.
     76  1.1.1.1.2.1  snj         (This isn't very user friendly, this is a cavemen interface, you will
     77  1.1.1.1.2.1  snj         love it, you will never use it).
     78  1.1.1.1.2.1  snj   M-K   Kills text from cursor position to end of paragraph.
     79  1.1.1.1.2.1  snj   M-L   Downcase word at cursor position or next word.
     80  1.1.1.1.2.1  snj   M-Q   Format paragraph.
     81  1.1.1.1.2.1  snj         Xedit interfaces Xaw code that allows several types of text
     82  1.1.1.1.2.1  snj         formatting. To use it, you need to Select "Auto Fill" in the
     83  1.1.1.1.2.1  snj         "Edit Menu" and select values for "Break Columns". After that,
     84  1.1.1.1.2.1  snj         Select "Edit Menu"->"Justification" for the available options.
     85  1.1.1.1.2.1  snj         Text typed will usually be automatically corrected, but if you
     86  1.1.1.1.2.1  snj         need to change text in the middle of a previous line, use M-Q
     87  1.1.1.1.2.1  snj         to reformat, and C-_ to undo if required.
     88  1.1.1.1.2.1  snj         Examples of text:
     89  1.1.1.1.2.1  snj 
     90  1.1.1.1.2.1  snj                     This text with align
     91  1.1.1.1.2.1  snj                     left and break
     92  1.1.1.1.2.1  snj                     columns at 20 and
     93  1.1.1.1.2.1  snj                     40.
     94  1.1.1.1.2.1  snj 
     95  1.1.1.1.2.1  snj                          This text with align
     96  1.1.1.1.2.1  snj                               right and break
     97  1.1.1.1.2.1  snj                             columns at 25 and
     98  1.1.1.1.2.1  snj                             45. Remember that
     99  1.1.1.1.2.1  snj                             Auto Fill must be
    100  1.1.1.1.2.1  snj                          selected. And it may
    101  1.1.1.1.2.1  snj                          be required to press
    102  1.1.1.1.2.1  snj                           M-Q when going back
    103  1.1.1.1.2.1  snj                              to edit previous
    104  1.1.1.1.2.1  snj                                        lines.
    105  1.1.1.1.2.1  snj 
    106  1.1.1.1.2.1  snj                                          This text with align center
    107  1.1.1.1.2.1  snj                                          and break columns at 40 and
    108  1.1.1.1.2.1  snj                                         70. A good tip is to make sure
    109  1.1.1.1.2.1  snj                                          there are empty lines before
    110  1.1.1.1.2.1  snj                                         and after the aligned text, so
    111  1.1.1.1.2.1  snj                                         that M-Q will not format more
    112  1.1.1.1.2.1  snj                                              text than it should.
    113  1.1.1.1.2.1  snj 
    114  1.1.1.1.2.1  snj                  This text  with full  align,
    115  1.1.1.1.2.1  snj                note that  it will  spread the
    116  1.1.1.1.2.1  snj                words  to   fully   fill   the
    117  1.1.1.1.2.1  snj                configured break  columns,  in
    118  1.1.1.1.2.1  snj                this case 15 and 45. Also note
    119  1.1.1.1.2.1  snj                that  it  doesn't  remove  any
    120  1.1.1.1.2.1  snj                extra  indentation   from  the
    121  1.1.1.1.2.1  snj                first  line.   This   may   be
    122  1.1.1.1.2.1  snj                considered a  bug or  feature,
    123  1.1.1.1.2.1  snj                but  it   doesn't  respect   2
    124  1.1.1.1.2.1  snj                spaces after  an '.'  dot. And
    125  1.1.1.1.2.1  snj                it doesn't align the last line
    126  1.1.1.1.2.1  snj                of text.
    127  1.1.1.1.2.1  snj 
    128  1.1.1.1.2.1  snj   This text with Auto Fill disabled. When Auto  Fill is disabled, tabs are
    129  1.1.1.1.2.1  snj usually preserved, like this,		and			this. But it
    130  1.1.1.1.2.1  snj will basically format the text to not be larger than the text widget screen
    131  1.1.1.1.2.1  snj width and. But it the screen is scrolled horizontally, it will not work as
    132  1.1.1.1.2.1  snj expected, the advantage over the above interface is that is considers font
    133  1.1.1.1.2.1  snj characters width, while the other interface assumes fixed width characters.
    134  1.1.1.1.2.1  snj 
    135  1.1.1.1.2.1  snj         Notice that "auto formatting" with Auto Fill mode is done when
    136  1.1.1.1.2.1  snj         pressing enter, but information isn't saved per paragraph, so
    137  1.1.1.1.2.1  snj         if values of align or break columns are changed, trying to edit
    138  1.1.1.1.2.1  snj         a text block with different configuration will not give the expected
    139  1.1.1.1.2.1  snj         results.
    140  1.1.1.1.2.1  snj         Also notice that lines starting with non printable characters aren't
    141  1.1.1.1.2.1  snj         automatically formatted. This is helpful for some editing modes
    142  1.1.1.1.2.1  snj         where symbols can be used before lines in a paragraph. If you don't
    143  1.1.1.1.2.1  snj         need this feature, usually pressing Space or Tab is enough to put the
    144  1.1.1.1.2.1  snj         cursor at the proper position.
    145  1.1.1.1.2.1  snj   M-U   Upcase word at cursor position or next word.
    146  1.1.1.1.2.1  snj   M-V or PageUp
    147  1.1.1.1.2.1  snj         Move cursor to previous page.
    148  1.1.1.1.2.1  snj   M-Y   Kill ring yank feature. Basically it will circulate over all
    149  1.1.1.1.2.1  snj         text that has been cut in the current session. Keep pressing it
    150  1.1.1.1.2.1  snj         until happy :-)
    151  1.1.1.1.2.1  snj   M-Z   Scrolls one line down.
    152  1.1.1.1.2.1  snj   M-D   Kill word at cursor position or next word.
    153  1.1.1.1.2.1  snj   S-M-D Delete word at cursor position or next word.
    154  1.1.1.1.2.1  snj         Does not go to the kill ring.
    155  1.1.1.1.2.1  snj   M-H or M-Delete or M-Backspace.
    156  1.1.1.1.2.1  snj         Kill word at cursor position or previous word.
    157  1.1.1.1.2.1  snj   S-M-H or S-M-Delete or S-M-Backspace
    158  1.1.1.1.2.1  snj         Delete word at cursor position or previous word.
    159  1.1.1.1.2.1  snj         Does not go to the kill ring.
    160  1.1.1.1.2.1  snj   M-.   Find definition/declaration of symbol string of selected text, and/or
    161  1.1.1.1.2.1  snj         finds next tag when more than one definition exists for the symbol.
    162  1.1.1.1.2.1  snj   M-< or Home
    163  1.1.1.1.2.1  snj         Move cursor to beginning of file.
    164  1.1.1.1.2.1  snj   M-> or End
    165  1.1.1.1.2.1  snj         Move cursor to end of file.
    166  1.1.1.1.2.1  snj   M-] or C-Down
    167  1.1.1.1.2.1  snj         Move cursor to next paragraph.
    168  1.1.1.1.2.1  snj   M-[ or C-Up
    169  1.1.1.1.2.1  snj         Move cursor to previous paragraph.
    170  1.1.1.1.2.1  snj   C-_ or C-X,U
    171  1.1.1.1.2.1  snj         Undo.
    172  1.1.1.1.2.1  snj         If enabled in the given textwidget. Not enabled by default in the
    173  1.1.1.1.2.1  snj         message window and filename window, or any of the other text widgets
    174  1.1.1.1.2.1  snj         in the several available dialogs.
    175  1.1.1.1.2.1  snj   C-\ or C-Kanji
    176  1.1.1.1.2.1  snj         Reconnect Input Method.
    177  1.1.1.1.2.1  snj         In international mode (probably broken interface).
    178  1.1.1.1.2.1  snj   S-Insert
    179  1.1.1.1.2.1  snj         Insert PRIMARY selection from CUT_BUFFER0.
    180  1.1.1.1.2.1  snj   C-Q
    181  1.1.1.1.2.1  snj         Followed by any character, will insert the next typed character
    182  1.1.1.1.2.1  snj         useful to insert control characters. For example C-Q,C-L will
    183  1.1.1.1.2.1  snj         insert ^L at the cursor position.
    184  1.1.1.1.2.1  snj   LeftMouseButton
    185  1.1.1.1.2.1  snj         When pressed marks the start of a PRIMARY selection at CUTBUFFER0
    186  1.1.1.1.2.1  snj         When moved while pressed extends the selection.
    187  1.1.1.1.2.1  snj   MiddleMouseButton
    188  1.1.1.1.2.1  snj         When pressed, inserts the PRIMARY selection at CUTBUFFER0 at
    189  1.1.1.1.2.1  snj         the cursor position.
    190  1.1.1.1.2.1  snj   RightMouseButton
    191  1.1.1.1.2.1  snj         Can be used to adjust a selection done with LeftMouseButton.
    192  1.1.1.1.2.1  snj   C-A,Tab
    193  1.1.1.1.2.1  snj         If the loaded file has a indentation rules file, C or Lisp, xedit
    194  1.1.1.1.2.1  snj         will reindent the line. Also, entering a fresh character on a
    195  1.1.1.1.2.1  snj         newline should be enough to move the cursor to the proper position.
    196  1.1.1.1.2.1  snj         To override it, you may need to use the C-U to multiply the action,
    197  1.1.1.1.2.1  snj         as it will only indent if only one character was added.
    198  1.1.1.1.2.1  snj   C-X,C-C or (Pressing the Quit button)
    199  1.1.1.1.2.1  snj         Exits xedit.
    200  1.1.1.1.2.1  snj         If there are unsaved files, a message will be printed asking to
    201  1.1.1.1.2.1  snj         "exit" again, or save the files.
    202  1.1.1.1.2.1  snj   C-X,C-E
    203  1.1.1.1.2.1  snj         Execute lisp expression before the cursor position.
    204  1.1.1.1.2.1  snj   C-X,C-F
    205  1.1.1.1.2.1  snj         Changes keyboard input focus to the filename text input window.
    206  1.1.1.1.2.1  snj         In this mode, pressing Tab will try to complete the filename
    207  1.1.1.1.2.1  snj         being typed.
    208  1.1.1.1.2.1  snj         When more than one match exists, pressing Tab again will display
    209  1.1.1.1.2.1  snj         the directory navigation window.
    210  1.1.1.1.2.1  snj         The initial search path usually is the basename of the file loaded
    211  1.1.1.1.2.1  snj         in the current textwindow, or currently directory from where
    212  1.1.1.1.2.1  snj         xedit was started if the *scratch* is the current "buffer".
    213  1.1.1.1.2.1  snj         The character ~ can be used as a shortcut for the home directory
    214  1.1.1.1.2.1  snj         and ~username will be replaced by the home directory of "username"
    215  1.1.1.1.2.1  snj         if it exists.
    216  1.1.1.1.2.1  snj   C-X,C-S or (Pressing the Save button)
    217  1.1.1.1.2.1  snj         Saves the file in the current text window.
    218  1.1.1.1.2.1  snj   C-X,Tab
    219  1.1.1.1.2.1  snj         Indents the current paragraph.
    220  1.1.1.1.2.1  snj         Use the C-U modifier to specify the number of spaces to insert
    221  1.1.1.1.2.1  snj         or remove if the C-U parameter is negative.
    222  1.1.1.1.2.1  snj   C-X,0
    223  1.1.1.1.2.1  snj         Deletes the current window.
    224  1.1.1.1.2.1  snj         The file being edited is not unloaded.
    225  1.1.1.1.2.1  snj   C-X,1
    226  1.1.1.1.2.1  snj         Deletes the other window.
    227  1.1.1.1.2.1  snj         The file being edited is not unloaded.
    228  1.1.1.1.2.1  snj   C-X,2
    229  1.1.1.1.2.1  snj         Splits vertically the current window.
    230  1.1.1.1.2.1  snj   C-X,3
    231  1.1.1.1.2.1  snj         Splits vertically the current window.
    232  1.1.1.1.2.1  snj   C-X,b
    233  1.1.1.1.2.1  snj         Switch the contents of the current window to the next file in
    234  1.1.1.1.2.1  snj         the list of loaded files.
    235  1.1.1.1.2.1  snj   C-X,d
    236  1.1.1.1.2.1  snj         Displays the directory listing window.
    237  1.1.1.1.2.1  snj         In this window, it is possible to navigate in the file system
    238  1.1.1.1.2.1  snj         to choose a file to edit.
    239  1.1.1.1.2.1  snj         Usually, this is the same as pressing C-X,C-F,Tab
    240  1.1.1.1.2.1  snj         See C-X,C-F for more information.
    241  1.1.1.1.2.1  snj   C-X,k
    242  1.1.1.1.2.1  snj         Unloads the file being edited.
    243  1.1.1.1.2.1  snj         If the file has not been saved, a message will be displayed,
    244  1.1.1.1.2.1  snj         asking to either press C-X,k again, or save the file
    245  1.1.1.1.2.1  snj         The *scratch* buffer cannot be killed and will always
    246  1.1.1.1.2.1  snj         prints a warning when exiting xedit. This is the expected behavior.
    247  1.1.1.1.2.1  snj   C-X,o
    248  1.1.1.1.2.1  snj         Switch input focus to the other window, making it the current one
    249  1.1.1.1.2.1  snj         If the editor doesn't have splited windows, this command is ignored.
    250  1.1.1.1.2.1  snj   Insert
    251  1.1.1.1.2.1  snj         Switches between insert and overwrite mode.
    252  1.1.1.1.2.1  snj         In overwrite mode text is typed over existing file contents,
    253  1.1.1.1.2.1  snj         only extending the file contents when typing at the end of
    254  1.1.1.1.2.1  snj         a line (or file).
    255  1.1.1.1.2.1  snj   Escape
    256  1.1.1.1.2.1  snj         Enters the line edit mode.
    257  1.1.1.1.2.1  snj         In this mode it is possible to use regex expressions to search and
    258  1.1.1.1.2.1  snj         replace the contents of the file loaded in the current text window.
    259  1.1.1.1.2.1  snj         Refer to the xedit(1) manpage for more information of the regex
    260  1.1.1.1.2.1  snj         expression format.
    261  1.1.1.1.2.1  snj         Note that the regex used by xedit isn't IEEE Std 1003.2 compliant,
    262  1.1.1.1.2.1  snj         and not compliant with most regex implementations in that it doesn't
    263  1.1.1.1.2.1  snj         support some complex search patterns, usually involving patterns
    264  1.1.1.1.2.1  snj         like ((.*)+)? that may require too much restarts or have several
    265  1.1.1.1.2.1  snj         correct interpretations for multiple matches. Also, it always does
    266  1.1.1.1.2.1  snj         minimal matching, and it is not configurable like in pcre, example:
    267  1.1.1.1.2.1  snj         searching "a1a1a1" with the pattern "(.*)\d" will find "a1" and
    268  1.1.1.1.2.1  snj         not "a1a1a1" as could be expected.
    269  1.1.1.1.2.1  snj         Please refer to lisp/re/README for more information on the supported
    270  1.1.1.1.2.1  snj         regex expressions.
    271  1.1.1.1.2.1  snj   C-LeftMouseButton
    272  1.1.1.1.2.1  snj         Displays the "File Menu" from where it is possible to select a
    273  1.1.1.1.2.1  snj         new file to be edited in the current window.
    274  1.1.1.1.2.1  snj   C-MiddleMouseButton
    275  1.1.1.1.2.1  snj         Displays the "Edit Menu" that usually has the following options:
    276  1.1.1.1.2.1  snj      +------------------+-------------+
    277  1.1.1.1.2.1  snj      | Wrapping      -> | Never       |
    278  1.1.1.1.2.1  snj      |                  | Line        |
    279  1.1.1.1.2.1  snj      |                  | Word        |
    280  1.1.1.1.2.1  snj      | Auto Fill        +-------------+
    281  1.1.1.1.2.1  snj      |                  +-------------+
    282  1.1.1.1.2.1  snj      | Justification -> | Left        |
    283  1.1.1.1.2.1  snj      |                  | Right       |
    284  1.1.1.1.2.1  snj      |                  | Center      |
    285  1.1.1.1.2.1  snj      |                  | Full        |
    286  1.1.1.1.2.1  snj      |                  +-------------+
    287  1.1.1.1.2.1  snj      | Break Columns... |
    288  1.1.1.1.2.1  snj      |                  +-------------+
    289  1.1.1.1.2.1  snj      | Scrollbars    -> | Vertical    |
    290  1.1.1.1.2.1  snj      |                  | Horizontal  |
    291  1.1.1.1.2.1  snj      |                  +-------------+
    292  1.1.1.1.2.1  snj      |                  +-------------+
    293  1.1.1.1.2.1  snj      | Edit Mode     -> | Plain/None  |
    294  1.1.1.1.2.1  snj      |                  | C/C++       |
    295  1.1.1.1.2.1  snj      |                  | Lisp/Scheme |
    296  1.1.1.1.2.1  snj      |                  | X imake     |
    297  1.1.1.1.2.1  snj      |                  | Makefile    |
    298  1.1.1.1.2.1  snj      |                  | Unix shell  |
    299  1.1.1.1.2.1  snj      |                  | SGML        |
    300  1.1.1.1.2.1  snj      |                  | HTML        |
    301  1.1.1.1.2.1  snj      |                  | Man page    |
    302  1.1.1.1.2.1  snj      |                  | X resource  |
    303  1.1.1.1.2.1  snj      |                  | XF86Config  |
    304  1.1.1.1.2.1  snj      |                  | RPM spec    |
    305  1.1.1.1.2.1  snj      |                  | XFree86 log |
    306  1.1.1.1.2.1  snj      |                  | Patch file  |
    307  1.1.1.1.2.1  snj      +------------------+-------------+
    308  1.1.1.1.2.1  snj         "Wrapping" is disabled if "Auto Fill" is enabled.
    309  1.1.1.1.2.1  snj         "Justification" and "Break Columns..." are enabled if "Auto Fill"
    310  1.1.1.1.2.1  snj         is also enabled.
    311  1.1.1.1.2.1  snj         "Edit Mode" lists the available syntax highlight and indentation
    312  1.1.1.1.2.1  snj         rules defined.
    313  1.1.1.1.2.1  snj         Note that most of these options don't work in "international" mode.
    314  1.1.1.1.2.1  snj         Several xedit interfaces works only with 8 bits encodings, and
    315  1.1.1.1.2.1  snj         doesn't properly handle UTF-8.
    316  1.1.1.1.2.1  snj   C-RightMouseButton
    317  1.1.1.1.2.1  snj         Displays the "Option Menu".
    318  1.1.1.1.2.1  snj         Currently the only option is an Ispell frontend.
    319  1.1.1.1.2.1  snj   FourthMouseButton (usually also moving up the mouse wheel)
    320  1.1.1.1.2.1  snj         Scroll one line down
    321  1.1.1.1.2.1  snj   FifthMouseButton (usually also moving down the mouse wheel)
    322  1.1.1.1.2.1  snj         Scroll one line up
    323  1.1.1.1.2.1  snj 
    324  1.1.1.1.2.1  snj 
    325  1.1.1.1.2.1  snj 
    326  1.1.1.1.2.1  snj       There  is   also   some   documentation   in   lisp/README,   lisp/TODO,
    327  1.1.1.1.2.1  snj   lisp/re/README, lisp/re/tests.txt, and comments/justifications/wishlists for
    328  1.1.1.1.2.1  snj   the cases the interpreter fail to give the proper result for a given test.
    329  1.1.1.1.2.1  snj 
    330  1.1.1.1.2.1  snj       The  lisp  interpreter  implements  most  of   a  standard  COMMON  LISP
    331  1.1.1.1.2.1  snj   environment, but the  compiler generates only  byte code and  not everything
    332  1.1.1.1.2.1  snj   can be compiled, in those cases the interpreter  does the work. Examples are
    333  1.1.1.1.2.1  snj   constructs involving  UNWIND-PROTECT or  any  kind of  jump  outside of  the
    334  1.1.1.1.2.1  snj   current function body.
    335  1.1.1.1.2.1  snj 
    336  1.1.1.1.2.1  snj       For more  information please  consult any  COMMON LISP  documentation or
    337  1.1.1.1.2.1  snj   tutorial.
    338  1.1.1.1.2.1  snj 
    339  1.1.1.1.2.1  snj 
    340  1.1.1.1.2.1  snj 
    341  1.1.1.1.2.1  snj       Simple tutorial on writing a "foolang" syntax highlight mode for xedit.
    342  1.1.1.1.2.1  snj 
    343  1.1.1.1.2.1  snj   Create a file called foolang.lsp
    344  1.1.1.1.2.1  snj   Add:
    345  1.1.1.1.2.1  snj   --
    346  1.1.1.1.2.1  snj   (require "syntax")
    347  1.1.1.1.2.1  snj   (require "indent")
    348  1.1.1.1.2.1  snj   (in-package "XEDIT")
    349  1.1.1.1.2.1  snj   --
    350  1.1.1.1.2.1  snj   to foolang.lsp
    351  1.1.1.1.2.1  snj   Check the available files if you want a custom property, or to know about
    352  1.1.1.1.2.1  snj   the available ones. One example is:
    353  1.1.1.1.2.1  snj   --
    354  1.1.1.1.2.1  snj   (defsynprop *prop-foolang*
    355  1.1.1.1.2.1  snj     "foolang"
    356  1.1.1.1.2.1  snj     :font       "fixed"
    357  1.1.1.1.2.1  snj     :foreground "rgb:a/b/c"
    358  1.1.1.1.2.1  snj     :background "rgb:1/2/3"
    359  1.1.1.1.2.1  snj     :underline  t
    360  1.1.1.1.2.1  snj     :overstrike t)
    361  1.1.1.1.2.1  snj   --
    362  1.1.1.1.2.1  snj   Check  lisp/modules/xedit.lsp  for   the  other  options,   like  subscript,
    363  1.1.1.1.2.1  snj   superscript and/or combining XLFD properties.
    364  1.1.1.1.2.1  snj   Create a syntax definition for foolang. Check the definition of defsyntax in
    365  1.1.1.1.2.1  snj   lisp/modules/syntax.lsp for more details. One example for foolang is:
    366  1.1.1.1.2.1  snj   --
    367  1.1.1.1.2.1  snj   (defsyntax *foolang-mode* :foolang nil nil nil
    368  1.1.1.1.2.1  snj     ;; use the sample property created for foolang whenever the string
    369  1.1.1.1.2.1  snj     ;; foolang is found at the toplevel
    370  1.1.1.1.2.1  snj     (syntoken "\\<foolang\\>" :property *prop-foolang*)
    371  1.1.1.1.2.1  snj 
    372  1.1.1.1.2.1  snj     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    373  1.1.1.1.2.1  snj     ;; process C style comments
    374  1.1.1.1.2.1  snj     (syntoken "/*" :nospec t :begin :comment :contained t)
    375  1.1.1.1.2.1  snj       ;; contained is an option to not "export" this definition to child
    376  1.1.1.1.2.1  snj       ;; tables
    377  1.1.1.1.2.1  snj 
    378  1.1.1.1.2.1  snj     (syntable :comment *prop-comment* #'default-indent
    379  1.1.1.1.2.1  snj       ;; #'default-indent means a very simple indent that follows indentation
    380  1.1.1.1.2.1  snj       ;; of previous line. Use nil for no indentation
    381  1.1.1.1.2.1  snj 
    382  1.1.1.1.2.1  snj       ;; Don't start a new table, instead flag as an error if nested
    383  1.1.1.1.2.1  snj       (syntoken "/*" :nospec t :property *prop-error*)
    384  1.1.1.1.2.1  snj         ;; :nospec t sets the RE_NOSPEC flag for the regex, i.e. searches
    385  1.1.1.1.2.1  snj         ;; a literal string, and * will not be a special character
    386  1.1.1.1.2.1  snj 
    387  1.1.1.1.2.1  snj       (syntoken "XXX|TODO|FIXME" :property *prop-annotation*)
    388  1.1.1.1.2.1  snj         ;; just to make it easier to flag some important comment
    389  1.1.1.1.2.1  snj 
    390  1.1.1.1.2.1  snj       (syntoken "*/" :nospec t :switch -1)
    391  1.1.1.1.2.1  snj         ;; The :switch argument is the number of tables to "pop", in
    392  1.1.1.1.2.1  snj         ;; this case, we are at table :comment, and :switch -1 returns
    393  1.1.1.1.2.1  snj         ;; to table :foolang, that is the "root" table
    394  1.1.1.1.2.1  snj     )
    395  1.1.1.1.2.1  snj 
    396  1.1.1.1.2.1  snj     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    397  1.1.1.1.2.1  snj     ;; Process lisp comments that can nest
    398  1.1.1.1.2.1  snj     (syntable :lisp-comment *prop-comment* nil
    399  1.1.1.1.2.1  snj 
    400  1.1.1.1.2.1  snj       ;; Start a comment, possibly nested
    401  1.1.1.1.2.1  snj       (syntoken "#|" :nospec t :begin :lisp-comment)
    402  1.1.1.1.2.1  snj 
    403  1.1.1.1.2.1  snj       ;; Returns to previous comment in stack or to main :foolang table
    404  1.1.1.1.2.1  snj       (syntoken "|#" :nospec t :switch -1)
    405  1.1.1.1.2.1  snj 
    406  1.1.1.1.2.1  snj       ;; For easier flagging important comments
    407  1.1.1.1.2.1  snj       (syntoken "XXX|FIXME|TODO" :property *prop-annotation*)
    408  1.1.1.1.2.1  snj     )
    409  1.1.1.1.2.1  snj 
    410  1.1.1.1.2.1  snj     ;; This is usually in the end of the list, but can be anywhere,
    411  1.1.1.1.2.1  snj     ;; just that if it isn't at the end, conflicting rules are resolved
    412  1.1.1.1.2.1  snj     ;; by declaration order
    413  1.1.1.1.2.1  snj     (synaugment :lisp-comment)
    414  1.1.1.1.2.1  snj       ;; Adds the :lisp-comment table to :foolang table
    415  1.1.1.1.2.1  snj 
    416  1.1.1.1.2.1  snj     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    417  1.1.1.1.2.1  snj     ;; Lisp like strings that don't need a \ at the end of the line
    418  1.1.1.1.2.1  snj     (syntable :lisp-string *prop-string* nil
    419  1.1.1.1.2.1  snj       ;; ignore a escaped " in the middle of the string
    420  1.1.1.1.2.1  snj       (syntoken "\\\\.")
    421  1.1.1.1.2.1  snj         ;; Note that no options are used, just keep using the current
    422  1.1.1.1.2.1  snj         ;; property. Unfortunately, backslashes must be escaped twice.
    423  1.1.1.1.2.1  snj         ;; Once for the lisp reader and once for the regex compiler.
    424  1.1.1.1.2.1  snj 
    425  1.1.1.1.2.1  snj       (syntoken "\"" :nospec: t :switch -1)
    426  1.1.1.1.2.1  snj         ;; :nospec is used just to create a faster regex. switch -1
    427  1.1.1.1.2.1  snj         ;; returns to the previous syntax table. It isn't an error to
    428  1.1.1.1.2.1  snj         ;; try to go down the "root" table, but if that happens, it
    429  1.1.1.1.2.1  snj         ;; probably means either wrong syntax definition of malformed input.
    430  1.1.1.1.2.1  snj     )
    431  1.1.1.1.2.1  snj 
    432  1.1.1.1.2.1  snj     (synaugment :lisp-string)
    433  1.1.1.1.2.1  snj       ;; Adds the :lisp-string table to :foolang table
    434  1.1.1.1.2.1  snj       ;; Note that since there isn't a rule to start a string in the
    435  1.1.1.1.2.1  snj       ;; :lisp-string table, it cannot nest, maybe because the ending
    436  1.1.1.1.2.1  snj       ;; character is the starting character ? :-))
    437  1.1.1.1.2.1  snj 
    438  1.1.1.1.2.1  snj     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    439  1.1.1.1.2.1  snj     ;; C style string rules
    440  1.1.1.1.2.1  snj     (syntable :string *prop-string* nil
    441  1.1.1.1.2.1  snj       ;; Ignore escaped characters
    442  1.1.1.1.2.1  snj       (syntoken "\\\\.")
    443  1.1.1.1.2.1  snj 
    444  1.1.1.1.2.1  snj     ;; Match, most, printf arguments.
    445  1.1.1.1.2.1  snj     (syntoken "%%|%([+-]?\\d+)?(l?[deEfgiouxX]|[cdeEfgiopsuxX])"
    446  1.1.1.1.2.1  snj         :property *prop-format*)
    447  1.1.1.1.2.1  snj       ;; Just for fun. This makes easier to see printf formats in strings
    448  1.1.1.1.2.1  snj       ;; *prop-format* is *prop-string* with the :underline option
    449  1.1.1.1.2.1  snj 
    450  1.1.1.1.2.1  snj     (syntoken "\\\\$")
    451  1.1.1.1.2.1  snj     ;; a backslash extends the string to the next line
    452  1.1.1.1.2.1  snj 
    453  1.1.1.1.2.1  snj     ;; A nonscaped " inside a string finishes it, since this table doesn't
    454  1.1.1.1.2.1  snj     ;; have sub tables, and cannot nest, should return to :foolang table
    455  1.1.1.1.2.1  snj     ;; from here
    456  1.1.1.1.2.1  snj     (syntoken "\"" :nospec t :switch -1)
    457  1.1.1.1.2.1  snj 
    458  1.1.1.1.2.1  snj     ;; This token rule starts a new table called :error because end of line
    459  1.1.1.1.2.1  snj     ;; has been matched. Note that it is defined last, so that a line
    460  1.1.1.1.2.1  snj     ;; ending with " or \ will be processed first.
    461  1.1.1.1.2.1  snj     (syntoken ".?$" :begin :error)
    462  1.1.1.1.2.1  snj 
    463  1.1.1.1.2.1  snj     (synaugment :string)
    464  1.1.1.1.2.1  snj       ;; Adds the :string table to :foolang table
    465  1.1.1.1.2.1  snj 
    466  1.1.1.1.2.1  snj     ;; This table is used by :string, but could be shared for other patterns
    467  1.1.1.1.2.1  snj     ;; like characters constants, etc.
    468  1.1.1.1.2.1  snj     ;; It uses :switch -2 because it is started inside the :string table,
    469  1.1.1.1.2.1  snj     ;; but it is also a table, so, pops two tables from the table stack
    470  1.1.1.1.2.1  snj     (syntable :error *prop-error* nil
    471  1.1.1.1.2.1  snj 	(syntoken "^.*$" :switch -2)
    472  1.1.1.1.2.1  snj     )
    473  1.1.1.1.2.1  snj   )
    474  1.1.1.1.2.1  snj   --
    475  1.1.1.1.2.1  snj 
    476  1.1.1.1.2.1  snj       Indentation rules are significantly  more complex. I suggest  looking at
    477  1.1.1.1.2.1  snj   lisp/modules/indent.lsp   for   the   macros   and   function   definitions;
    478  1.1.1.1.2.1  snj   and lisp/modules/progmodes/lisp.lsp and lisp/modules/progmodes/c.lsp for two
    479  1.1.1.1.2.1  snj   sample  implementations   of   indentation   for   Lisp/Scheme   and   C/C++
    480  1.1.1.1.2.1  snj   respectively.
    481  1.1.1.1.2.1  snj 
    482  1.1.1.1.2.1  snj       Note also  that indentation  is parsed  backwards, what  can cause  some
    483  1.1.1.1.2.1  snj   confusion, and make "visualization" of order or precedence of evaluation for
    484  1.1.1.1.2.1  snj   rules harder to understand.
    485  1.1.1.1.2.1  snj 
    486  1.1.1.1.2.1  snj       A simple indentation rules definition for foolang could be:
    487  1.1.1.1.2.1  snj 
    488  1.1.1.1.2.1  snj   --
    489  1.1.1.1.2.1  snj   (defindent *foolang-mode-indent* :foolang
    490  1.1.1.1.2.1  snj     ;; This must be the first token and usually the only token matching
    491  1.1.1.1.2.1  snj     ;; BOL (Beginning of Line)
    492  1.1.1.1.2.1  snj     (indtoken "^\\s*"   :indent
    493  1.1.1.1.2.1  snj       :code (or *offset* (setq *offset* (+ *ind-offset* *ind-length*))))
    494  1.1.1.1.2.1  snj       ;; the keyword :indent is a pattern put on a list when there is
    495  1.1.1.1.2.1  snj       ;; a match, so that later patterns can be "reduced" by some other
    496  1.1.1.1.2.1  snj       ;; rule, i.e.:  (:indent :indent) could be reduced to (:indent)
    497  1.1.1.1.2.1  snj 
    498  1.1.1.1.2.1  snj     (indtoken "//.*$"   nil)
    499  1.1.1.1.2.1  snj       ;; C++ style comment. Returning nil instead of a token basically
    500  1.1.1.1.2.1  snj       ;; ignores the token, as it should not enter the reduction pattern
    501  1.1.1.1.2.1  snj       ;; list
    502  1.1.1.1.2.1  snj 
    503  1.1.1.1.2.1  snj     ;; Sample C comment pattern
    504  1.1.1.1.2.1  snj     (indtoken "*/" :ccomment :nospec t :begin :comment)
    505  1.1.1.1.2.1  snj       ;; Note that the indaugment macro doesn't need to be used, and actually
    506  1.1.1.1.2.1  snj       ;; would be an error. In this example, the indentation compiler checks
    507  1.1.1.1.2.1  snj       ;; the :begin :comment and handles it internally, as it already needs
    508  1.1.1.1.2.1  snj       ;; to check for things like typos, unreachable labels, detectable
    509  1.1.1.1.2.1  snj       ;; non resolving rules, etc. There is runtime check also, so it should
    510  1.1.1.1.2.1  snj       ;; never enter an infinite loop when trying to resolve reduction rules.
    511  1.1.1.1.2.1  snj       ;; Check lisp/modules/indent.lsp:(compile-indent-table) for the
    512  1.1.1.1.2.1  snj       ;; implementation and more comments.
    513  1.1.1.1.2.1  snj 
    514  1.1.1.1.2.1  snj     ;; Indentation rules also have stacked tables
    515  1.1.1.1.2.1  snj     (indtable :comment
    516  1.1.1.1.2.1  snj       (indtoken "/*" :ocomment :nospec t :switch -1))
    517  1.1.1.1.2.1  snj       ;; Note that the name is :ocomment (open comment), but that the
    518  1.1.1.1.2.1  snj       ;; the table is finished when matching the open comment pattern
    519  1.1.1.1.2.1  snj 
    520  1.1.1.1.2.1  snj     ;; A simple initialization of a variable used by the indentation rules
    521  1.1.1.1.2.1  snj     (indinit       (parens 0))
    522  1.1.1.1.2.1  snj       ;; This variable can be declared anywhere in the body of defindent,
    523  1.1.1.1.2.1  snj       ;; It will be properly moved to a "variables declaration section"
    524  1.1.1.1.2.1  snj       ;; when expanding and compiling the table.
    525  1.1.1.1.2.1  snj 
    526  1.1.1.1.2.1  snj     (indtoken "("  :oparen  :nospec t  :code (incf parens))
    527  1.1.1.1.2.1  snj     (indtoken ")"  :cparen  :nospec t  :code (decf parens))
    528  1.1.1.1.2.1  snj       ;; These two tokes add the patterns :oparen and :cparen to the
    529  1.1.1.1.2.1  snj       ;; "pattern list", and also have code to remember the balancing
    530  1.1.1.1.2.1  snj       ;; of parenthesis.
    531  1.1.1.1.2.1  snj 
    532  1.1.1.1.2.1  snj 
    533  1.1.1.1.2.1  snj     ;; One of the simplest reduction rules :-)
    534  1.1.1.1.2.1  snj     (indreduce nil
    535  1.1.1.1.2.1  snj       t
    536  1.1.1.1.2.1  snj       ((:comment)))
    537  1.1.1.1.2.1  snj       ;; Once the boundings of a comment are found, just ignore it, like
    538  1.1.1.1.2.1  snj       ;; what was done with the // pattern, but in that case, the boundings
    539  1.1.1.1.2.1  snj       ;; were readily available.
    540  1.1.1.1.2.1  snj       ;; The t (True) parameter means that this rule is always evaluated,
    541  1.1.1.1.2.1  snj       ;; but conditional code may be used, and implicit code may be added
    542  1.1.1.1.2.1  snj       ;; to the end of the indreduce macro.
    543  1.1.1.1.2.1  snj       ;; Since it is a macro, code can be compiled to optimized bytecode
    544  1.1.1.1.2.1  snj       ;; after the macro is expanded.
    545  1.1.1.1.2.1  snj 
    546  1.1.1.1.2.1  snj     (indinit    (indent 0))
    547  1.1.1.1.2.1  snj       ;; Note that there is a special *indent* variable that should hold the
    548  1.1.1.1.2.1  snj       ;; proper indentation value, but it may be required to "overwrite"
    549  1.1.1.1.2.1  snj       ;; without forgetting that value, for things like:
    550  1.1.1.1.2.1  snj       ;;
    551  1.1.1.1.2.1  snj       ;;  foo(bar(baz(blah
    552  1.1.1.1.2.1  snj       ;;      ^       ^
    553  1.1.1.1.2.1  snj       ;;      |       |
    554  1.1.1.1.2.1  snj       ;;      indent  |
    555  1.1.1.1.2.1  snj       ;;              effective indentation to be used
    556  1.1.1.1.2.1  snj       ;;
    557  1.1.1.1.2.1  snj       ;; where it is desirable to align the code in the next line with the
    558  1.1.1.1.2.1  snj       ;; last open parenthesis.
    559  1.1.1.1.2.1  snj 
    560  1.1.1.1.2.1  snj 
    561  1.1.1.1.2.1  snj       Since the  interface is,  unfortunately,  complex enough  to not  expect
    562  1.1.1.1.2.1  snj   casual users to have something like a $HOME/.xedit file,  if you want to add
    563  1.1.1.1.2.1  snj   new modes, please check lisp/modules/xedit.lsp:*auto-modes*
    564  1.1.1.1.2.1  snj 
    565  1.1.1.1.2.1  snj       There is some documentation about the variable. It should be possible to
    566  1.1.1.1.2.1  snj   change/update the variable from the lisp interface  in the *scratch* buffer,
    567  1.1.1.1.2.1  snj   but for  safety, it  is suggested  that  if you  add new  rules, you  should
    568  1.1.1.1.2.1  snj   restart  xedit  after  it.  Also  note  that  there   is  compiled  code  in
    569  1.1.1.1.2.1  snj   lisp/xedit.c that expects that variable to follow an specific format.
    570  1.1.1.1.2.1  snj 
    571  1.1.1.1.2.1  snj       You may notice that several .lsp files  aren't "properly indented"; this
    572  1.1.1.1.2.1  snj   is because the lisp indentation rules  file was made long after  most of the
    573  1.1.1.1.2.1  snj   other files were done, and it was considered  a bad practice to gratuitously
    574  1.1.1.1.2.1  snj   reindent all files.
    575  1.1.1.1.2.1  snj 
    576  1.1.1.1.2.1  snj 
    577  1.1.1.1.2.1  snj 
    578  1.1.1.1.2.1  snj       At the  time  of this  writing,  the ispell  interface  should be  again
    579  1.1.1.1.2.1  snj   functional, but it may be required to use some  old ispell program to handle
    580  1.1.1.1.2.1  snj   non utf8 text. But it should work properly for  the english language, and in
    581  1.1.1.1.2.1  snj   international mode, should work with any language. But there are problems in
    582  1.1.1.1.2.1  snj   international mode not fixed.
    583  1.1.1.1.2.1  snj 
    584  1.1.1.1.2.1  snj       I  (Paulo  Cesar)  considered  several  times   to   extend  the  normal
    585  1.1.1.1.2.1  snj   textwidget to handle  utf8, but this  is probably  a lot of  work/time badly
    586  1.1.1.1.2.1  snj   spent and I prefer  to work on other  personal projects, but still  xedit is
    587  1.1.1.1.2.1  snj   the editor I use for programming. The XPRINT support unfortunately is broken
    588  1.1.1.1.2.1  snj   due to it. Note that xedit,  like pretty much any other  Xaw application can
    589  1.1.1.1.2.1  snj   be linked against  Xaw with  XPRINT support. In  the case  of xedit,  a flag
    590  1.1.1.1.2.1  snj   could be used, like the "international" variable to, at runtime, disable all
    591  1.1.1.1.2.1  snj   the related code, if required.
    592  1.1.1.1.2.1  snj 
    593  1.1.1.1.2.1  snj       Also at the time of this writing, the tags  interface was added, as well
    594  1.1.1.1.2.1  snj   as several other bug fixes. The tags interface is documented in the manpage,
    595  1.1.1.1.2.1  snj   but the action  shortcut may  not be clear.  The default  shortcut is  M-. .
    596  1.1.1.1.2.1  snj   There is no support for more  than one tags file, or changing  the tags file
    597  1.1.1.1.2.1  snj   at runtime. But  the code  should be  easy to  adapt for  this case,  as all
    598  1.1.1.1.2.1  snj   related functions receive pointers to the appropriate structures. One option
    599  1.1.1.1.2.1  snj   could be to descend  from the directory of  the loaded file searching  for a
    600  1.1.1.1.2.1  snj   tags file, and then associate the file with the tags definition, if it isn't
    601  1.1.1.1.2.1  snj   already loaded. Shouldn't be  hard to implement. For  "inter project" files,
    602  1.1.1.1.2.1  snj   it should be better to  have one xedit window per  "project", i.e. searching
    603  1.1.1.1.2.1  snj   the definition of something  like a libc  symbol should probably be  done in
    604  1.1.1.1.2.1  snj   another xedit window.
    605