File: joe.1.in

package info (click to toggle)
jupp 3.1.38-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,420 kB
  • sloc: ansic: 31,382; sh: 4,199; makefile: 431
file content (850 lines) | stat: -rw-r--r-- 39,395 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
.\" $MirOS: contrib/code/jupp/joe.1.in,v 1.26 2018/08/10 02:53:44 tg Exp $
.\"-
.TH JOE 1
.SH Name
joe \- Joe's Own Editor
.SH Syntax
.B joe [global-options] [ [local-options] filename ]...

.B jstar [global-options] [ [local-options] filename ]...

.B jmacs [global-options] [ [local-options] filename ]...

.B rjoe [global-options] [ [local-options] filename ]...

.B jpico [global-options] [ [local-options] filename ]...

.B jupp [global-options] [ [local-options] filename ]...
.SH Description
JOE is a powerful ASCII-text screen editor.  It has a "mode-less" user
interface which is similar to many user-friendly PC editors.  Users of
Micro-Pro's WordStar or Borland's "Turbo" languages will feel at home.  JOE
is a full featured UNIX screen-editor though, and has many features for
editing programs and text.

JOE also emulates several other editors.  JSTAR is a close imitation of
WordStar with many "JOE" extensions.  JPICO is a close imitation of the
Pine mailing system's PICO editor, but with many extensions and
improvements.  JMACS is a GNU-EMACS imitation.  RJOE is a restricted
version of JOE, which allows you to edit only the files specified on the
command line.

Although JOE is actually six different editors, it still requires only one
executable, but one with six different names.  The name of the editor with
an "rc" appended gives the name of JOE's initialisation file, which
determines the personality of the editor.

JUPP is free software; you can distribute it and/or modify it under the
terms of the GNU General Public License, Version 1, as published by the
Free Software Foundation.  (main.c contains more detailed exceptions.)
I have no plans for turning JOE into a commercial or share-ware product.
See the source code for exact authorship and licencing information.
JOE is available over the Internet from \fBhttp://joe-editor.sf.net/\fR.
JUPP is available at \fBhttp://mirbsd.de/jupp\fR.

.SH Usage

To start the editor, type \fBjoe\fR followed by zero or more names of files
you want to edit.  Each file name may be preceded by a local option setting
(see the local options table which follows).  Other global options, which
apply to the editor as a whole, may also be placed on the command line (see
the global options table which follows).  If you are editing a new file, you
can either give the name of the new file when you invoke the editor, or in
the editor when you save the new file.  A modified syntax for file names is
provided to allow you to edit program output, standard input/output, or
sections of files or devices.  See the section \fBFilenames\fR below for
details.

On cygwin32 systems, the special option \fB\-CYGhack\fR is replaced by
anything that comes past it (and separating whitespace) on the command
line as \fIone\fR option (to work around a Cygwin bug as it cannot
correctly be passed a UNC pathname with spaces as one argument from
Explorer \fIat all\fR).

Once you are in the editor, you can type in text and use special
control-character sequences to perform other editing tasks.  To find out
what the control-character sequences are, read the rest of this man page or
type \fB^K H\fR for help in the editor.

Now for some obscure computer-lore:

The \fB^\fR means that you hold down the \fBControl\fR key while pressing
the following key (the same way the \fBShift\fR key works for uppercase
letters).  A number of control-key sequences are duplicated on other keys,
so that you don't need to press the control key: \fBESC\fR will work in
place of \fB^[\fR, \fBDel\fR will work in place of \fB^?\fR, \fBBackspace\fR
will work in place of \fB^H\fR, \fBTab\fR will work in place of \fB^I\fR,
\fBReturn\fR or \fBEnter\fR will work in place of \fB^M\fR and
\fBLinefeed\fR will work in place of \fB^J\fR.  Some keyboards may give you
trouble with some control keys.  \fB^_\fR, \fB^^\fR and \fB^@\fR can usually
be entered without pressing shift (I.E., try \fB^-\fR, \fB^6\fR and
\fB^2\fR).  Other keyboards may reassign these to other keys.  Try:
\fB^.\fR, \fB^,\fR and \fB^/\fR.  \fB^SPACE\fR can usually be used in place
of \fB^@\fR.  \fB^\\\fR and \fB^]\fR are interpreted by many communication
programs, including telnet and kermit.  Usually you just hit the key twice
to get it to pass through the communication program.

Once you have typed \fB^K H\fR, the first help window appears at the top of
the screen.  You can continue to enter and edit text while the help window
is on.  To page through other topics, hit ^[, and ^[. (that is, ESC , and
ESC .).  Use \fB^K H\fR to dismiss the help window.

You can customise the keyboard layout, the help screens and a number of
behavior defaults by copying JOE's initialisation file (@joeinitfile@)
to \fB.joerc\fR in your home directory and then by modifying it.
See the section \fBjoerc\fR below.
The filename is actually \fB.\fIname\fBrc\fR where \fIname\fR is the
\fBargv[0]\fR the editor is called with.

Custom syntax files are loaded from \fB.jupp/syntax/\fIname\fB.jsf\fR
in your home directory and \fB.jupp/charmaps/\fIname\fR holds custom
charmaps (\fIname\fR here is the name of the syntax or charmap).

To have JOE used as your default editor for e-mail and News, you need to set
the \fBEDITOR\fR and \fBVISUAL\fR environment variables in your shell
initialisation file (\fB.cshrc\fR or \fB.profile\fR) to refer to JOE (the
joe binary usually resides as \fB@joeresides@\fR).

There are a number of other obscure invocation parameters which may have to
be set, particularly if your terminal screen is not updating as you think it
should.  See the section \fBEnvironment variables\fR below.

.SH Command Line Options

The following global options may be specified on the command line:

.IP -asis
Characters with codes above 127 will be sent to the terminal as-is, instead
of as inverse of the corresponding character below 128.  If this does not
work, check your terminal server.

.IP -backpath\ path
If this option is given, backup files will be stored in the specified
directory instead of in each file's original directory.

.IP -baud\ nnn
Set the baud rate for the purposes of terminal screen optimisation.  Joe
inserts delays for baud rates below 19200, which bypasses tty buffering so
that typeahead will interrupt the screen output.  Scrolling commands will
not be used for 38400 baud.  This is useful for X-terms and other console
ttys which really aren't going over a serial line.

.IP -beep
Joe will beep on command errors and when the cursor goes past extremes.

.IP -columns\ nnn
Sets the number of screen columns.

.IP -csmode
Continued search mode: a search immediately following a search will repeat
the previous search instead of prompting for new string.  This is useful for
the the ^[S and ^[R commands and for when joe is trying to be emacs.

.IP -dopadding
Joe usually assumes that there is some kind of flow control between it and
the tty.  If there isn't, this option will make joe output extra ^@s to the
tty as specified by the termcap entry.  The extra ^@s allow the terminal to
catch up after long terminal commands.

.IP -exask
This option makes ^KX verify the file name that it's about to write.

.IP -force
This option makes sure that the last line of the file has a line-feed which
it's saved.

.IP -help
The editor will start with the help screen on if this option is given.

.IP -keepup
Normally the column number and control-key prefix fields of the status lines
are on a one second delay to reduce CPU consumption, but with this option
they are updated after each key-stroke.

.IP -lightoff
The block highlighting will go away after any block command if this option
is given.

.IP -lines\ nnn
Sets the number of screen lines.

.IP -marking
Text between ^KB and the cursor is highlighted (use with \-lightoff and a
modified joerc file to have drop-anchor style block selection).

.IP -mid
If this option is set and the cursor moves off the window, the window will
be scrolled so that the cursor is in the center.  This option is forced on
slow terminals which don't have scrolling commands.

.IP -nobackups
This option prevents backup files.

.IP -nonotice
This option prevent the copyright notice from being displayed when the
editor starts.

.IP -nosta
This option eliminates the top-most status line.  It's nice for when you
only want to see your text on the screen or if you're using a vt52.

.IP -noxon
Attempt to turn off ^S/^Q processing.  This is useful for when joe is trying
to be WordStar or EMACS.

.IP -orphan
When this option is active, extra files on the command line will be placed
in orphaned buffers instead of in extra windows.  This is useful for when
joe is trying to be emacs.

.IP -pg\ nnn
This specifies the number of lines to keep after PgUp/PgDn (^U/^V).  If \-1
is given, half the window is kept.

.IP -skiptop\ nnn
Don't use the top nnn lines of the screen.  Useful for when joe is used as a
BBS editor.

.LP
Each of these options may be specified in the joerc file as well.  In
addition, the NOXON, BAUD, LINES, COLUMNS and DOPADDING options may be
specified with environment variables.
See the section \fBEnvironment variables\fR below.

The following options may be specified before each filename on the command
line:

.IP +nnn
The cursor starts on the specified line.

.IP -crlf
Joe uses CR-LF as the end of line sequence instead of just LF.  This is for
editing MS-DOS or VMS files.

.IP -hex
Sets the buffer to hex edit mode.

.IP -wordwrap
Joe wraps the previous word when you type past the right margin.

.IP -autoindent
When you hit Return on an indented line, the indentation is duplicated onto
the new line.

.IP -overwrite
Typing overwrites existing characters instead of inserting before them.

.IP -lmargin\ nnn
Sets the left margin.

.IP -rmargin\ nnn
Sets the right margin.

.IP -tab\ nnn
Sets the tab width.

.IP -indentc\ nnn
Sets the indentation character for ^K, and ^K. (32 for SPACE, 9 for TAB).

.IP -istep\ nnn
Sets the indentation step for ^K, and ^K..

.IP -linums
Line numbers are displayed before each line.

.IP -rdonly
The file is read only.

.IP -keymap\ name
Use an alternate section of the joerc file for the key sequence bindings.
For example,
.B joe, jstar, rjoe
and
.B jupp
support
.B \-keymap cua
to make ^Z, ^X, ^C and ^V do the same thing as in contemporary GUI editors.

.LP
These options can also be specified in the joerc file.  They can be set
depending on the file-name extension.  Programs (.c, .h or .p extension)
usually have autoindent enabled.  Wordwrap is enabled on other files, but rc
files have it disabled.

.SH Editing Tasks
.SS Basic Editing

When you type characters into the editor, they are normally inserted into
the file being edited (or appended to the file if the cursor is at the end
of the file).  This is the normal operating mode of the editor.  If you want
to replace some existing text, you have to delete the old text before or
after you type in the replacement text.  The \fBBackspace\fR key can be used
for deleting text: move the cursor to right after the text you want to
delete and hit \fBBackspace\fR a number of times.

Hit the \fBEnter\fR or \fBReturn\fR key to insert a line-break.  For
example, if the cursor was in the middle of a line and you hit \fBReturn\fR,
the line would be split into two lines with the cursor appearing at the
beginning of the second line.  Hit \fBBackspace\fR at the beginning of a
line to eliminate a line-break.

Use the arrow keys to move around the file.  If your keyboard doesn't have
arrow keys (or if they don't work for some reason), use \fB^F\fR to move
forwards (right), \fB^B\fR to move backwards (left), \fB^P\fR to move to the
previous line (up), and \fB^N\fR to move to the next line (down).  The right
and left arrow keys simply move forwards or backwards one character at a
time through the text: if you're at the beginning of a line and
you press left-arrow, you will end up at the end of the previous line.  The
up and down arrow keys move forwards and backwards by enough characters so
that the cursor appears in the same column that it was in on the original
line.

If you want to indent the text you enter, you can use the \fBTAB\fR key.
This inserts a special control character which makes the characters which
follow it begin at the next TAB STOP.  TAB STOPS normally occur every 8
columns, but this can be changed with the \fB^T D\fR command.  Python
programmers often set TAB STOPS on every 4 columns.

If for some reason your terminal screen gets messed up (for example, if
you receive a mail notice from biff), you can have the editor refresh the
screen by hitting \fB^R\fR.

There are many other keys for deleting text and moving around the file.  For
example, hit \fB^D\fR to delete the character the cursor is on instead of
deleting backwards like \fBBackspace\fR.  \fB^D\fR will also delete a
line-break if the cursor is at the end of a line.  Type \fB^Y\fR to delete
the entire line the cursor is on or \fB^J\fR to delete just from the cursor
to the end of the line.

Hit \fB^A\fR to move the cursor to the beginning of the line it's on.  Hit
\fB^E\fR to move the cursor to the end of the line.  Hit \fB^U\fR or
\fB^V\fR for scrolling the cursor up or down 1/2 a screen's worth.
"Scrolling" means that the text on the screen moves, but the cursor stays at
the same place relative to the screen.  Hit \fB^K U\fR or \fB^K V\fR to move
the cursor to the beginning or the end of the file.  Look at the help
screens in the editor to find even more delete and movement commands.

If you make a mistake, you can hit \fB^_\fR to "undo" it.  On most keyboards
you hit just \fB^-\fR to get \fB^_\fR, but on some you might have to hold
both the \fBShift\fR and \fBControl\fR keys down at the same time to get it.
If you "undo" too much, you can "redo" the changes back into existence by
hitting \fB^^\fR (type this with just \fB^6\fR on most keyboards).

If you were editing in one place within the file, and you then temporarily
had to look or edit some other place within the file, you can get back to
the original place by hitting \fB^K -\fR.  This command actually returns you
to the last place you made a change in the file.  You can step through a
history of places with \fB^K -\fR and \fB^K =\fR, in the same way you can
step through the history of changes with the "undo" and "redo" commands.

When you are done editing the file, hit \fB^K X\fR to exit the editor.  You
will be prompted for a file name if you hadn't already named the file you
were editing.

When you edit a file, you actually edit only a copy of the file.  So if you
decide that you don't want the changes you made to a file during a
particular edit session, you can hit \fB^C\fR to exit the editor without
saving them.

If you edit a file and save the changes, a "backup" copy of that file is
created in the current directory, with a ~ appended to the name, which
contains the original version of the file.

.SS Word wrap and formatting

If you type past the right edge of the screen in a C language or PASCAL
file, the screen will scroll to the right to follow the cursor.  If you type
past the right edge of the screen in a normal file (one whose name doesn't
end in .c, .h or .p), JOE will automatically wrap the last word onto the
next line so that you don't have to hit \fBReturn\fR.  This is called
word-wrap mode.  Word-wrap can be turned on or off with the \fB^T W\fR
command.  JOE's initialisation file is usually set up so that this mode is
automatically turned on for all non-program files.  See the section below on
the \fBjoerc\fR file to change this and other defaults.

Aside for Word-wrap mode, JOE does not automatically keep paragraphs
formatted like some word-processors.  Instead, if you need a paragraph to be
reformatted, hit \fB^K J\fR.  This command "fills in" the paragraph that the
cursor is in, fitting as many words in a line as is possible.  A paragraph,
in this case, is a block of text separated above and below by a blank line.

The margins which JOE uses for paragraph formatting and word-wrap can be set
with the \fB^T L\fR and \fB^T R\fR commands.  If the left margin is set to
a value other than 1, then when you start typing at the beginning of a line,
the cursor will immediately jump to the left margin.

If you want to center a line within the margins, use the \fB^K A\fR command.

.SS Over-type mode

Sometimes it's tiresome to have to delete old text before or after you
insert new text.  This happens, for example, when you are changing a table
and you want to maintain the column position of the right side of the table.
When this occurs, you can put the editor in over-type mode with \fB^T T\fR.
When the editor is in this mode, the characters you type in replace existing
characters, in the way an idealised typewriter would.  Also, \fBBackspace\fR
simply moves left instead of deleting the character to the left, when it's
not at the end or beginning of a line.  Over-type mode is not the natural
way of dealing with text electronically, so you should go back to
insert-mode as soon as possible by typing \fB^T T\fR again.

If you need to insert while you're in over-type mode, hit \fB^@\fR.  This
inserts a single SPACE into the text.

.SS Control and Meta characters

Each character is represented by a number.  For example, the number for 'A'
is 65 and the number for '1' is 49.  All of the characters which you
normally see have numbers in the range of 32 - 126 (this particular
arbitrary assignment between characters and numbers is called the ASCII
character set).  The numbers outside of this range, from 0 to 255, aren't
usually displayed, but sometimes have other special meanings.  The number
10, for example, is used for the line-breaks.  You can enter these special,
non-displayed \fBcontrol characters\fR by first hitting \fB`\fR and then
hitting a character in the range \fB@ A B C ... X Y Z [ ^ ] \e _\fR to get
the number 0 - 31, and ? to get 127.  For example, if you hit \fB` J\fR,
you'll insert a line-break character, or if you hit \fB` I\fR, you'll insert
a TAB character (which does the same thing the TAB key does).  A useful
control character to enter is 12 (\fB` L\fR), which causes most printers to
advance to the top of the page.  You'll notice that JOE displays this
character as an underlined L.  You can enter the characters above 127, the
\fBmeta characters\fR, by first hitting \fB^\e\fR.  This adds 128
to the next (possibly control) character entered.  JOE displays characters
above 128 in inverse-video.  Some foreign languages, which have more letters
than English, use the meta characters for the rest of their alphabet.  You
have to put the editor in \fBASIS\fR mode (described later) to have these
passed untranslated to the terminal.

.SS Prompts
If you hit \fBTAB\fR at any file name prompt, joe will attempt to complete
the name you entered as much as possible.  If it couldn't complete the
entire name, because there are more than one possible completions, joe
beeps.  If you hit \fBTAB\fR again, joe list the completions.  You can use
the arrow keys to move around this directory menu and press RETURN or SPACE
to select an item.  If you press the first letter of one of the directory
entries, it will be selected, or if more than one entry has the same first
letter, the cursor will jump between those entries.  If you select a
subdirectory or .., the directory name is appended to the prompt and the new
directory is loaded into the menu.  You can hit Backspace to go back to the
previous directory.

Most prompts record a history of the responses you give them.  You can hit
up and down arrow to step through these histories.

Prompts are actually single line windows with no status line, so you can use
any editing command that you normally use on text within the prompts.  The
prompt history is actually just other lines of the same "prompt file".  Thus
you can can search backwards though the prompt history with the normal \fB^K
F\fR command if you want.

Since prompts are windows, you can also switch out of them with \fB^K P\fR
and \fB^K N\fR.

.SS Where am I?

Hit \fB^K SPACE\fR to have JOE report the line number, column number, and
byte number on the last line of the screen.  The number associated with the
character the cursor is on (its ASCII code) is also shown.  You can have the
line number and/or column number always displayed on the status line by
setting placing the appropriate escape sequences in the status line setup
strings.  Edit the joerc file for details.

.SS File operations

You can hit \fB^K D\fR to save the current file (possibly under a different
name from what the file was called originally).  After the file is saved,
you can hit \fB^K E\fR to edit a different file.

If you want to save only a selected section of the file, see the section on
\fBBlocks\fR below.

If you want to include another file in the file you're editing, use \fB^K
R\fR to insert it.

.SS Temporarily suspending the editor

If you need to temporarily stop the editor and go back to the shell, hit
\fB^K Z\fR.  You might want to do this to stop whatever you're editing and
answer an e-mail message or read this man page, for example.  You have to
type \fBfg\fR or \fBexit\fR (you'll be told which when you hit \fB^K Z\fR)
to return to the editor.

.SS Searching for text

Hit \fB^K F\fR to have the editor search forwards or backwards for a text
fragment (\fBstring\fR) for you.  You will be prompted for the text to
search for.  After you hit \fBReturn\fR, you are prompted to enter options.
You can just hit \fBReturn\fR again to have the editor immediately search
forwards for the text, or you can enter one or more of these options:

.IP \fBb
Search backwards instead of forwards.

.IP \fBi
Treat uppercase and lower case letters as the same when searching.  Normally
uppercase and lowercase letters are considered to be different.

.IP \fBnnn
(where \fBnnn\fR is a number) If you enter a number, JOE searches for the
Nth occurrence of the text.  This is useful for going to specific places in
files structured in some regular manner.

.IP \fBr
Replace text.  If you enter the \fBr\fR option, then you will be further
prompted for replacement text.  Each time the editor finds the search text,
you will be prompted as to whether you want to replace the found search text
with the replacement text.  You hit: \fBy\fR to replace the text and then
find the next occurrence, \fBn\fR to not replace this text, but to then find
the next occurrence, \fBl\fR to replace the text and then stop searching,
\fBr\fR to replace all of the remaining occurrences of the search text in
the remainder of the file without asking for confirmation (subject to the
\fBnnn\fR option above), or \fB^C\fR to stop searching and replacing.

.PP
You can hit \fB^L\fR to repeat the previous search.

.SS Regular Expressions

A number of special character sequences may be entered as search text:

.IP \fB\e*
This finds zero or more characters.  For example, if you give \fBA\e*B\fR as
the search text, JOE will try to find an A followed by any number of characters
and then a B.

.IP \fB\e?
This finds exactly one character.  For example, if you give \fBA\e?B\fR as
the search text, JOE will find AXB, but not AB or AXXB.

.IP \fB\e^\ \e$
These match the beginning and end of a line.  For example, if you give
\fB\e^test\e$\fR, then JOE with find \fBtest\fR on a line by itself.

.IP \fB\e<\ \e>
These match the beginning and end of a word.  For example, if you give
\fB\e<\e*is\e*\e>\fR, then joe will find whole words which have the
sub-string \fBis\fR within them.

.IP \fB\e[...]
This matches any single character which appears within the brackets.  For
example, if \fB\e[Tt]his\fR is entered as the search string, then JOE finds
both \fBThis\fR and \fBthis\fR.  Ranges of characters can be entered within
the brackets.  For example, \fB\e[A-Z]\fR finds any uppercase letter.  If
the first character given in the brackets is \fB^\fR, then JOE tries to find
any character not given in the the brackets.

.IP \fB\ec
This works like \fB\e*\fR, but matches a balanced C-language expression.
For example, if you search for \fBmalloc(\ec)\fR, then JOE will find all
function calls to \fBmalloc\fR, even if there was a \fB)\fR within the
parenthesis.

.IP \fB\e+
This finds zero or more of the character which immediately follows the
\fB\e+\fR.  For example, if you give \fB\e[ ]\e+\e[ ]\fR, where the
characters within the brackets are both SPACE and TAB, then JOE will find
whitespace.

.IP \fB\e\e
Matches a single \e.

.IP \fB\en
This finds the special end-of-line or line-break character.

.PP
A number of special character sequences may also be given in the replacement
string:

.IP \fB\e&
This gets replaced by the text which matched the search string.  For
example, if the search string was \fB\e<\e*\e>\fR, which matches words, and
you give \fB"\e&"\fR, then joe will put quote marks around words.

.IP \fB\e0\ -\ \e9
These get replaced with the text which matched the Nth \fB\e*\fR, \fB\e?\fR,
\fB\e+\fR, \fB\ec\fR, \fB\e+\fR, or \fB\e[...]\fR in the search string.

.IP \fB\e\e
Use this if you need to put a \fB\e\fR in the replacement string.

.IP \fB\en
Use this if you need to put a line-break in the replacement string.
.PP
Some examples:

Suppose you have a list of addresses, each on a separate line, which starts
with "Address:" and has each element separated by commas.  Like so:

Address: S. Holmes, 221b Baker St., London, England

If you wanted to rearrange the list, to get the country first, then the
city, then the person's name, and then the address, you could do this:

Type \fB^K F\fR to start the search, and type:

\fBAddress:\e*,\e*,\e*,\e*\e$\fR

to match "Address:", the four comma-separated elements, and then the end of
the line.  When asked for options, you would type \fBr\fR to replace the
string, and then type:

\fBAddress:\e3,\e2,\e0,\e1\fR

To shuffle the information the way you want it. After hitting return, the
search would begin, and the sample line would be changed to:

Address: England, London, S. Holmes, 221b Baker St.


.SS Blocks

If you want to move, copy, save or delete a specific section of text, you
can do it with highlighted blocks.  First, move the cursor to the start of
the section of text you want to work on, and press \fB^K B\fR.  Then move
the cursor to the character just after the end of the text you want to
affect and press \fB^K K\fR.  The text between the \fB^K B\fR and \fB^K K\fR
should become highlighted.  Now you can move your cursor to someplace else
in your document and press \fB^K M\fR to move the highlighted text there.
You can press \fB^K C\fR to make a copy of the highlighted text and insert
it to where the cursor is positioned.  \fB^K Y\fR to deletes the highlighted
text.  \fB^K W\fR, writes the highlighted text to a file.

A very useful command is \fB^K /\fR, which filters a block of text through a
unix command.  For example, if you select a list of words with \fB^K B\fR
and \fB^K K\fR, and then type \fB^K / sort\fR, the list of words will be
sorted.  Another useful unix command for \fB^K /\fR, is \fBtr\fR.  If you
type \fB^K / tr a-z A-Z\fR, then all of the letters in the highlighted block
will be converted to uppercase.

After you are finished with some block operations, you can just leave the
highlighting on if you don't mind it (of course, if you accidentally hit
\fB^K Y\fR without noticing...).  If it really bothers you, however, just
hit \fB^K B ^K K\fR, to turn the highlighting off.

.SS Indenting program blocks
Auto-indent mode toggled with the \fB^T I\fR command.  The
\fBjoerc\fR is normally set up so that files with names ending with .p, .c
or .h have auto-indent mode enabled.  When auto-indent mode is enabled and
you hit \fBReturn\fR, the cursor will be placed in the same column that the
first non-SPACE/TAB character was in on the original line.

You can use the \fB^K ,\fR and \fB^K .\fR commands to shift a block of text
to the left or right.  If no highlighting is set when you give these
commands, the program block the cursor is located in will be selected, and
will be moved by subsequent \fB^K ,\fR and \fB^K .\fR commands.  The number
of columns these commands shift by can be set through a \fB^T\fR option.

.SS Windows
You can edit more than one file at the same time or edit two or more
different places of the same file.  To do this, hit \fB^K O\fR, to split the
screen into two windows.  Use \fB^K P\fR or \fB^K N\fR to move the cursor
into the top window or the lower window.  Use \fB^K E\fR to edit a new
file in one of the windows.  A window will go away when you save the file
with \fB^K X\fR or abort the file with \fB^C\fR.  If you abort a file which
exists in two windows, one of the window goes away, not the file.

You can hit \fB^K O\fR within a window to create even more windows.  If you
have too many windows on the screen, but you don't want to eliminate them,
you can hit \fB^K I\fR.  This will show only the window the cursor is in, or
if there was only one window on the screen to begin with, try to fit all
hidden windows on the screen.  If there are more windows than can fit on
the screen, you can hit \fB^K N\fR on the bottom-most window or \fB^K P\fR
on the top-most window to get to them.

If you gave more than one file name to JOE on the command line, each file
will be placed in a different window.

You can change the height of the windows with the \fB^K G\fR and \fB^K T\fR
commands.

.SS Keyboard macros

Macros allow you to record a series of keystrokes and replay them with the
press of two keys.  This is useful to automate repetitive tasks.  To start a
macro recording, hit \fB^K [\fR followed by a number from 0 to 9.  The
status line will display (Macro n recording...).  Now, type in the series of
keystrokes that you want to be able to repeat.  The commands you type will
have their usual effect. Hit \fB^K ]\fR to stop recording the macro.  Hit
\fB^K\fR followed by the number you recorded the macro in to execute one
iteration of the key-strokes.

For example, if you want to put "**" in front of a number of lines, you can
type:

\fB^K [ ^A ** \fR<down arrow> \fB^K ]\fR

Which starts the macro recording, moves the cursor to the beginning of the
line, inserts "**", moves the cursor down one line, and then ends the
recording. Since we included the key-strokes needed to position the cursor
on the next line, we can repeatedly use this macro without having to move
the cursor ourselves, something you should always keep in mind when
recording a macro.

If you find that the macro you are recording itself has a repeated set of
key-strokes in it, you can record a macro within the macro, as long as you
use a different macro number.  Also you can execute previously recorded
macros from within new macros.


.SS Repeat
You can use the repeat command, \fB^K \e\fR, to repeat a macro, or any other
edit command or even a normal character, a specified number of times.  Hit
\fB^K \e\fR, type in the number of times you want the command repeated and
press \fBReturn\fR.  The next edit command you now give will be repeated
that many times.

For example, to delete the next 20 lines of text, type:

\fB^K \ 20\fR<return>\fB^Y\fR

.SS Rectangle mode
Type \fB^T X\fR to have \fB^K B\fR and \fB^K K\fR select rectangular blocks
instead of stream-of-text blocks.  This mode is useful for moving, copying,
deleting or saving columns of text.  You can also filter columns of text
with the \fB^K /\fR command- if you want to sort a column, for example.  The
insert file command, \fB^K R\fR is also effected.

When rectangle mode is selected, over-type mode is also useful
(\fB^T T\fR).  When over-type mode is selected, rectangles will replace
existing text instead of getting inserted before it.  Also the delete block
command (\fB^K Y\fR) will clear the selected rectangle with SPACEs and TABs
instead of deleting it.  Over-type mode is especially useful for the filter
block command (\fB^K /\fR), since it will maintain the original width of the
selected column.

.SS Tag search
If you are editing a large C program with many source files, you can use the
\fBctags\fR program to generate a \fBtags\fR file.  This file contains a
list of program symbols and the files and positions where the symbols are
defined.  The \fB^K ;\fR command can be used to lookup a symbol (functions,
defined constants, etc.), load the file where the symbol is defined into the
current window and position the cursor to where the symbol is defined.
\fB^K ;\fR prompts you for the symbol you want, but uses the symbol the
cursor was on as a default.  Since \fB^K ;\fR loads
the definition file into the current window, you probably want to split the
window first with \fB^K O\fR, to have both the original file and the
definition file loaded.

.SS Shell windows
Hit \fB^K '\fR to run a command shell in one of JOE's windows.  When the
cursor is at the end of a shell window (use \fB^K V\fR if it's not),
whatever you type is passed to the shell instead of the window.  Any output
from the shell or from commands executed in the shell is appended to the
shell window (the cursor will follow this output if it's at the end of the
shell window).  This command is useful for recording the results of shell
commands- for example the output of \fBmake\fR, the result of \fBgrep\fRping
a set of files for a string, or directory listings from \fBFTP\fR sessions.
Besides typeable characters, the keys ^C, Backspace, DEL, Return and ^D are
passed to the shell.  Type the shell \fBexit\fR command to stop recording
shell output.  If you press \fB^C\fR in a shell window, when the cursor is
not at the end of the window, the shell is \fBkill\fRed.

.SH \fBEnvironment\ variables

For JOE to operate correctly, a number of other environment settings must be
correct.  The throughput (baud rate) of the connection between the computer
and your terminal must be set correctly for JOE to update the screen
smoothly and allow typeahead to defer the screen update.  Use the \fBstty
nnn\fR command to set this.  You want to set it as close as possible to
actual throughput of the connection.  For example, if you are connected via
a 1200 baud modem, you want to use this value for \fBstty\fR.  If you are
connected via 14.4k modem, but the terminal server you are connected to
connects to the computer a 9600 baud, you want to set your speed as 9600
baud.  The special baud rate of 38400 or \fBextb\fR is used to indicate that
you have a very-high speed connection, such as a memory mapped console or an
X-window terminal emulator.  If you can't use \fBstty\fR to set the actual
throughput (perhaps because of a modem communicating with the computer at a
different rate than it's communicating over the phone line), you can put a
numeric value in the \fBBAUD\fR environment variable instead (use \fBsetenv
BAUD 9600\fR for csh or \fBBAUD=9600; export BAUD\fR for sh).

The \fBSHELL\fR or \fBEXECSHELL\fR environment variable must be set to the
full pathname of a shell executable that accepts the \-i (interactive) and
\-c (run a command) arguments of the Korn Shell; otherwise, \fB/bin/sh\fR
is used.

The \fBTERM\fR environment variable must be set to the type of terminal
you're using.  If the size (number of lines/columns) of your terminal is
different from what is reported in the TERMCAP or TERMINFO entry, you can
set this with the \fBstty rows nn cols nn\fR command, or by setting the
\fBLINES\fR and \fBCOLUMNS\fR environment variables.

The \fBxterm\-xfree86\fR terminal allows automatic entering and leaving
of the bracketed paste mode.

The \fBJOETERM\fR environment variable may be set to override the regular
\fBTERM\fR environment variable for specifying your terminal type.

JOE uses two character maps for its operation: the terminal I/O character
map, which determines how characters are sent to the terminal and whether
the %a/%A message specifiers use UCS, and the file encoding, which can
be specified per file using the \fB\-encoding\fR option and changed with
the \fB^T E\fR command, and which defaults to the terminal I/O character
map, which, in turn, is determined from the current locale, if the system
supports such, otherwise the \fBLC_ALL\fR, \fBLC_CTYPE\fR and \fBLANG\fR
environment variables (if they contain a period, only the part after it
and before an optional "at sign" is used); on cygwin32 before 1.7.2, the
codepage is used instead if the POSIX locale environment variables are
empty; the environment variable \fBJOECHARMAP\fR can be used to manually
force one overriding all methods described above, and can be used together
with \fB\-encoding\fR to specify a different default file character map.

JOE normally expects that flow control between the computer and your
terminal to use ^S/^Q handshaking (I.E., if the computer is sending
characters too fast for your terminal, your terminal sends ^S to stop the
output and ^Q to restart it).  If the flow control uses out-of-band or
hardware handshaking or if your terminal is fast enough to always keep up
with the computer output and you wish to map ^S/^Q to edit commands, you can
set the environment variable \fBNOXON\fR to have JOE attempt to turn off
^S/^Q handshaking.  If the connection between the computer and your terminal
uses no handshaking and your terminal is not fast enough to keep up with the
output of the computer, you can set the environment variable \fBDOPADDING\fR
to have \fBJOE\fR slow down the output by interspersing PAD characters
between the terminal screen update sequences.

.SH Filenames
Wherever JOE expects you to enter a file name, whether on the command line
or in prompts within the editor, you may also type:

.IP \fB!command
Read or write data to or from a shell command.  For example,
use \fBjoe '!ls'\fR to get a copy of your directory listing to edit or from
within the editor use \fB^K D !mail jhallen@world.std.com\fR to send the
file being edited to me.

.IP \fB>>filename
Use this to have JOE append the edited text to the end of the file
"filename."

.IP \fBfilename,START,SIZE
Use this to access a fixed section of a file or device.  \fBSTART\fR and
\fBSIZE\fR may be entered in decimal (ex.: 123) octal (ex.: 0777) or
hexadecimal (ex.: 0xFF).  For example, use \fBjoe /dev/fd0,508,2\fR to edit
bytes 508 and 509 of the first floppy drive in Linux.

.IP \fB\-
Use this to get input from the standard input or to write output to the
standard output.  For example, you can put joe in a pipe of commands:
\fBquota \-v | joe \- | mail root\fR, if you want to complain about your low
quota.


.SH The\ joerc file
\fB^T\fR options, the help screens and the key-sequence to editor command
bindings are all defined in JOE's initialisation file.
If you make a copy of this file (@joeinitcopy@) to \fB$HOME/.joerc\fR,
you can customise these settings to your liking.
The syntax of the initialisation file should be fairly obvious,
and there are further instruction in it.

.SH Acknowledgments
JOE was written by Joseph H. Allen.
If you have bug reports or questions, e-mail them to jhallen@world.std.com.
Larry Foard (entropy@world.std.com) and Gary Gray (ggray@world.std.com)
also helped with the creation of JOE.
Thorsten "mirabilos" Glaser (tg@mirbsd.org) created JUPP, and the 16-bit MS-DOS
version of JUPP 2.8 was compiled by Andreas Totlis (atotlis@t-online.de).

.SH Bugs
This manual page describes only the JOE flavour; documentation for JUPP is
especially missing.