Index   File selector   File menu   Other menus

Command lines and the Edith Pro server

Command lines and the Edith Pro server

Clients, servers and forks

When the Edith program is first run on your X workstation or terminal, it will respond with a message like Starting Edith Pro server on display :0. Even though the command will finish immediately, Edith will continue to run on your display. On any subsequent times you call the Edith program, instead of starting another copy of the program, the newly run copy will consider itself a client, send a message to the copy that is already running (the server), and then exit.

This ensures that all Edith windows on an X display behave coherently; e.g. the panels for changing colours and fonts will apply to all active editor windows. It also helps to avoid editing the same file twice in different windows.

If you want to use Edith as a standard editor, you will want other applications to run it, like a mailer program. These programs usually call an editor and assume it will not terminate before the user finished editing the file. Therefore Edith provides the command line option -w, which will cause the program to wait until the window for the file following -w is closed. Meanwhile, other files can be edited without any problems.

Use the special shell script edivisual for installing Edith as a default editor; it is equivalent in synopsis to the vi editor, and in fact, if the DISPLAY variable is not set, e.g. because you are working from a telnet or modem connection, it will run vi instead. edivisual makes use of the -w option. Another shell script called edimore is the counterpart of more; it makes use of the command line option -c which merely checks that the Edith server has loaded the file before exiting.

Expert If you are sharing an X display between more than one user, you may have problems with file permissions, as the Edith server is started by user 1, and subsequent Edith calls by user 2 will be sent to the server started by user 1, which does not have full permissions for user 2's files. There are two solutions to this problem. The first is to give each user's copy of Edith a different resource name. To do this, put the following lines in the different user's .cshrc (or similar) files:

/home/user1/.cshrc: alias edith 'edith -name edithUser1'
/home/user2/.cshrc: alias edith 'edith -name edithUser2'

A more rigorous, discouraged approach is to disable the client-server protocol by specifying the command line option -nofork.

The editor master panel

The editor master panel is the small window with a menu bar and a number of icons you see when you start the Edith server by typing edith at the shell prompt. During your Edith session, this window will always be present, be it most likely as an icon.

Command line options

A command line can be given to the Edith program, regardless of whether the
edith server is already running. You can also type arbitrary command lines in the file selector.

An Edith command line typically consists of a number of file names, optionally followed by a specification of a position within the file. Binary files can be opened by prefixing -b to the file name. To open a file or URL into a browser window, prefix -l to the name of the file or location.

EXAMPLES

edith /home/wanda/.Xdefaults +35,-12
will open .Xdefaults in Wanda's home directory, mark the 35th line from the top of the file, the 12th line from the bottom of the file, and move to line 35.
edith .cshrc +/setenv/
will open the file .cshrc, and jump to the first occurrence of the word setenv in that file.
edith main.c:330
A colon has the same effect as a plus sign (but is immediately appended to the file name).
edith main.c:?draw_border?'
' Opens file main.c and jumps to the last occurrence of the word draw_border in that file.
edith -ba.out
Opens file a.out into a binary editing window.
edith -lhttp://www.nl.net/~zfc/
Opens a URL, in this case the ZFC home page.

OPTIONS

The following options can be put anywhere between the list of files.
-display, -iconic, -name
Equivalent to the standard X options
-cfile
Open file and do not return until its window is open. Ignored when used from the file selector; if used more than once on the same command line, only the first occurrence is interpreted.
-wfile
As -c, but after opening the file, also wait for its window to be closed. This corresponds to the way a standard Unix editor like vi, that doesn't run in the background, works.
-nofork
Don't use client/server protocol; the use of this option is discouraged (see above).
Sequences like -c-lfile and -w-bfile are allowed.
Index   File selector   File menu   Other menus