| 1 | @comment{-*- Dictionary: target:scribe/hem/hem; Mode: spell; Package: Hemlock -*-}
|
|---|
| 2 | @chap[Introduction]
|
|---|
| 3 |
|
|---|
| 4 | @hemlock is a text editor which follows in the tradition of @emacs
|
|---|
| 5 | and the Lisp Machine editor ZWEI. In its basic form, @hemlock has almost
|
|---|
| 6 | the same command set as ITS/TOPS-20 @emacs@foot[In this document, "Emacs"
|
|---|
| 7 | refers to this, the original version, rather than to any of the large
|
|---|
| 8 | numbers of text editors inspired by it which may go by the same name.],
|
|---|
| 9 | and similar features such as multiple windows and extended commands, as
|
|---|
| 10 | well as built in documentation features. The reader should bear in mind
|
|---|
| 11 | that whenever some powerful feature of @hemlock is described, it has
|
|---|
| 12 | probably been directly inspired by @emacs.
|
|---|
| 13 |
|
|---|
| 14 | This manual describes @hemlock@comment{}'s commands and other user visible
|
|---|
| 15 | features and then goes on to tell how to make simple customizations. For
|
|---|
| 16 | complete documentation of the @hemlock primitives with which commands are
|
|---|
| 17 | written, the @i[Hemlock Command Implementor's Manual] is also available.
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | @section[The Point and The Cursor]
|
|---|
| 22 |
|
|---|
| 23 | @index[point]
|
|---|
| 24 | @index[cursor]
|
|---|
| 25 | The @i[point] is the current focus of editing activity. Text typed in by the
|
|---|
| 26 | user is inserted at the point. Nearly all commands use the point as a
|
|---|
| 27 | indication of what text to examine or modify. Textual positions in @hemlock
|
|---|
| 28 | are between characters. This may seem a bit curious at first, but it is
|
|---|
| 29 | necessary since text must be inserted between characters. Although the point
|
|---|
| 30 | points between characters, it is sometimes said to point @i[at] a character, in
|
|---|
| 31 | which case the character after the point is referred to.
|
|---|
| 32 |
|
|---|
| 33 | The @i[cursor] is the visible indication of the current focus of attention: a
|
|---|
| 34 | rectangular blotch under @windows, or the hardware cursor on a terminal. The
|
|---|
| 35 | cursor is usually displayed on the character which is immediately after the
|
|---|
| 36 | point, but it may be displayed in other places. Wherever the cursor is
|
|---|
| 37 | displayed it indicates the current focus of attention. When input is being
|
|---|
| 38 | prompted for in the echo area, the cursor is displayed where the input is to
|
|---|
| 39 | go. Under @windows the cursor is only displayed when @hemlock is waiting
|
|---|
| 40 | for input.
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 | @section[Notation]
|
|---|
| 44 |
|
|---|
| 45 | There are a number of notational conventions used in this manual which need
|
|---|
| 46 | some explanation.
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 | @subsection[Key-events]
|
|---|
| 50 |
|
|---|
| 51 | @label[key-events]
|
|---|
| 52 | @index[key-events, notation]
|
|---|
| 53 | @index[bits, key-event]
|
|---|
| 54 | @index[modifiers, key-event]
|
|---|
| 55 | The canonical representation of editor input is a @i[key-event]. When you type
|
|---|
| 56 | on the keyboard, @hemlock receives key-events. Key-events have names for their
|
|---|
| 57 | basic form, and we refer to this name as a @i[keysym]. This manual displays
|
|---|
| 58 | keysyms in a @bf[Bold] font. For example, @bf[a] and @bf[b] are the keys that
|
|---|
| 59 | normally cause the editor to insert the characters @i[a] and @i[b].
|
|---|
| 60 |
|
|---|
| 61 | Key-events have @i[modifiers] or @i[bits] indicating a special interpretation
|
|---|
| 62 | of the root key-event. Although the keyboard places limitations on what
|
|---|
| 63 | key-events you can actually type, @hemlock understands arbitrary combinations
|
|---|
| 64 | of the following modifiers: @i[Control], @i[Meta], @i[Super], @i[Hyper],
|
|---|
| 65 | @i[Shift], and @i[Lock]. This manual represents the bits in a key-event by
|
|---|
| 66 | prefixing the keysym with combinations of @bf[C-], @bf[M-], @bf[S-], @bf[H-],
|
|---|
| 67 | @bf[Shift-], and @bf[Lock]. For example, @bf[a] with both the control and meta
|
|---|
| 68 | bits set appears as @bf[C-M-a]. In general, ignore the shift and lock
|
|---|
| 69 | modifiers since this manual never talks about keysyms that explicitly have
|
|---|
| 70 | these bits set; that is, it may talk about the key-event @bf[A], but it would
|
|---|
| 71 | never mention @bf[Shift-a]. These are actually distinct key-events, but
|
|---|
| 72 | typical input coercion turns presents @hemlock with the former, not the latter.
|
|---|
| 73 |
|
|---|
| 74 | Key-event modifiers are totally independent of the keysym. This may be new to
|
|---|
| 75 | you if you are used to thinking in terms of ASCII character codes. For
|
|---|
| 76 | example, with key-events you can distinctly identify both uppercase and
|
|---|
| 77 | lowercase keysyms with the control bit set; therefore, @bf[C-a] and @bf[C-A]
|
|---|
| 78 | may have different meanings to @hemlock.
|
|---|
| 79 |
|
|---|
| 80 | Some keysyms' names consist of more than a single character, and these usually
|
|---|
| 81 | correspond to the legend on the keyboard. For example, some keyboards let you
|
|---|
| 82 | enter @bf[Home], @bf[Return], @bf[F9], etc.
|
|---|
| 83 |
|
|---|
| 84 | In addition to a keyboard, you may have a mouse or pointer device. Key-events
|
|---|
| 85 | also represent this kind of input. For example, the down and up transitions of
|
|---|
| 86 | the @i[left button] correspond to the @bf[Leftdown] and @bf[Leftup] keysyms.
|
|---|
| 87 |
|
|---|
| 88 | See sections @ref[key-bindings], @ref[using-x], @ref[using-terminals]
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 | @subsection[Commands]
|
|---|
| 92 |
|
|---|
| 93 | @index[commands]@label[commands]Nearly everything that can be done in
|
|---|
| 94 | @hemlock is done using a command. Since there are many things worth
|
|---|
| 95 | doing, @hemlock provides many commands, currently nearly two hundred.
|
|---|
| 96 | Most of this manual is a description of what commands exist, how they are
|
|---|
| 97 | invoked, and what they do. This is the format of a command's
|
|---|
| 98 | documentation:
|
|---|
| 99 |
|
|---|
| 100 | @defcom[com "Sample Command", bind (C-M-q, C-`)]
|
|---|
| 101 | @begin[quotation, facecode i, leftmargin 8ems, rightmargin 3.5ems,
|
|---|
| 102 | below 0.8 lines]
|
|---|
| 103 | This command's name is @hid[Sample Command], and it is bound to
|
|---|
| 104 | @w(@bf(C-M-q)) and @bf[C-`], meaning that typing either of these will
|
|---|
| 105 | invoke it. After this header comes a description of what the command does:
|
|---|
| 106 | @end[quotation]
|
|---|
| 107 |
|
|---|
| 108 | This command replaces all occurrences following the point of the string
|
|---|
| 109 | "@f[Pascal]" with the string "@f[Lisp]". If a prefix argument is supplied,
|
|---|
| 110 | then it is interpreted as the maximum number of occurrences to replace. If
|
|---|
| 111 | the prefix argument is negative then the replacements are done backwards
|
|---|
| 112 | from the point.
|
|---|
| 113 | @comment<
|
|---|
| 114 | @begin[quotation, facecode i, leftmargin 8ems, rightmargin 3.5ems,
|
|---|
| 115 | above 0.8 lines, below 0.8 lines]
|
|---|
| 116 | Toward the end of the description there may be information primarily of
|
|---|
| 117 | interest to customizers and command implementors. If you don't understand
|
|---|
| 118 | this information, don't worry, the writer probably forgot to speak English.
|
|---|
| 119 | @end[quotation]
|
|---|
| 120 |
|
|---|
| 121 | @b[Arguments:]
|
|---|
| 122 | @begin[description]
|
|---|
| 123 | @i[target]@\The string to replace with "@f[Lisp]".
|
|---|
| 124 |
|
|---|
| 125 | @i[buffer]@\The buffer to do the replacement in. If this is @f[:all] then
|
|---|
| 126 | the replacement is done in all buffers.
|
|---|
| 127 | @end[description]>
|
|---|
| 128 | @enddefcom
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 | @subsection[Hemlock Variables]
|
|---|
| 132 |
|
|---|
| 133 | @index[variables, hemlock]@hemlock variables supply a simple
|
|---|
| 134 | customization mechanism by permitting commands to be parameterized. For
|
|---|
| 135 | details see page @pageref[vars].
|
|---|
| 136 |
|
|---|
| 137 | @defhvar[var "Sample Variable", val {36}]
|
|---|
| 138 | @begin[quotation, facecode i, leftmargin 8ems, below 0.8 lines]
|
|---|
| 139 | The name of this variable is @hid[Sample Variable] and its initial value is
|
|---|
| 140 | 36.
|
|---|
| 141 | @end[quotation]
|
|---|
| 142 | this variable sets a lower limit on the number of replacements that be done
|
|---|
| 143 | by @hid[Sample Command]. If the prefix argument is supplied, and smaller
|
|---|
| 144 | in absolute value than @hid[Sample Variable], then the user is prompted as
|
|---|
| 145 | to whether that small a number of occurrences should be replaced, so as to
|
|---|
| 146 | avoid a possibly disastrous error.
|
|---|
| 147 | @enddefhvar
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 | @section[Invoking Commands]
|
|---|
| 151 | @index[invocation, command]
|
|---|
| 152 | In order to get a command to do its thing, it must be invoked. The user can do
|
|---|
| 153 | this two ways, by typing the @i[key] to which the command is @i[bound] or by
|
|---|
| 154 | using an @i[extended command]. Commonly used commands are invoked via their
|
|---|
| 155 | key bindings since they are faster to type, while less used commands are
|
|---|
| 156 | invoked as extended commands since they are easier to remember.
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 | @subsection[Key Bindings]
|
|---|
| 160 | @index[bindings, key]
|
|---|
| 161 | @index[key bindings]
|
|---|
| 162 | @label[key-bindings]
|
|---|
| 163 | A key is a sequence of key-events (see section @ref[key-events]) typed on the
|
|---|
| 164 | keyboard, usually only one or two in length. Sections @ref[using-x] and
|
|---|
| 165 | @ref[using-terminals] contain information on particular input devices.
|
|---|
| 166 |
|
|---|
| 167 | When a command is bound to a key, typing the key causes @hemlock to invoke the
|
|---|
| 168 | command. When the command completes its job, @hemlock returns to reading
|
|---|
| 169 | another key, and this continually repeats.
|
|---|
| 170 |
|
|---|
| 171 | Some commands read key-events interpreting them however each command desires.
|
|---|
| 172 | When commands do this, key bindings have no effect, but you can usually abort
|
|---|
| 173 | @hemlock whenever it is waiting for input by typing @binding[C-g] (see section
|
|---|
| 174 | @ref[aborting]). You can usually find out what options are available by typing
|
|---|
| 175 | @binding[C-_] or @binding[Home] (see section @ref[help]).
|
|---|
| 176 |
|
|---|
| 177 | The user can easily rebind keys to different commands, bind new keys to
|
|---|
| 178 | commands, or establish bindings for commands never bound before (see section
|
|---|
| 179 | @ref[binding-keys]).
|
|---|
| 180 |
|
|---|
| 181 | In addition to the key bindings explicitly listed with each command, there are
|
|---|
| 182 | some implicit bindings created by using key translations@foot[Key translations
|
|---|
| 183 | are documented in the @i[Hemlock Command Implementor's Manual].]. These
|
|---|
| 184 | bindings are not displayed by documentation commands such as @hid[Where Is].
|
|---|
| 185 | By default, there are only a few key translations. The modifier-prefix
|
|---|
| 186 | characters @bf[C-^], @bf[Escape], @bf[C-z], or @bf[C-c] may be used when typing
|
|---|
| 187 | keys to convert the following key-event to a control, meta, control-meta, or
|
|---|
| 188 | hyper key-event. For example, @bf[C-x Escape b] invokes the same commands as
|
|---|
| 189 | @bf[C-x M-b], and @bf[C-z u] is the same as @bf[C-M-u]. This allows user to
|
|---|
| 190 | type more interesting keys on limited keyboards that lack control, meta, and
|
|---|
| 191 | hyper keys.
|
|---|
| 192 | @index[bit-prefix key-events]
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 | @defhvar[var "Key Echo Delay", val {1.0}]
|
|---|
| 196 | A key binding may be composed of several key-events, especially when you enter
|
|---|
| 197 | it using modifier-prefix key-events. @hemlock provides feedback for partially
|
|---|
| 198 | entered keys by displaying the typed key-events in the echo area. In order to
|
|---|
| 199 | avoid excessive output and clearing of the echo area, this display is delayed
|
|---|
| 200 | by @hid[Key Echo Delay] seconds. If this variable is set to @nil, then
|
|---|
| 201 | @hemlock foregoes displaying initial subsequences of keys.
|
|---|
| 202 | @enddefhvar
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 | @subsection[Extended Commands]
|
|---|
| 206 |
|
|---|
| 207 | @index[commands, extended]A command is invoked as an extended command by
|
|---|
| 208 | typing its name to the @hid[Extended Command] command, which is invoked
|
|---|
| 209 | using its key binding, @binding[M-x].
|
|---|
| 210 |
|
|---|
| 211 | @defcom[com "Extended Command", bind {M-x}]
|
|---|
| 212 | This command prompts in the echo area for the name of a command, and then
|
|---|
| 213 | invokes that command. The prefix argument is passed through to the command
|
|---|
| 214 | invoked. The command name need not be typed out in full, as long as enough
|
|---|
| 215 | of its name is supplied to uniquely identify it. Completion is available
|
|---|
| 216 | using @binding[Escape] and @binding[Space], and a list of possible completions
|
|---|
| 217 | is given by @binding[Home] or @binding[C-_].
|
|---|
| 218 | @enddefcom
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 | @section[The Prefix Argument]
|
|---|
| 222 |
|
|---|
| 223 | @index[prefix argument]The prefix argument is an integer argument which
|
|---|
| 224 | may be supplied to a command. It is known as the prefix argument because
|
|---|
| 225 | it is specified by invoking some prefix argument setting command
|
|---|
| 226 | immediately before the command to be given the argument. The following
|
|---|
| 227 | statements about the interpretation of the prefix argument are true:
|
|---|
| 228 | @begin[itemize]
|
|---|
| 229 | When it is meaningful, most commands interpret the prefix argument as a
|
|---|
| 230 | repeat count, causing the same effect as invoking the command that many
|
|---|
| 231 | times.
|
|---|
| 232 |
|
|---|
| 233 | When it is meaningful, most commands that use the prefix argument interpret
|
|---|
| 234 | a negative prefix argument as meaning the same thing as a positive
|
|---|
| 235 | argument, but the action is done in the opposite direction.
|
|---|
| 236 |
|
|---|
| 237 | Most commands treat the absence of a prefix argument as meaning the same
|
|---|
| 238 | thing as a prefix argument of one.
|
|---|
| 239 |
|
|---|
| 240 | Many commands ignore the prefix argument entirely.
|
|---|
| 241 |
|
|---|
| 242 | Some commands do none of the above.
|
|---|
| 243 | @end[itemize]
|
|---|
| 244 | The following commands are used to set the prefix argument:
|
|---|
| 245 |
|
|---|
| 246 | @defcom[com "Argument Digit", stuff (bound to all control or meta digits)]
|
|---|
| 247 | Typing a number using this command sets the prefix argument to that number,
|
|---|
| 248 | for example, typing @binding[M-1 M-2] sets the prefix argument to twelve.
|
|---|
| 249 | @enddefcom
|
|---|
| 250 |
|
|---|
| 251 | @defcom[com "Negative Argument", bind {M--}]
|
|---|
| 252 | This command negates the prefix argument, or if there is none, sets it to
|
|---|
| 253 | negative one. For example, typing @binding[M-- M-7] sets the prefix
|
|---|
| 254 | argument to negative seven.
|
|---|
| 255 | @enddefcom
|
|---|
| 256 |
|
|---|
| 257 | @defcom[com "Universal Argument", bind {C-u}]
|
|---|
| 258 | @defhvar1[var "Universal Argument Default", val {4}]
|
|---|
| 259 | This command sets the prefix argument or multiplies it by four. If digits
|
|---|
| 260 | are typed immediately afterward, they are echoed in the echo area, and the
|
|---|
| 261 | prefix argument is set to the specified number. If no digits are typed
|
|---|
| 262 | then the prefix argument is multiplied by four. @binding[C-u - 7] sets the
|
|---|
| 263 | prefix argument to negative seven. @binding[C-u C-u] sets the prefix
|
|---|
| 264 | argument to sixteen. @binding[M-4 M-2 C-u] sets the prefix argument to one
|
|---|
| 265 | hundred and sixty-eight. @binding[C-u M-0] sets the prefix argument to
|
|---|
| 266 | forty.
|
|---|
| 267 |
|
|---|
| 268 | @hid[Universal Argument Default] determines the default value and multiplier
|
|---|
| 269 | for the @hid[Universal Argument] command.
|
|---|
| 270 | @enddefcom
|
|---|
| 271 |
|
|---|
| 272 |
|
|---|
| 273 | @section[Modes]
|
|---|
| 274 |
|
|---|
| 275 | @label[modes]@index[modes]A mode provides a way to change @hemlock@comment{}'s
|
|---|
| 276 | behavior by specifying a modification to current key bindings, values of
|
|---|
| 277 | variables, and other things. Modes are typically used to adjust @hemlock
|
|---|
| 278 | to suit a particular editing task, e.g. @hid[Lisp] mode is used for editing
|
|---|
| 279 | @llisp code.
|
|---|
| 280 |
|
|---|
| 281 | Modes in @hemlock are not like modes in most text editors; @hemlock is really a
|
|---|
| 282 | "modeless" editor. There are two ways that the @hemlock mode concept differs
|
|---|
| 283 | from the conventional one:
|
|---|
| 284 | @begin[enumerate]
|
|---|
| 285 | Modes do not usually alter the environment in a very big way, i.e. replace
|
|---|
| 286 | the set of commands bound with another totally disjoint one. When a mode
|
|---|
| 287 | redefines what a key does, it is usually redefined to have a slightly
|
|---|
| 288 | different meaning, rather than a totally different one. For this reason,
|
|---|
| 289 | typing a given key does pretty much the same thing no matter what modes are
|
|---|
| 290 | in effect. This property is the distinguishing characteristic of a
|
|---|
| 291 | modeless editor.
|
|---|
| 292 |
|
|---|
| 293 | Once the modes appropriate for editing a given file have been chosen, they
|
|---|
| 294 | are seldom, if ever, changed. One of the advantages of modeless editors is
|
|---|
| 295 | that time is not wasted changing modes.
|
|---|
| 296 | @end[enumerate]
|
|---|
| 297 |
|
|---|
| 298 | @index[major mode]A @i[major mode] is used to make some big change in the
|
|---|
| 299 | editing environment. Language modes such as @hid[Pascal] mode are major
|
|---|
| 300 | modes. A major mode is usually turned on by invoking the command
|
|---|
| 301 | @i{mode-name}@hid[ Mode] as an extended command. There is only one major
|
|---|
| 302 | mode present at a time. Turning on a major mode turns off the one that is
|
|---|
| 303 | currently in effect.
|
|---|
| 304 |
|
|---|
| 305 | @index[minor mode]A @i[minor mode] is used to make a small change in the
|
|---|
| 306 | environment, such as automatically breaking lines if they get too long.
|
|---|
| 307 | Unlike major modes, any number of minor modes may be present at once.
|
|---|
| 308 | Ideally minor modes should do the "right thing" no matter what major and
|
|---|
| 309 | minor modes are in effect, but this is may not be the case when key
|
|---|
| 310 | bindings conflict.
|
|---|
| 311 |
|
|---|
| 312 | Modes can be envisioned as switches, the major mode corresponding to one big
|
|---|
| 313 | switch which is thrown into the correct position for the type of editing being
|
|---|
| 314 | done, and each minor mode corresponding to an on-off switch which controls
|
|---|
| 315 | whether a certain characteristic is present.
|
|---|
| 316 |
|
|---|
| 317 | @defcom[com "Fundamental Mode"]
|
|---|
| 318 | This command puts the current buffer into @hid[Fundamental] mode.
|
|---|
| 319 | @hid[Fundamental] mode is the most basic major mode: it's the next best thing
|
|---|
| 320 | to no mode at all.
|
|---|
| 321 | @enddefcom
|
|---|
| 322 |
|
|---|
| 323 |
|
|---|
| 324 | @section[Display Conventions]
|
|---|
| 325 | @index[display conventions]
|
|---|
| 326 | There are two ways that @hemlock displays information on the screen; one is
|
|---|
| 327 | normal @i[buffer display], in which the text being edited is shown on the
|
|---|
| 328 | screen, and the other is a @i[pop-up window].
|
|---|
| 329 |
|
|---|
| 330 |
|
|---|
| 331 | @subsection[Pop-Up Windows]
|
|---|
| 332 | @index[pop-up windows]
|
|---|
| 333 | @index[random typeout]
|
|---|
| 334 | @label[pop-up]
|
|---|
| 335 | Some commands print out information that is of little permanent value, and
|
|---|
| 336 | these commands use a @i[pop-up] window to display the information. It is known
|
|---|
| 337 | as a @i[pop-up] window because it temporarily appears on the screen overlaying
|
|---|
| 338 | text already displayed. Most commands of this nature can generate their output
|
|---|
| 339 | quickly, but in case there is a lot of output, or the user wants to repeatedly
|
|---|
| 340 | refer to the same output while editing, @hemlock saves the output in a buffer.
|
|---|
| 341 | Different commands may use different buffers to save their output, and we refer
|
|---|
| 342 | to these as @i[random typeout] buffers.
|
|---|
| 343 |
|
|---|
| 344 | If the amount of output exceeds the size of the pop-up window, @Hemlock
|
|---|
| 345 | displays the message @w<"@f[--More--]"> after each window full. The following
|
|---|
| 346 | are valid responses to this prompt:
|
|---|
| 347 | @Begin[Description]
|
|---|
| 348 | @bf[Space], @bf[y]@\
|
|---|
| 349 | Display the next window full of text.
|
|---|
| 350 |
|
|---|
| 351 | @bf[Delete], @bf[Backspace], @bf[n]@\
|
|---|
| 352 | Abort any further output.
|
|---|
| 353 |
|
|---|
| 354 | @bf[Escape], @bf[!]@\
|
|---|
| 355 | Remove the window and continue saving any further output in the buffer.
|
|---|
| 356 |
|
|---|
| 357 | @bf[k]@\
|
|---|
| 358 | This is the same as @bf[!] or @bf[escape], but @hemlock makes a normal window
|
|---|
| 359 | over the pop-up window. This only works on bitmap devices.
|
|---|
| 360 | @End[Description]
|
|---|
| 361 | Any other input causes the system to abort using the key-event to determine
|
|---|
| 362 | the next command to execute.
|
|---|
| 363 |
|
|---|
| 364 | When the output is complete, @hemlock displays the string @w<"@f[--Flush--]">
|
|---|
| 365 | in the pop-up window's modeline, indicating that the user may flush the
|
|---|
| 366 | temporary display. Typing any of the key-events described above removes the
|
|---|
| 367 | pop-up window, but typing @bf[k] still produces a window suitable for normal
|
|---|
| 368 | editing. Any other input also flushes the display, but @hemlock uses the
|
|---|
| 369 | key-event to determine the next command to invoke.
|
|---|
| 370 |
|
|---|
| 371 | @defcom[com "Select Random Typeout Buffer", bind {H-t}]
|
|---|
| 372 | This command makes the most recently used random typeout buffer the current
|
|---|
| 373 | buffer in the current window.
|
|---|
| 374 | @enddefcom
|
|---|
| 375 |
|
|---|
| 376 | Random typeout buffers are always in @hid[Fundamental] mode.
|
|---|
| 377 |
|
|---|
| 378 |
|
|---|
| 379 | @subsection[Buffer Display]
|
|---|
| 380 | @index[buffer, display]
|
|---|
| 381 | @index[display, buffer]
|
|---|
| 382 |
|
|---|
| 383 | If a line of text is too long to fit within the screen width it is @i[wrapped],
|
|---|
| 384 | with @hemlock displaying consecutive pieces of the text line on as many screen
|
|---|
| 385 | lines as needed to hold the text. @hemlock indicates a wrapped line by placing
|
|---|
| 386 | a line-wrap character in the last column of each screen line. Currently, the
|
|---|
| 387 | line-wrap character is an exclamation point (@f[!]). It is possible for a line
|
|---|
| 388 | to wrap off the bottom of the screen or on to the top.
|
|---|
| 389 |
|
|---|
| 390 | @hemlock wraps screen lines when the line is completely full regardless of the
|
|---|
| 391 | line-wrap character. Most editors insert the line-wrap character and wrap a
|
|---|
| 392 | single character when a screen line would be full if the editor had avoided
|
|---|
| 393 | wrapping the line. In this situation, @hemlock would leave the screen line
|
|---|
| 394 | full. This means there are always at least two characters on the next screen
|
|---|
| 395 | line if @hemlock wraps a line of display. When the cursor is at the end of a
|
|---|
| 396 | line which is the full width of the screen, it is displayed in the last column,
|
|---|
| 397 | since it cannot be displayed off the edge.
|
|---|
| 398 |
|
|---|
| 399 | @hemlock displays most characters as themselves, but it treats some
|
|---|
| 400 | specially:
|
|---|
| 401 | @begin[itemize]
|
|---|
| 402 | Tabs are treated as tabs, with eight character tab-stops.
|
|---|
| 403 |
|
|---|
| 404 | Characters corresponding to ASCII control characters are printed as
|
|---|
| 405 | @f[^]@i[char]; for example, a formfeed is @f[^L].
|
|---|
| 406 |
|
|---|
| 407 | Characters with the most-significant bit on are displayed as
|
|---|
| 408 | @f[<]@i[hex-code]@f[>]; for example, @f[<E2>].
|
|---|
| 409 | @end[itemize]
|
|---|
| 410 | Since a character may be displayed using more than one printing character,
|
|---|
| 411 | there are some positions on the screen which are in the middle of a character.
|
|---|
| 412 | When the cursor is on a character with a multiple-character representation,
|
|---|
| 413 | @hemlock always displays the cursor on the first character.
|
|---|
| 414 |
|
|---|
| 415 |
|
|---|
| 416 | @subsection[Recentering Windows]
|
|---|
| 417 | @index[recentering windows]
|
|---|
| 418 | @index[windows, recentering]
|
|---|
| 419 |
|
|---|
| 420 | When redisplaying the current window, @hemlock makes sure the current point is
|
|---|
| 421 | visible. This is the behavior you see when you are entering text near the
|
|---|
| 422 | bottom of the window, and suddenly redisplay shifts your position to the
|
|---|
| 423 | window's center.
|
|---|
| 424 |
|
|---|
| 425 | Some buffers receive input from streams and other processes, and you might have
|
|---|
| 426 | windows displaying these. However, if those windows are not the current
|
|---|
| 427 | window, the output will run off the bottom of the windows, and you won't be
|
|---|
| 428 | able to see the output as it appears in the buffers. You can change to a
|
|---|
| 429 | window in which you want to track output and invoke the following command to
|
|---|
| 430 | remedy this situation.
|
|---|
| 431 |
|
|---|
| 432 | @defcom[com "Track Buffer Point"]
|
|---|
| 433 | This command makes the current window track the buffer's point. This means
|
|---|
| 434 | that each time Hemlock redisplays, it will make sure the buffer's point is
|
|---|
| 435 | visible in the window. This is useful for windows that are not current and
|
|---|
| 436 | that display buffer's that receive output from streams coming from other
|
|---|
| 437 | processes.
|
|---|
| 438 | @enddefcom
|
|---|
| 439 |
|
|---|
| 440 |
|
|---|
| 441 | @subsection[Modelines]
|
|---|
| 442 | @label[modelines]
|
|---|
| 443 | @index[modeline]
|
|---|
| 444 | A modeline is the line displayed at the bottom of each window where @hemlock
|
|---|
| 445 | shows information about the buffer displayed in that window. Here is a typical
|
|---|
| 446 | modeline:
|
|---|
| 447 | @begin[programexample]
|
|---|
| 448 | Hemlock USER: (Fundamental Fill) /usr/slisp/hemlock/user.mss
|
|---|
| 449 | @end[programexample]
|
|---|
| 450 | This tells us that the file associated with this buffer is
|
|---|
| 451 | "@f[/usr/slisp/hemlock/user.mss]", and the @hid[Current Package] for Lisp
|
|---|
| 452 | interaction commands is the @f["USER"] package. The modes currently present
|
|---|
| 453 | are @hid[Fundamental] and @hid[Fill]; the major mode is always displayed first,
|
|---|
| 454 | followed by any minor modes. If the buffer has no associated file, then the
|
|---|
| 455 | buffer name will be present instead:
|
|---|
| 456 | @begin[programexample]
|
|---|
| 457 | Hemlock PLAY: (Lisp) Silly:
|
|---|
| 458 | @end[programexample]
|
|---|
| 459 | In this case, the buffer is named @hid[Silly] and is in @hid[Lisp] mode. The
|
|---|
| 460 | user has set @hid[Current Package] for this buffer to @f["PLAY"].
|
|---|
| 461 |
|
|---|
| 462 | @defhvar[var "Maximum Modeline Pathname Length", val {nil}]
|
|---|
| 463 | This variable controls how much of a pathname @hemlock displays in a modeline.
|
|---|
| 464 | Some distributed file systems can have very long pathnames which leads to the
|
|---|
| 465 | more particular information in a pathname running off the end of a modeline.
|
|---|
| 466 | When set, the system chops off leading directories until the name is less than
|
|---|
| 467 | the integer value of this variable. Three dots, @f[...], indicate a truncated
|
|---|
| 468 | name. The user can establish this variable buffer locally with the
|
|---|
| 469 | @hid[Defhvar] command.
|
|---|
| 470 | @enddefhvar
|
|---|
| 471 |
|
|---|
| 472 | If the user has modified the buffer since the last time it was read from or
|
|---|
| 473 | save to a file, then the modeline contains an asterisk (@f[*]) between the
|
|---|
| 474 | modes list and the file or buffer name:
|
|---|
| 475 | @begin[programexample]
|
|---|
| 476 | Hemlock USER: (Fundamental Fill) * /usr/slisp/hemlock/user.mss
|
|---|
| 477 | @end[programexample]
|
|---|
| 478 | This serves as a reminder that the buffer should be saved eventually.
|
|---|
| 479 |
|
|---|
| 480 | @index[status line]
|
|---|
| 481 | There is a special modeline known as the @i[status line] which appears as the
|
|---|
| 482 | @hid[Echo Area]'s modeline. @Hemlock and user code use this area to display
|
|---|
| 483 | general information not particular to a buffer @dash recursive edits, whether
|
|---|
| 484 | you just received mail, etc.
|
|---|
| 485 |
|
|---|
| 486 |
|
|---|
| 487 | @section[Use with X Windows]
|
|---|
| 488 | @label[using-x]
|
|---|
| 489 | @index[X windows, use with]
|
|---|
| 490 | You should use @hemlock on a workstation with a bitmap display and a windowing
|
|---|
| 491 | system since @hemlock makes good use of a non-ASCII device, mouse, and the
|
|---|
| 492 | extra modifier keys typically associated with workstations. This section
|
|---|
| 493 | discusses using @hemlock under X windows, the only supported windowing system.
|
|---|
| 494 |
|
|---|
| 495 |
|
|---|
| 496 | @subsection[Window Groups]
|
|---|
| 497 | @index[window management]
|
|---|
| 498 | @label[groups]
|
|---|
| 499 | @hemlock manages windows under X in groups. This allows @hemlock to be more
|
|---|
| 500 | sophisticated in its window management without being rude in the X paradigm of
|
|---|
| 501 | screen usage. With window groups, @hemlock can ignore where the groups are,
|
|---|
| 502 | but within a group, it can maintain the window creation and deletion behavior
|
|---|
| 503 | users expect in editors without any interference from window managers.
|
|---|
| 504 |
|
|---|
| 505 | Initially there are two groups, a main window and the @hid[Echo Area]. If you
|
|---|
| 506 | keep a pop-up display, see section @ref[pop-up], @hemlock puts the window it
|
|---|
| 507 | creates in its own group. There are commands for creating new groups.
|
|---|
| 508 |
|
|---|
| 509 | @hemlock only links windows within a group for purposes of the @hid[Next
|
|---|
| 510 | Window], @hid[Previous Window], and @hid[Delete Next Window] commands. To move
|
|---|
| 511 | between groups, you must use the @hid[Point to Here] command bound to the
|
|---|
| 512 | mouse.
|
|---|
| 513 |
|
|---|
| 514 | Window manager commands can reshape and move groups on the screen.
|
|---|
| 515 |
|
|---|
| 516 |
|
|---|
| 517 | @subsection[Event Translation]
|
|---|
| 518 | @index[keyboard use under X]
|
|---|
| 519 | @index[translation of keys under X]
|
|---|
| 520 | Each X key event is translated into a canonical input representation, a
|
|---|
| 521 | key-event. The X key event consists of a scan-code and modifier bits, and
|
|---|
| 522 | these translate to an X keysym. This keysym and the modifier bits map to a
|
|---|
| 523 | key-event.
|
|---|
| 524 |
|
|---|
| 525 | If you type a key with a shift key held down, this typically maps to a distinct
|
|---|
| 526 | X keysym. For example, the shift of @bf[3] is @bf[#], and these have different
|
|---|
| 527 | X keysyms. Some keys map to the same X keysym regardless of the shift bit,
|
|---|
| 528 | such as @bf[Tab], @bf[Space], @bf[Return], etc. When the X lock bit is on, the
|
|---|
| 529 | system treats this as a caps-lock, only mapping keysyms for lowercase letters
|
|---|
| 530 | to shifted keysyms.
|
|---|
| 531 |
|
|---|
| 532 | The key-event has a keysym and a field of bits. The X keysyms map directly to
|
|---|
| 533 | the key-event keysyms. There is a distinct mapping for each CLX modifier bit
|
|---|
| 534 | to a key-event bit. This tends to eliminate shift and lock modifiers, so
|
|---|
| 535 | key-events usually only have control, meta, hyper, and super bits on. Hyper
|
|---|
| 536 | and super usually get turned on with prefix key-events that set them on the
|
|---|
| 537 | following key-event, but you can turn certain keys on the keyboard into hyper
|
|---|
| 538 | and super keys. See the X manuals and the @i[Hemlock Command Implementor's
|
|---|
| 539 | Manual] for details.
|
|---|
| 540 |
|
|---|
| 541 | The system also maps mouse input to key-events. Each mouse button has distinct
|
|---|
| 542 | key-event keysyms for whether the user pressed or released it. For
|
|---|
| 543 | convenience, @hemlock makes use of an odd property of converting mouse events
|
|---|
| 544 | to key-events. If you enter a mouse event with the shift key held down,
|
|---|
| 545 | @hemlock sees the key-event keysym for the mouse event, but the key-event has
|
|---|
| 546 | the super bit turned on. For example, if you press the left button with the
|
|---|
| 547 | shift key pressed, @hemlock sees @bf[S-Leftdown].
|
|---|
| 548 |
|
|---|
| 549 | Note that with the two button mouse on the IBM RT PC, the only way to to send
|
|---|
| 550 | @bf[Middledown] is to press both the left and right buttons simultaneously.
|
|---|
| 551 | This is awkward, and it often confuses the X server. For this reason, the
|
|---|
| 552 | commands bound to the middle button are also bound to the shifted left button,
|
|---|
| 553 | @bf[S-Leftdown], which is much easier to type.
|
|---|
| 554 |
|
|---|
| 555 |
|
|---|
| 556 | @subsection[Cut Buffer Commands]
|
|---|
| 557 | @index[cutting]@index[pasting] These commands allow the X cut buffer to be
|
|---|
| 558 | used from @hemlock . Although @hemlock can cut arbitrarily large regions,
|
|---|
| 559 | a bug in the standard version 10 xterm prevents large regions from being
|
|---|
| 560 | pasted into an xterm window.
|
|---|
| 561 |
|
|---|
| 562 | @defcom[com "Region to Cut Buffer", bind {M-Insert}]
|
|---|
| 563 | @defcom1[com "Insert Cut Buffer", bind {Insert}]
|
|---|
| 564 | These commands manipulate the X cut buffer. @hid[Region to Cut Buffer] puts
|
|---|
| 565 | the text in the region into the cut buffer. @hid[Insert Cut Buffer] inserts
|
|---|
| 566 | the contents of the cut buffer at the point.
|
|---|
| 567 | @enddefcom
|
|---|
| 568 |
|
|---|
| 569 | @subsection[Redisplay and Screen Management]
|
|---|
| 570 |
|
|---|
| 571 | These variables control a number of the characteristics of @hemlock bitmap
|
|---|
| 572 | screen management.
|
|---|
| 573 |
|
|---|
| 574 | @defhvar[var "Bell Style", val {:border-flash}]
|
|---|
| 575 | @defhvar1[var "Beep Border Width", val {20}]
|
|---|
| 576 | @hid[Bell Style] determines what beeps do in @hemlock. Acceptable values are
|
|---|
| 577 | @kwd[border-flash], @kwd[feep], @kwd[border-flash-and-feep], @kwd[flash],
|
|---|
| 578 | @kwd[flash-and-feep], and @nil (do nothing).
|
|---|
| 579 |
|
|---|
| 580 | @hid[Beep Border Width] is the width in pixels of the border flashed by border
|
|---|
| 581 | flash beep styles.
|
|---|
| 582 | @enddefhvar
|
|---|
| 583 |
|
|---|
| 584 | @defhvar[var "Reverse Video", val {nil}]
|
|---|
| 585 | If this variable is true, then @hemlock paints white on black in window
|
|---|
| 586 | bodies, black on white in modelines.
|
|---|
| 587 | @enddefhvar
|
|---|
| 588 |
|
|---|
| 589 | @defhvar[var "Thumb Bar Meter", val {t}]
|
|---|
| 590 | If this variable is true, then windows will be created to be displayed with a
|
|---|
| 591 | ruler in the bottom border of the window.
|
|---|
| 592 | @enddefhvar
|
|---|
| 593 |
|
|---|
| 594 | @defhvar[var "Set Window Autoraise", val {:echo-only}]
|
|---|
| 595 | When true, changing the current window will automatically raise the new current
|
|---|
| 596 | window. If the value is @kwd[echo-only], then only the echo area window will
|
|---|
| 597 | be raised automatically upon becoming current.
|
|---|
| 598 | @enddefhvar
|
|---|
| 599 |
|
|---|
| 600 | @defhvar[var "Default Initial Window Width", val {80}]
|
|---|
| 601 | @defhvar1[var "Default Initial Window Height", val {24}]
|
|---|
| 602 | @defhvar1[var "Default Initial Window X"]
|
|---|
| 603 | @defhvar1[var "Default Initial Window Y"]
|
|---|
| 604 | @defhvar1[var "Default Window Height", val {24}]
|
|---|
| 605 | @defhvar1[var "Default Window Width", val {80}]
|
|---|
| 606 | @index[window placement]
|
|---|
| 607 | @Hemlock uses the variables with "@hid[Initial]" in their names when it first
|
|---|
| 608 | starts up to make its first window. The width and height are specified in
|
|---|
| 609 | character units, but the x and y are specified in pixels. The other variables
|
|---|
| 610 | determine the width and height for interactive window creation, such as making
|
|---|
| 611 | a window with @comref[New Window].
|
|---|
| 612 | @enddefhvar
|
|---|
| 613 |
|
|---|
| 614 | @defhvar[var "Cursor Bitmap File", val {"library:hemlock.cursor"}]
|
|---|
| 615 | This variable determines where the mouse cursor bitmap is read from when
|
|---|
| 616 | @hemlock starts up. The mask is found by merging this name with "@f[.mask]".
|
|---|
| 617 | This has to be a full pathname for the C routine.
|
|---|
| 618 | @enddefhvar
|
|---|
| 619 |
|
|---|
| 620 |
|
|---|
| 621 | @defhvar[var "Default Font"]
|
|---|
| 622 | This variable holds the string name of the font to be used for normal text
|
|---|
| 623 | display: buffer text, modelines, random typeout, etc. The font is loaded at
|
|---|
| 624 | initialization time, so this variable must be set before entering @hemlock.
|
|---|
| 625 | When @nil, the display type is used to choose a font.
|
|---|
| 626 | @enddefhvar
|
|---|
| 627 |
|
|---|
| 628 |
|
|---|
| 629 | @section[Use With Terminals]
|
|---|
| 630 | @label[using-terminals]@index[terminals, use with] @hemlock can also be used
|
|---|
| 631 | with ASCII terminals and terminal emulators. Capabilities that depend on
|
|---|
| 632 | @windows (such as mouse commands) are not available, but nearly everything else
|
|---|
| 633 | can be done.
|
|---|
| 634 |
|
|---|
| 635 | @subsection[Terminal Initialization]
|
|---|
| 636 |
|
|---|
| 637 | @index[terminal speed]
|
|---|
| 638 | @index[speed, terminal]
|
|---|
| 639 | @index[slow terminals]
|
|---|
| 640 | @index[incremental redisplay]
|
|---|
| 641 | For best redisplay performance, it is very important to set the terminal speed:
|
|---|
| 642 | @lisp
|
|---|
| 643 | stty 2400
|
|---|
| 644 | @endlisp
|
|---|
| 645 | Often when running @hemlock using TTY redisplay, Hemlock will actually be
|
|---|
| 646 | talking to a PTY whose speed is initialized to infinity. In reality, the
|
|---|
| 647 | terminal will be much slower, resulting in @hemlock@comment{}'s output getting way ahead
|
|---|
| 648 | of the terminal. This prevents @hemlock from briefly stopping redisplay to
|
|---|
| 649 | allow the terminal to catch up. See also @hvarref<Scroll Redraw Ratio>.
|
|---|
| 650 |
|
|---|
| 651 | The terminal control sequences are obtained from the termcap database using the
|
|---|
| 652 | normal Unix conventions. The @f["TERM"] environment variable holds the
|
|---|
| 653 | terminal type. The @f["TERMCAP"] environment variable can be used to override
|
|---|
| 654 | the default termcap database (in @f["/etc/termcap"]). The size of the terminal
|
|---|
| 655 | can be altered from the termcap default through the use of:
|
|---|
| 656 | @lisp
|
|---|
| 657 | stty rows @i{height} columns @i{width}
|
|---|
| 658 | @endlisp
|
|---|
| 659 |
|
|---|
| 660 | @subsection[Terminal Input]
|
|---|
| 661 | @index[ASCII keyboard translation]
|
|---|
| 662 | @index[bit-prefix key-events]
|
|---|
| 663 | @index[prefix key-events]
|
|---|
| 664 | @index[key-event, prefix]
|
|---|
| 665 | The most important limitation of a terminal is its input capabilities. On a
|
|---|
| 666 | workstation with function keys and independent control, meta, and shift
|
|---|
| 667 | modifiers, it is possible to type 800 or so distinct single keystrokes.
|
|---|
| 668 | Although by default, @hemlock uses only a fraction of these combinations, there
|
|---|
| 669 | are many more than the 128 key-events available in ASCII.
|
|---|
| 670 |
|
|---|
| 671 | On a terminal, @hemlock attempts to translate ASCII control characters into the
|
|---|
| 672 | most useful key-event:
|
|---|
| 673 | @begin[itemize]
|
|---|
| 674 | On a terminal, control does not compose with shift. If the control key is down
|
|---|
| 675 | when you type a letter keys, the terminal always sends one code regardless of
|
|---|
| 676 | whether the shift key is held. Since @hemlock primarily binds commands to
|
|---|
| 677 | key-events with keysyms representing lowercase letters regardless of what bits
|
|---|
| 678 | are set in the key-event, the system translates the ASCII control codes to a
|
|---|
| 679 | keysym representing the appropriate lowercase characters. This keysym then
|
|---|
| 680 | forms a key-event with the control bit set. Users can type @bf[C-c] followed
|
|---|
| 681 | by an uppercase character to form a key-event with a keysym representing an
|
|---|
| 682 | uppercase character and bits with the control bit set.
|
|---|
| 683 |
|
|---|
| 684 | On a terminal, some of the named keys generate an ASCII control code. For
|
|---|
| 685 | example, @f[Return] usually sends a @f[C-m]. The system translates these ASCII
|
|---|
| 686 | codes to a key-event with an appropriate keysym instead of the keysym named by
|
|---|
| 687 | the character which names the ASCII code. In the above example, typing the
|
|---|
| 688 | @f[Return] key would generate a key-event with the @bf[Return] keysym and no
|
|---|
| 689 | bits. It would NOT translate to a key-event with the @bf[m] keysym and the
|
|---|
| 690 | control bit.
|
|---|
| 691 | @end[itemize]
|
|---|
| 692 |
|
|---|
| 693 | Since terminals have no meta key, you must use the @bf[Escape] and @bf[C-Z]
|
|---|
| 694 | modifier-prefix key-events to invoke commands bound to key-events with the meta
|
|---|
| 695 | bit or meta and control bits set. ASCII terminals cannot generate all
|
|---|
| 696 | key-events which have the control bit on, so you can use the @bf[C-^]
|
|---|
| 697 | modifier-prefix. The @bf[C-c] prefix sets the hyper bit on the next key-event
|
|---|
| 698 | typed.
|
|---|
| 699 |
|
|---|
| 700 | When running @hemlock from a terminal @f[^\] is the interrupt key-event.
|
|---|
| 701 | Typing this will place you in the Lisp debugger.
|
|---|
| 702 |
|
|---|
| 703 | When using a terminal, pop-up output windows cannot be retained after the
|
|---|
| 704 | completion of the command.
|
|---|
| 705 |
|
|---|
| 706 |
|
|---|
| 707 | @subsection[Terminal Redisplay]
|
|---|
| 708 |
|
|---|
| 709 | Redisplay is substantially different on a terminal. @Hemlock uses different
|
|---|
| 710 | algorithms, and different parameters control redisplay and screen management.
|
|---|
| 711 |
|
|---|
| 712 | Terminal redisplay uses the Unix termcap database to find out how to use a
|
|---|
| 713 | terminal. @hemlock is useful with terminals that lack capabilities for
|
|---|
| 714 | inserting and deleting lines and characters, and some terminal emulators
|
|---|
| 715 | implement these operations very inefficiently (such as xterm).
|
|---|
| 716 | If you realize poor performance when scrolling, create a termcap entry that
|
|---|
| 717 | excludes these capabilities.
|
|---|
| 718 |
|
|---|
| 719 | @defhvar[var "Scroll Redraw Ratio", val {nil}]
|
|---|
| 720 | This is a ratio of "inserted" lines to the size of a window. When this ratio
|
|---|
| 721 | is exceeded, insert/delete line terminal optimization is aborted, and every
|
|---|
| 722 | altered line is simply redrawn as efficiently as possible. For example,
|
|---|
| 723 | setting this to 1/4 will cause scrolling commands to redraw the entire window
|
|---|
| 724 | instead of moving the bottom two lines of the window to the top (typically 3/4
|
|---|
| 725 | of the window is being deleted upward and inserted downward, hence a redraw);
|
|---|
| 726 | however, commands like @hid[New Line] and @hid[Open Line] will still work
|
|---|
| 727 | efficiently, inserting a line and moving the rest of the window's text
|
|---|
| 728 | downward.
|
|---|
| 729 | @enddefhvar
|
|---|
| 730 |
|
|---|
| 731 |
|
|---|
| 732 | @section[The Echo Area]
|
|---|
| 733 |
|
|---|
| 734 | @index[echo area]
|
|---|
| 735 | @index[prompting]
|
|---|
| 736 | The echo area is the region which occupies the bottom few lines on the screen.
|
|---|
| 737 | It is used for two purposes: displaying brief messages to the user and
|
|---|
| 738 | prompting.
|
|---|
| 739 |
|
|---|
| 740 | When a command needs some information from the user, it requests it by
|
|---|
| 741 | displaying a @i[prompt] in the echo area. The following is a typical prompt:
|
|---|
| 742 | @begin[programexample]
|
|---|
| 743 | Select Buffer: [hemlock-init.lisp /usr/foo/]
|
|---|
| 744 | @end[programexample]
|
|---|
| 745 | The general format of a prompt is a one or two word description of the input
|
|---|
| 746 | requested, possibly followed by a @i[default] in brackets. The default is a
|
|---|
| 747 | standard response to the prompt that @hemlock uses if you type @bf[Return]
|
|---|
| 748 | without giving any other input.
|
|---|
| 749 |
|
|---|
| 750 | There are four general kinds of prompts: @comment<Key prompts?>
|
|---|
| 751 | @begin[description]
|
|---|
| 752 | @i[key-event]@\
|
|---|
| 753 | The response is a single key-event and no confirming @binding[Return] is
|
|---|
| 754 | needed.
|
|---|
| 755 |
|
|---|
| 756 | @i[keyword]@\
|
|---|
| 757 | The response is a selection from one of a limited number of choices.
|
|---|
| 758 | Completion is available using @binding[Space] and @binding[Escape], and you
|
|---|
| 759 | only need to supply enough of the keyword to distinguish it from any other
|
|---|
| 760 | choice. In some cases a keyword prompt accepts unknown input, indicating the
|
|---|
| 761 | prompter should create a new entry. If this is the case, then you must enter
|
|---|
| 762 | the keyword fully specified or completed using @binding[Escape]; this
|
|---|
| 763 | distinguishes entering an old keyword from making a new keyword which is a
|
|---|
| 764 | prefix of an old one since the system completes partial input automatically.
|
|---|
| 765 |
|
|---|
| 766 | @i[file]@\
|
|---|
| 767 | The response is the name of a file, which may have to exist. Unlike other
|
|---|
| 768 | prompts, the default has some effect even after the user supplies some input:
|
|---|
| 769 | the system @i[merges] the default with the input filename. See page
|
|---|
| 770 | @pageref(merging) for a description of filename merging. @bf[Escape] and
|
|---|
| 771 | @bf[Space] complete the input for a file parse.
|
|---|
| 772 |
|
|---|
| 773 | @i[string]@\
|
|---|
| 774 | The response is a string which must satisfy some property, such as being the
|
|---|
| 775 | name of an existing file.
|
|---|
| 776 | @end[description]
|
|---|
| 777 |
|
|---|
| 778 | @index[history, echo area]
|
|---|
| 779 | These key-events have special meanings when prompting:
|
|---|
| 780 | @begin[description]
|
|---|
| 781 | @binding[Return]@\
|
|---|
| 782 | Confirm the current parse. If no input has been entered, then use the
|
|---|
| 783 | default. If for some reason the input is unacceptable, @hemlock does two
|
|---|
| 784 | things:
|
|---|
| 785 | @Begin[enumerate]
|
|---|
| 786 | beeps, if the variable @hid[Beep on Ambiguity] set, and
|
|---|
| 787 |
|
|---|
| 788 | moves the point to the end of the first word requiring disambiguation.
|
|---|
| 789 | @End[enumerate]
|
|---|
| 790 | This allows you to add to the input before confirming the it again.
|
|---|
| 791 |
|
|---|
| 792 | @binding[Home, C-_]@\
|
|---|
| 793 | Print some sort of help message. If the parse is a keyword parse, then print
|
|---|
| 794 | all the possible completions of the current input in a pop-up window.
|
|---|
| 795 |
|
|---|
| 796 | @binding[Escape]@\
|
|---|
| 797 | Attempt to complete the input to a keyword or file parse as far as possible,
|
|---|
| 798 | beeping if the result is ambiguous. When the result is ambiguous, @hemlock
|
|---|
| 799 | moves the point to the first ambiguous field, which may be the end of the
|
|---|
| 800 | completed input.
|
|---|
| 801 |
|
|---|
| 802 | @binding[Space]@\
|
|---|
| 803 | In a keyword parse, attempt to complete the input up to the next space. This
|
|---|
| 804 | is useful for completing the names of @hemlock commands and similar things
|
|---|
| 805 | without beeping a lot, and you can continue entering fields while leaving
|
|---|
| 806 | previous fields ambiguous. For example, you can invoke @hid[Forward Word] as
|
|---|
| 807 | an extended command by typing @binding[M-X f Space w Return]. Each time the
|
|---|
| 808 | user enters space, @Hemlock attempts to complete the current field and all
|
|---|
| 809 | previous fields.
|
|---|
| 810 |
|
|---|
| 811 | @binding[C-i, Tab]@\
|
|---|
| 812 | In a string or keyword parse, insert the default so that it may be edited.
|
|---|
| 813 |
|
|---|
| 814 | @binding[C-p]@\
|
|---|
| 815 | Retrieve the text of the last string input from a history of echo area inputs.
|
|---|
| 816 | Repeating this moves to successively earlier inputs.
|
|---|
| 817 |
|
|---|
| 818 | @binding[C-n]@\
|
|---|
| 819 | Go the other way in the echo area history.
|
|---|
| 820 |
|
|---|
| 821 | @binding[C-q]@\
|
|---|
| 822 | Quote the next key-event so that it is not interpreted as a command.
|
|---|
| 823 | @end[description]
|
|---|
| 824 |
|
|---|
| 825 | @defhvar[var "Ignore File Types"]
|
|---|
| 826 | This variable is a list of file types (or extensions), represented as a string
|
|---|
| 827 | without the dot, e.g. @f["fasl"]. Files having any of the specified types will
|
|---|
| 828 | be considered nonexistent for completion purposes, making an unambiguous
|
|---|
| 829 | completion more likely. The initial value contains most common binary and
|
|---|
| 830 | output file types.
|
|---|
| 831 | @enddefhvar
|
|---|
| 832 |
|
|---|
| 833 |
|
|---|
| 834 | @section[Online Help]
|
|---|
| 835 |
|
|---|
| 836 | @label[help]
|
|---|
| 837 | @index[online help]
|
|---|
| 838 | @index[documentation, hemlock]
|
|---|
| 839 | @hemlock has a fairly good online documentation facility. You can get brief
|
|---|
| 840 | documentation for every command, variable, character attribute, and key
|
|---|
| 841 | by typing a key.
|
|---|
| 842 |
|
|---|
| 843 | @defcom[com "Help", bind (Home, C-_)]
|
|---|
| 844 | This command prompt for a key-event indicating one of a number of other
|
|---|
| 845 | documentation commands. The following are valid responses:
|
|---|
| 846 | @begin[description]
|
|---|
| 847 | @bf[a]@\
|
|---|
| 848 | List commands and other things whose names contain a specified keyword.
|
|---|
| 849 |
|
|---|
| 850 | @bf[d]@\
|
|---|
| 851 | Give the documentation and bindings for a specified command.
|
|---|
| 852 |
|
|---|
| 853 | @bf[g]@\
|
|---|
| 854 | Give the documentation for any @hemlock thing.
|
|---|
| 855 |
|
|---|
| 856 | @bf[v]@\
|
|---|
| 857 | Give the documentation for a @hemlock variable and its values.
|
|---|
| 858 |
|
|---|
| 859 | @bf[c]@\
|
|---|
| 860 | Give the documentation for a command bound to some key.
|
|---|
| 861 |
|
|---|
| 862 | @bf[l]@\
|
|---|
| 863 | List the last sixty key-events typed.
|
|---|
| 864 |
|
|---|
| 865 | @bf[m]@\
|
|---|
| 866 | Give the documentation for a mode followed by a short description of its
|
|---|
| 867 | mode-specific bindings.
|
|---|
| 868 |
|
|---|
| 869 | @bf[p]@\
|
|---|
| 870 | Give the documentation and bindings for commands that have at least one
|
|---|
| 871 | binding involving a mouse/pointer key-event.
|
|---|
| 872 |
|
|---|
| 873 | @bf[w]@\
|
|---|
| 874 | List all the key bindings for a specified command.
|
|---|
| 875 |
|
|---|
| 876 | @bf[t]@\
|
|---|
| 877 | Describe a @llisp object.
|
|---|
| 878 |
|
|---|
| 879 | @binding[q]@\
|
|---|
| 880 | Quit without doing anything.
|
|---|
| 881 |
|
|---|
| 882 | @binding[Home, C-_, ?, h]@\
|
|---|
| 883 | List all of the options and what they do.
|
|---|
| 884 | @end[description]
|
|---|
| 885 | @enddefcom
|
|---|
| 886 |
|
|---|
| 887 | @defcom[com "Apropos", bind (Home a, C-_ a)]
|
|---|
| 888 | This command prints brief documentation for all commands, variables, and
|
|---|
| 889 | character attributes whose names match the input. This performs a prefix match
|
|---|
| 890 | on each supplied word separately, intersecting the names in each word's result.
|
|---|
| 891 | For example, giving @hid[Apropos] "@f[f m]" causes it to tersely describe
|
|---|
| 892 | following commands and variables:
|
|---|
| 893 | @Begin[Itemize]
|
|---|
| 894 | @hid[Auto Fill Mode]
|
|---|
| 895 |
|
|---|
| 896 | @hid[Fundamental Mode]
|
|---|
| 897 |
|
|---|
| 898 | @hid[Mark Form]
|
|---|
| 899 |
|
|---|
| 900 | @hid[Default Modeline Fields]
|
|---|
| 901 |
|
|---|
| 902 | @hid[Fill Mode Hook]
|
|---|
| 903 |
|
|---|
| 904 | @hid[Fundamental Mode Hook]
|
|---|
| 905 | @End[Itemize]
|
|---|
| 906 | Notice @hid[Mark Form] demonstrates that the "@f[f]" words may follow the
|
|---|
| 907 | "@f[m]" order of the fields does not matter for @hid[Apropos].
|
|---|
| 908 |
|
|---|
| 909 | The bindings of commands and values of variables are printed with the
|
|---|
| 910 | documentation.
|
|---|
| 911 | @enddefcom
|
|---|
| 912 |
|
|---|
| 913 | @defcom[com "Describe Command", bind (Home d, C-_ d)]
|
|---|
| 914 | This command prompts for a command and prints its full documentation and all
|
|---|
| 915 | the keys bound to it.
|
|---|
| 916 | @enddefcom
|
|---|
| 917 |
|
|---|
| 918 | @defcom[com "Describe Key", bind (Home c, C-_ c, M-?)]
|
|---|
| 919 | This command prints full documentation for the command which is bound to
|
|---|
| 920 | the specified key in the current environment.
|
|---|
| 921 | @enddefcom
|
|---|
| 922 |
|
|---|
| 923 | @defcom[com "Describe Mode", bind (Home m, C-_ m)]
|
|---|
| 924 | This command prints the documentation for a mode followed by a short
|
|---|
| 925 | description of each of its mode-specific bindings.
|
|---|
| 926 | @enddefcom
|
|---|
| 927 |
|
|---|
| 928 | @defcom[com "Show Variable"]
|
|---|
| 929 | @defcom1[com "Describe and Show Variable"]
|
|---|
| 930 | @hid[Show Variable] prompts for the name of a variable and displays
|
|---|
| 931 | the global value of the variable, the value local to the current buffer (if
|
|---|
| 932 | any), and the value of the variable in all defined modes that have it as a
|
|---|
| 933 | local variable. @hid[Describe and Show Variable] displays the variable's
|
|---|
| 934 | documentation in addition to the values.
|
|---|
| 935 | @enddefcom
|
|---|
| 936 |
|
|---|
| 937 | @defcom[com "What Lossage", bind (Home l, C-_ l)]
|
|---|
| 938 | This command displays the last sixty key-events typed. This can be useful
|
|---|
| 939 | if, for example, you are curious what the command was that you typed by
|
|---|
| 940 | accident.
|
|---|
| 941 | @enddefcom
|
|---|
| 942 |
|
|---|
| 943 | @defcom[com "Describe Pointer"]
|
|---|
| 944 | This command displays the documentation and bindings for commands that have
|
|---|
| 945 | some binding involving a mouse/pointer key-event. It will not show the
|
|---|
| 946 | documentation for the @hid[Illegal] command regardless of whether it has a
|
|---|
| 947 | pointer binding.
|
|---|
| 948 | @enddefcom
|
|---|
| 949 |
|
|---|
| 950 | @defcom[com "Where Is", bind (Home w, C-_ w)]
|
|---|
| 951 | This command prompts for the name of a command and displays its key
|
|---|
| 952 | bindings in a pop-up window. If a key binding is not global, the
|
|---|
| 953 | environment in which it is available is displayed.
|
|---|
| 954 | @enddefcom
|
|---|
| 955 |
|
|---|
| 956 | @defcom[com "Generic Describe", bind (Home g, C-_ g)]
|
|---|
| 957 | This command prints full documentation for any thing that has
|
|---|
| 958 | documentation. It first prompts for the kind of thing to document, the
|
|---|
| 959 | following options being available:
|
|---|
| 960 | @begin[description]
|
|---|
| 961 | @i[attribute]@\Describe a character attribute, given its name.
|
|---|
| 962 |
|
|---|
| 963 | @i[command]@\Describe a command, given its name.
|
|---|
| 964 |
|
|---|
| 965 | @i[key]@\Describe a command, given a key to which it is bound.
|
|---|
| 966 |
|
|---|
| 967 | @i[variable]@\Describe a variable, given its name. This is the default.
|
|---|
| 968 | @end[description]
|
|---|
| 969 | @enddefcom
|
|---|
| 970 |
|
|---|
| 971 |
|
|---|
| 972 | @section[Entering and Exiting]
|
|---|
| 973 |
|
|---|
| 974 | @index[entering hemlock]@hemlock is entered by using the @clisp @f[ed]
|
|---|
| 975 | function. Simply typing @f[(ed)] will enter @hemlock, leaving you in the state
|
|---|
| 976 | that you were in when you left it. If @hemlock has never been entered before
|
|---|
| 977 | then the current buffer will be @hid[Main]. The @f[-edit] command-line switch
|
|---|
| 978 | may also be used to enter @hemlock: see page @pageref[edit-switch].
|
|---|
| 979 |
|
|---|
| 980 | @f[ed] may optionally be given a file name or a symbol argument. Typing
|
|---|
| 981 | @f[(ed @i[filename])] will cause the specified file to be read into @hemlock,
|
|---|
| 982 | as though by @hid[Find File]. Typing @w<@f[(ed @i[symbol])]> will pretty-print
|
|---|
| 983 | the definition of the symbol into a buffer whose name is obtained by adding
|
|---|
| 984 | "@f[Edit ]" to the beginning of the symbol's name.
|
|---|
| 985 |
|
|---|
| 986 | @defcom[com "Exit Hemlock", bind (C-c, C-x C-z)]
|
|---|
| 987 | @defcom1[com "Pause Hemlock"]
|
|---|
| 988 | @index[exiting hemlock]@hid[Exit Hemlock] exits @hemlock, returning @f[t].
|
|---|
| 989 | @hid[Exit Hemlock] does not by default save modified buffers, or do
|
|---|
| 990 | anything else that you might think it should do; it simply exits. At any time
|
|---|
| 991 | after exiting you may reenter by typing @f[(ed)] to @llisp without losing
|
|---|
| 992 | anything. Before you quit from @llisp using @f[(quit)], you should
|
|---|
| 993 | save any modified files that you want to be saved.
|
|---|
| 994 |
|
|---|
| 995 | @hid[Pause Hemlock] is similar, but it suspends the @llisp process and returns
|
|---|
| 996 | control to the shell. When the process is resumed, it will still be running
|
|---|
| 997 | @hemlock.
|
|---|
| 998 | @enddefcom
|
|---|
| 999 |
|
|---|
| 1000 |
|
|---|
| 1001 | @section[Helpful Information]
|
|---|
| 1002 |
|
|---|
| 1003 | @label[aborting]
|
|---|
| 1004 | @index[aborting]
|
|---|
| 1005 | @index[undoing]
|
|---|
| 1006 | @index[error recovery]
|
|---|
| 1007 | This section contains assorted helpful information which may be useful in
|
|---|
| 1008 | staying out of trouble or getting out of trouble.
|
|---|
| 1009 |
|
|---|
| 1010 | @begin[itemize]
|
|---|
| 1011 | It is possible to get some sort of help nearly everywhere by typing
|
|---|
| 1012 | @binding[Home] or @binding[C-_].
|
|---|
| 1013 |
|
|---|
| 1014 | Various commands take over the keyboard and insist that you type the key-events
|
|---|
| 1015 | that they want as input. If you get in such a situation and want to get out,
|
|---|
| 1016 | you can usually do so by typing @bf[C-g] some small number of times. If this
|
|---|
| 1017 | fails you can try typing @binding[C-x C-z] to exit @hemlock and then "@f[(ed)]"
|
|---|
| 1018 | to re-enter it.
|
|---|
| 1019 |
|
|---|
| 1020 | Before you quit, make sure you have saved all your changes. @binding[C-u C-x
|
|---|
| 1021 | C-b] will display a list of all modified buffers. If you exit using @bf[C-x
|
|---|
| 1022 | M-z], then @hemlock will save all modified buffers with associated files.
|
|---|
| 1023 |
|
|---|
| 1024 | If you lose changes to a file due to a crash or accidental failure to save,
|
|---|
| 1025 | look for backup ("@i[file]@f[.BAK]") or checkpoint ("@i[file]@f[.CKP]") files
|
|---|
| 1026 | in the same directory where the file was.
|
|---|
| 1027 |
|
|---|
| 1028 | If the screen changes unexpectedly, you may have accidentally typed an
|
|---|
| 1029 | incorrect command. Use @binding[Home l] to see what it was. If you are
|
|---|
| 1030 | not familiar with the command, use @binding[Home c] to see what it is so that
|
|---|
| 1031 | you know what damage has been done. Many interesting commands can be found
|
|---|
| 1032 | in this fashion. This is an example of the much-underrated learning
|
|---|
| 1033 | technique known as "Learning by serendipitous malcoordination". Who would
|
|---|
| 1034 | ever think of looking for a command that deletes all files in the current
|
|---|
| 1035 | directory?
|
|---|
| 1036 |
|
|---|
| 1037 | If you accidentally type a "killing" command such as @binding[C-w], you can
|
|---|
| 1038 | get the lost text back using @binding[C-y]. The @hid[Undo] command is also
|
|---|
| 1039 | useful for recovering from this sort of problem.
|
|---|
| 1040 | @end[itemize]
|
|---|
| 1041 |
|
|---|
| 1042 | @defhvar[var "Region Query Size", val {30}]
|
|---|
| 1043 | @index[large region]
|
|---|
| 1044 | Various commands ask for confirmation before modifying a region containing more
|
|---|
| 1045 | than this number of lines. If this is @nil, then these commands refrain from
|
|---|
| 1046 | asking, no matter how large the region is.
|
|---|
| 1047 | @enddefhvar
|
|---|
| 1048 |
|
|---|
| 1049 | @defcom[com "Undo"]
|
|---|
| 1050 | This command undoes the last major modification. Killing commands and some
|
|---|
| 1051 | other commands save information about their modifications, so accidental uses
|
|---|
| 1052 | may be retracted. This command displays the name of the operation to be undone
|
|---|
| 1053 | and asks for confirmation. If the affected text has been modified between the
|
|---|
| 1054 | invocations of @hid[Undo] and the command to be undone, then the result may be
|
|---|
| 1055 | somewhat incorrect but useful. Often @hid[Undo] itself can be undone by
|
|---|
| 1056 | invoking it again.
|
|---|
| 1057 | @enddefcom
|
|---|
| 1058 |
|
|---|
| 1059 |
|
|---|
| 1060 | @section[Recursive Edits]
|
|---|
| 1061 | @label[recursive-edits]
|
|---|
| 1062 | @index[recursive edits]
|
|---|
| 1063 | Some sophisticated commands, such as @hid[Query Replace], can place you in a
|
|---|
| 1064 | @i[recursive edit]. A recursive edit is simply a recursive invocation of
|
|---|
| 1065 | @hemlock done within a command. A recursive edit is useful because it allows
|
|---|
| 1066 | arbitrary editing to be done during the execution of a command without losing
|
|---|
| 1067 | any state that the command might have. When the user exits a recursive edit,
|
|---|
| 1068 | the command that entered it proceeds as though nothing happened. @Hemlock
|
|---|
| 1069 | notes recursive edits in the @hid[Echo Area] modeline, or status line. A
|
|---|
| 1070 | counter reflects the number of pending recursive edits.
|
|---|
| 1071 |
|
|---|
| 1072 | @defcom[com "Exit Recursive Edit", bind (C-M-z)]
|
|---|
| 1073 | This command exits the current recursive edit, returning @nil. If invoked when
|
|---|
| 1074 | not in a recursive edit, then this signals an user error.
|
|---|
| 1075 | @enddefcom
|
|---|
| 1076 |
|
|---|
| 1077 | @defcom[com "Abort Recursive Edit", bind (@bf<C-]>)]
|
|---|
| 1078 | This command causes the command which invoked the recursive edit to get an
|
|---|
| 1079 | error. If not in a recursive edit, this signals an user error.
|
|---|
| 1080 | @enddefcom
|
|---|
| 1081 |
|
|---|
| 1082 |
|
|---|
| 1083 | @section[User Errors]
|
|---|
| 1084 | @index[beeping]
|
|---|
| 1085 | @index[errors, user]
|
|---|
| 1086 | When in the course of editing, @hemlock is unable to do what it thinks you want
|
|---|
| 1087 | to do, then it brings this to your attention by a beep or a screen flash
|
|---|
| 1088 | (possibly accompanied by an explanatory echo area message such as @w<"@f[No
|
|---|
| 1089 | next line.]">.) Although the exact attention-getting mechanism may vary on the
|
|---|
| 1090 | output device and variable settings, this is always called @i[beeping].
|
|---|
| 1091 |
|
|---|
| 1092 | Whatever the circumstances, you had best try something else since @hemlock,
|
|---|
| 1093 | being far more stupid than you, is far more stubborn. @hemlock is an
|
|---|
| 1094 | extensible editor, so it is always possible to change the command that
|
|---|
| 1095 | complained to do what you wanted it to do.
|
|---|
| 1096 |
|
|---|
| 1097 | @section[Internal Errors]
|
|---|
| 1098 |
|
|---|
| 1099 | @index[errors, internal]A message of this form may appear in the echo
|
|---|
| 1100 | area, accompanied by a beep:
|
|---|
| 1101 | @begin[programexample]
|
|---|
| 1102 | Internal error:
|
|---|
| 1103 | Wrong type argument, NIL, should have been of type SIMPLE-VECTOR.
|
|---|
| 1104 | @end[programexample]
|
|---|
| 1105 | If the error message is a file related error such as the following, then
|
|---|
| 1106 | you have probably done something illegal which @hemlock did not catch,
|
|---|
| 1107 | but was detected by the file system:
|
|---|
| 1108 | @begin[programexample]
|
|---|
| 1109 | Internal error:
|
|---|
| 1110 | No access to "/lisp2/emacs/teco.mid"
|
|---|
| 1111 | @end[programexample]
|
|---|
| 1112 | Otherwise, you have found a bug. Try to avoid the behavior that resulted
|
|---|
| 1113 | in the error and report the problem to your system maintainer. Since @llisp
|
|---|
| 1114 | has fairly robust error recovery mechanisms, probably no damage has been
|
|---|
| 1115 | done.
|
|---|
| 1116 |
|
|---|
| 1117 | If a truly abominable error from which @hemlock cannot recover occurs,
|
|---|
| 1118 | then you will be thrown into the @llisp debugger. At this point it would be
|
|---|
| 1119 | a good idea to save any changes with @f[save-all-buffers] and then start
|
|---|
| 1120 | a new @llisp.
|
|---|
| 1121 |
|
|---|
| 1122 | @index[save-all-buffers, function]The @llisp function @f[save-all-buffers] may
|
|---|
| 1123 | be used to save modified buffers in a seriously broken @hemlock. To use this,
|
|---|
| 1124 | type "@f[(save-all-buffers)]" to the top-level ("@f[* ]") or debugger
|
|---|
| 1125 | ("@f<1] >") prompt and confirm saving of each buffer that should be saved.
|
|---|
| 1126 | Since this function will prompt in the "@f[Lisp]" window, it isn't very useful
|
|---|
| 1127 | when called inside of @hemlock.
|
|---|