{The jmore File Viewer

Introduction
The jmore application is an X Windows version of more(1) - an application that lets you page through one or more specified files or standard input.  It is written in wish, an X Windows scripting language based on the Tk toolkit and the Tcl scripting library (all three by John Ousterhout of Sun Microsystems).

A preferences panel and a separate preferences application let you configure its appearance, and you can further customise its behaviour via a startup file written in Tcl.

The jmore application is essentially a wrapper around the j:more panel defined in the jmore.tcl library.  (This is responsible for some of its limitations.)

The jmore file viewer is distributed as part of the jstools package.

This help file describes jmore version 4.1/4.4.

Copyright and contact information is available in the jstools documentation.

Invocation
	jmore [filename]...
or
	jmore -prefs

To view a file, type `jmore filename' at the Unix shell prompt, assuming jmore is in your path.  You'll get an error message if the file doesn't exist.

You can specify several files on the command line; each will be displayed in its own window.

If you don't specify any files on the command line, jmore will read its standard input until end­of­file, and then display it.  (Thus, jmore can be used at the end of a pipe, or specified as a pager for other applications.)

If you invoke jmore with the -prefs flag, then instead of displaying files jmore will present you with a preferences panel (described below) that lets you set preferences.  The preferences you choose will take effect the next time you use jmore.

If a filename ends in the extension .jrt, it is assumed to be a jedit rich­text file as described in The `richtext' Mode, and it will be displayed with formatting intact.  It will also be displayed as rich­text if it ends in the extension .jdoc, used for jdoc documents - these support a superset of rich­text formatting, including hypertext links, but jmore only supports those formatting features that are shared with jedit's rich­text mode.

Viewing the Text
You can't edit the text displayed in a jmore window, but you can select it.

If it's longer than one screenful, you can scroll it with the scrollbar.  You can also scroll from the keyboard: pressing Space, Next or PageDown, or Control-v will scroll the text down, and pressing b, Prior or PageUp, or Escape-v will scroll the text up.

Using the Buttons
At the bottom of each jmore window are four buttons: `Close', `Save', `Print', and `Find...'.

Close
This button closes the window.  If it's the last (or only) jmore window, it also quits jmore.  The Close button is the default button, so just pressing Return will invoke it.

Save
This button brings up a File Selector panel that prompts you for the name of a file to save the contents of the window to.

Print
After asking for confirmation, this button prints the contents of the window (using the Unix lpr command) to the printer you have selected on the Global Preferences panel.  (See Preferences and Invocation on how to bring up the Global Preferences panel.)

Find...
This button brings up a panel that lets you search for text in the window.  Note that the Find panel searches from the position of an invisible `insert point' in the text window.  This can be confusing.  If you can't find something you think should be there, try scrolling to the top of the window and clicking the mouse at the beginning of the text.

Preferences
File Viewer Preferences...
When you invoke the file viewer with the -prefs flag, it displays a preferences panel.  At the bottom of the panel are two buttons, `Save', which saves the current settings on the File Viewer Preferences panel and quits, and `Global Preferences', which brings up the jstools Global Preferences panel.  The Save button is the default button, so you can just press Return to invoke it.

The three radio buttons labelled `Don't wrap lines', `Wrap lines on character boundaries', and `Wrap lines at word boundaries' control how lines which are longer than the width of the window are displayed.  They should be fairly self­explanatory.  (Rich­text files are always displayed with lines wrapped at word boundaries, regardless of the setting of this preference.)

The `Font:' field lets you choose what font is used to display the text you're viewing.  You can type in an X font specification, or click the `Choose...' button to select a font visually using the xfontsel(1X11) application.  (Use xfontsel's menus to choose a font based on its various attributes, such as size and weight, and click xfontsel's `Quit' button to enter the font you have chosen into the editor's `Font:' field.)  You can click the `Default' button to set the font field to `default', which means to use the X default font (using the X default specification `Tk*Font:'), or 12­point Courier if there is no X default.  See the man page for the X server, often X(1X11), for more information about X font specifications and X defaults.

The `Width:' and `Height:' fields let you change the width (in columns) and height (in characters) of viewer windows.

File viewer preferences are stored in the file ~/.tk/jmore-defaults.  (Global preferences are saved in the file ~/.tk/defaults.)

Customising jmore
jmore supports the standard jstools customisation mechanisms.  You should consult the document Customising jstools Applications as well as the description below.

The ~/.tk/jmorerc.tcl startup script
The file ~/.tk/jmorerc.tcl can contain Tcl code to customise your file viewing environment.  At present, it isn't very useful, because the structure of the application makes it hard to customise the user interface.  I hope to add hooks in a future version to make it easier to customise jmore; for instance, to let you add buttons, or run filters on files before displaying them.

Sample files
If jmore was installed normally at your site, the directory /usr/local/lib/jstools/samples should contain some example files which you can copy, rename appropriately, and modify to your liking.  (You may also find it useful to look at the jmore script itself, and for information about Tcl syntax you should consult the various Tcl and Tk man pages.)

Bugs and Misfeatures
* If there's a Find panel displayed when you close the last file viewer window, the application doesn't quit.

* The -prefs flag is a silly kludge.  There should be a `Prefs...' button or some such.

* The behaviour of the Find panel (searching from an invisible insert point) is confusing.

Future Directions
* There should be more preferences, for such things as colours.

* There should be a -class or -mode command­line option, so, for instance, copies of jmore being used as pagers for mail can be visually distinct from other invocations of jmore.

* A menu might be nice.

* I want to standardise bindings for non­editable text widgets and put them in the bindings libraries in some fashion.

* I want to put in hooks that the user can redefine in ~/.tk/jmorerc.tcl for things like filtering files as they're read or adding buttons (which latter will depend on adding j:more:button to jmore.tcl).

* When reading from standard input, jmore should display data as it's received, rather than just showing it all at the end.  (I.e., it should do what tail -f does.)

* The Find panel should work differently; it should highlight all the found strings, and then let you jump back and forth among them.
} {{{jdoc:anchor:anchorname {3.0 4.0 16.0 17.0 31.0 32.0 36.0 37.0 51.0 53.0 63.0 64.0}} {sel {12.39 12.46}} {jdoc:xref:link {6.0 6.19 6.24 6.58 8.86 8.95 10.52 10.59 14.0 14.33 14.50 14.75 27.103 27.122 29.64 29.69 29.101 29.120 29.255 29.259 43.24 43.43 46.178 46.189 46.194 46.204 53.263 53.299 64.15 64.60 64.95 64.127 88.192 88.201}} {jdoc:xref:manpage {4.49 4.53 57.198 57.206 57.232 57.240 57.334 57.342 57.673 57.674}} {richtext:font:roman {2.0 3.0 4.0 4.4 4.9 4.49 4.53 4.166 4.170 8.4 8.9 8.58 8.64 8.86 8.95 10.4 10.9 10.52 10.59 12.25 12.30 14.54 14.61 16.0 17.7 17.8 17.16 19.0 19.13 21.22 21.36 21.73 21.78 25.52 25.57 25.135 25.140 27.14 27.19 27.29 27.35 27.75 27.80 27.239 27.244 29.36 29.40 29.64 29.69 29.101 29.120 29.239 29.244 29.255 29.259 29.353 29.358 29.420 29.425 31.0 32.0 32.39 32.44 34.122 34.127 34.129 34.133 34.137 34.145 34.150 34.159 34.200 34.201 34.203 34.208 34.212 34.218 34.223 34.231 36.0 37.0 37.22 37.27 39.0 40.0 40.59 40.64 40.87 40.92 40.152 40.158 42.0 43.0 45.0 46.0 46.93 46.96 46.178 46.189 46.194 46.204 48.0 49.0 51.0 53.0 53.41 53.47 53.267 53.274 53.363 53.369 57.198 57.206 57.232 57.240 57.334 57.342 57.489 57.496 57.573 57.581 57.673 57.674 61.47 61.67 61.112 61.126 63.0 64.5 64.28 64.35 64.95 64.127 66.0 67.0 67.9 67.26 67.203 67.204 67.287 67.292 69.0 70.0 70.3 70.8 70.60 70.90 70.239 70.244 72.0 73.0 75.6 75.12 79.0 80.0 82.20 82.26 82.30 82.35 82.85 82.90 82.172 82.177 88.55 88.72 88.175 88.188 88.192 88.201 90.36 90.41 90.150 90.157 93.0}} {richtext:font:italic {17.8 17.16 21.28 21.36}} {richtext:font:bold {8.86 8.95 10.52 10.59 14.54 14.61 29.36 29.40 29.239 29.244 34.122 34.127 34.129 34.133 34.137 34.145 34.150 34.159 34.200 34.201 34.203 34.208 34.212 34.218 34.223 34.231 40.152 40.158 53.267 53.274 53.363 53.369 61.47 61.67 61.112 61.126 64.28 64.35 67.9 67.26 67.203 67.204 70.60 70.90 88.55 88.72 88.192 88.201}} {richtext:font:bolditalic {29.101 29.120 46.178 46.189 46.194 46.204 64.95 64.127}} {richtext:font:typewriter {4.4 4.9 4.49 4.53 4.166 4.170 8.4 8.9 8.58 8.64 10.4 10.9 12.25 12.30 17.0 17.7 19.0 19.13 21.22 21.28 21.73 21.78 25.52 25.57 25.135 25.140 27.14 27.19 27.29 27.35 27.75 27.80 27.239 27.244 29.64 29.69 29.255 29.259 29.353 29.358 29.420 29.425 32.39 32.44 37.22 37.27 40.59 40.64 40.87 40.92 46.93 46.96 53.41 53.47 57.198 57.206 57.232 57.240 57.334 57.342 57.489 57.496 57.573 57.581 57.673 57.674 64.0 64.5 67.287 67.292 70.3 70.8 70.239 70.244 75.6 75.12 82.20 82.26 82.30 82.35 82.85 82.90 82.172 82.177 88.175 88.188 90.36 90.41 90.150 90.157}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {3.0 4.0 16.0 17.0 31.0 32.0 36.0 37.0 51.0 52.0 63.0 64.0 72.0 73.0 79.0 80.0}} {richtext:font:heading2 {39.0 40.0 42.0 43.0 45.0 46.0 48.0 49.0 52.0 53.0 66.0 67.0 69.0 70.0}} {jdoc:manpage:more {4.49 4.53}} {jdoc:topic:jmore.tcl {8.86 8.95 88.192 88.201}} {jdoc:section:Preferences {46.178 46.189}} {jdoc:section:Invocation {46.194 46.204}} {jhelp:manpage:xfontsel {57.198 57.206 57.232 57.240 57.334 57.342}} {jdoc:topic:jstools {10.52 10.59}} {jdoc:manpage:X {57.673 57.674}} {jdoc:link:jmore.tcl.jdoc {8.86 8.95 88.192 88.201}} {jdoc:link:jstools.jdoc {10.52 10.59 14.50 14.75}} {jdoc:anchorname:Preferences {51.0 52.0}} {jdoc:anchorname:File_Viewer_Preferences {52.0 53.0}} {jdoc:link:#File_Viewer_Preferences {27.103 27.122}} {jdoc:link:jprefs.jdoc {6.24 6.58}} {jdoc:link:#Preferences {46.178 46.189}} {jdoc:link:#Invocation {46.194 46.204}} {jdoc:anchorname:Invocation {16.0 17.0}} {jdoc:link:panels/fileselector.jdoc {43.24 43.43}} {jdoc:link:panels/prefs.jdoc {6.0 6.19 53.263 53.299}} {jdoc:anchorname:Introduction {3.0 4.0}} {jdoc:anchorname:Viewing_the_Text {31.0 32.0}} {jdoc:anchorname:Using_the_Buttons {36.0 37.0}} {jdoc:anchorname:Customising_jmore {63.0 64.0}} {jdoc:link:jstools/customisation.jdoc {64.15 64.60 64.95 64.127}} {jdoc:link:jstools.jdoc#Credits_and_Copyright {14.0 14.33}} {jdoc:link:jeditmodes/richtext-mode.jdoc {29.101 29.120}} {jdoc:link:jedit.jdoc {29.64 29.69}} {jdoc:link:jdoc.jdoc {29.255 29.259}}} {{del_from 69.0} {abbrevstart 70.75} {abbrevend 70.90} {insert 12.46} {anchor 1.0} {del_to 70.31} {current 11.0}}} {}