xmh lets you edit draft messages and other messages too. Here are some tips about editing in xmh. The following sections describe common editing commands, using buttons in a composition window, line wrapping, and copying and pasting text between windows.
The composition window uses a set of editing commands that are a subset of GNU Emacs editor commands. All of the text editing commands actually come from the Athena Text widget. Most of the commands are control characters and meta-characters. The next two Tables, xmh Text Editing Commands: Modifying and xmh Text Editing Commands: Moving, list editing commands. The tables are adapted from the X Toolkit Athena Text widget manual page. There's a summary of these commands in the xmh Reference Guide, Table 8.
Table: xmh Text Editing Commands: Modifying
Table: xmh Text Editing Commands: Moving
Pressing CTRL-S in an editable window pops up a search-and-replace window like the one in the Figure below.
If the text in the window can't be edited (for example, it's displaying a message), you can search but not replace. The search moves forward -- that is, from the top of the file toward the end. To move backward, start with CTRL-R or click the Backward button.
Figure: Search and replace pop-up window
When you compose, forward, or reply to a message, a composition window opens. The functions of buttons at the bottom of the window may seem obvious, but three of them could use more explanation:
Closing the window leaves the draft message in your drafts folder -- if you've saved the draft at least once before. You can come back to it later by opening the drafts folder in a main window, selecting the draft message that you want to work on, and selecting Use as Composition or Edit Message.
To neaten the lines in a paragraph you're editing, press META-Q. The lines will fill neatly, broken at the spaces between words closest to the right margin. To me, this makes the lines a little too wide for people to include them neatly in their replies. If I'll be reformatting paragraphs, I resize my window to a 65-character width first.
There's one "gotcha" with META-Q. If you press it in the first paragraph of a message, just under the header, it will reformat the header, too. The Figure below shows the mess you'll get.
Figure: META-Q reformatting mistake
An easy fix is to put a blank line before the paragraph before typing META-Q. I couldn't train myself to do that. So, instead, I changed my components draft file and replaced the row of dashes with a blank line. I start typing at the end of the draft, as always, but now there's no row of dashes that joins the header to the paragraph.
When you're typing an original mail message or adding text to an existing one, each line you type will wrap automatically. That is, until you press RETURN, the words on all the lines will be adjusted to fit neatly between margins. To start a new paragraph, simply press RETURN (twice to make a blank line). When you send the message, text in each paragraph is broken into lines -- it's not necessarily broken the way it looks in your window. You can make two settings that affect the way lines are broken. Here's what they do:
You can tell xmh to cut the line width for you by putting new values of SendBreakWidth and/or SendWidth in the message header. In the composition window, add the new field(s) to the header the same way that you'd insert new lines in the body. (Be sure not to leave any empty lines in the header, though.) For example, to set SendBreakWidth and SendWidth at 60 characters each, make your header look something like this:
SendWidth: 60 SendBreakWidth: 60 To: joed Cc: angelac Subject: Section of xmh(1) manual page you asked forxmh takes those special fields out of the header before sending the message.
You can copy text from one window into another or within a window. For instance, let's say that you have an xterm window open and it's showing an error message. You can mail a copy of that error to the software maintainers by copying it into an xmh composition window.
Here are the steps to use for copying text from one window to another:
Or you can point to the first character -- then, hold down the first button and drag the pointer across the other text you want -- release the first button when you've selected all the text. Again, the selected text should be in reverse video.
If you can't get it to work, be sure that your pointer is inside the window border. Also, you can't copy text from every window on your screen -- some won't let you copy.
If you accidentally click the first mouse button before you copy the text, you'll need to reselect the text and try again.
If you'd like to try a different text editor with xmh and you have access to the X Release 5 source code, look in the directory contrib/clients/xmh.editor. This contains patches to the xmh code that allow, among other things, you to choose your own editor.
For example, the patch would let you add an entry like one of the two below to your resource file. The first one chooses the gnu editor; the second opens an xterm window running vi:
Xmh.editorCommand: gnu -i -w 80x35+100+20 %s Xmh.editorCommand: xterm -e vi %sIf you haven't patched X source code, ask your system administrator. There's not room in this book to explain how...
If you can't patch the source code, there's another way to use an external editor -- though it's clumsy. The new XmhShellCommand() action can start an external editor. The Section Use an External Editor shows how.
This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. It is freely available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see COPYING.
Copyright © 1991, 1992, 1995 O'Reilly Media, Inc.
Last modified: 2006-05-31 15:13:43 -0700