| 1 | @comment{-*- Dictionary: hem; Mode: spell; Package: Hemlock -*-}
|
|---|
| 2 | @chap[Basic Commands]
|
|---|
| 3 | @section[Motion Commands]
|
|---|
| 4 |
|
|---|
| 5 | @index[commands, basic]@index[motion]There is a fairly small number of
|
|---|
| 6 | basic commands for moving around in the buffer. While there are many other
|
|---|
| 7 | more complex motion commands, these are by far the most commonly used and
|
|---|
| 8 | the easiest to learn.
|
|---|
| 9 |
|
|---|
| 10 | @defcom[com "Forward Character", bind (C-f, Rightarrow)]
|
|---|
| 11 | @defcom1[com "Backward Character", bind (C-b, Leftarrow)]
|
|---|
| 12 | @index[character, motion]
|
|---|
| 13 | @hid[Forward Character] moves the point forward by one character. If a prefix
|
|---|
| 14 | argument is supplied, then the point is moved by that many characters.
|
|---|
| 15 | @hid[Backward Character] is identical, except that it moves the point
|
|---|
| 16 | backwards.
|
|---|
| 17 | @enddefcom
|
|---|
| 18 |
|
|---|
| 19 | @defcom[com "Forward Word", bind {M-f}]
|
|---|
| 20 | @defcom1[com "Backward Word", bind {M-b}]
|
|---|
| 21 | @index[word, motion]These commands move the point forward and backward
|
|---|
| 22 | over words. The point is always left between the last word and first
|
|---|
| 23 | non-word character in the direction of motion. This means that after moving
|
|---|
| 24 | backward the cursor appears on the first character of the word, while after
|
|---|
| 25 | moving forward, the cursor appears on the delimiting character. Supplying
|
|---|
| 26 | a prefix argument moves the point by that many words.
|
|---|
| 27 | @enddefcom
|
|---|
| 28 |
|
|---|
| 29 | @defcom[com "Next Line", bind (C-n, Downarrow)]
|
|---|
| 30 | @defcom1[com "Previous Line", bind (C-p, Uparrow)]
|
|---|
| 31 | @defcom1[com "Goto Absolute Line"]
|
|---|
| 32 | @index[line, motion]
|
|---|
| 33 | @hid[Next Line] and @hid[Previous Line] move to adjacent lines, while remaining
|
|---|
| 34 | the same distance within a line. Note that this motion is by logical lines,
|
|---|
| 35 | each of which may take up many lines on the screen if it wraps. If a prefix
|
|---|
| 36 | argument is supplied, then the point is moved by that many lines.
|
|---|
| 37 |
|
|---|
| 38 | The position within the line at the start is recorded, and each successive
|
|---|
| 39 | use of @binding[C-p] or @binding[C-n] attempts to move the point to that
|
|---|
| 40 | position on the new line. If it is not possible to move to the recorded
|
|---|
| 41 | position because the line is shorter, then the point is left at the end of
|
|---|
| 42 | the line.
|
|---|
| 43 |
|
|---|
| 44 | @hid[Goto Absolute Line] moves to the indicated line, as if you counted them
|
|---|
| 45 | starting at the beginning of the buffer with number one. If the user supplies
|
|---|
| 46 | a prefix argument, it is the line number; otherwise, @Hemlock prompts the user
|
|---|
| 47 | for the line.
|
|---|
| 48 | @enddefcom
|
|---|
| 49 |
|
|---|
| 50 | @defcom[com "End of Line", bind {C-e}]
|
|---|
| 51 | @defcom1[com "Beginning of Line", bind {C-a}]
|
|---|
| 52 | @hid[End of Line] moves the point to the end of the current line, while
|
|---|
| 53 | @hid[Beginning of Line] moves to the beginning. If a prefix argument is
|
|---|
| 54 | supplied, then the point is moved to the end or beginning of the line that
|
|---|
| 55 | many lines below the current one.
|
|---|
| 56 | @enddefcom
|
|---|
| 57 |
|
|---|
| 58 | @defcom[com "Scroll Window Down", bind {C-v}]
|
|---|
| 59 | @defcom1[com "Scroll Window Up", bind {M-v}]
|
|---|
| 60 | @index[scrolling]
|
|---|
| 61 | @hid[Scroll Window Down] moves forward in the buffer by one screenful of text,
|
|---|
| 62 | the exact amount being determined by the size of the window. If a prefix
|
|---|
| 63 | argument is supplied, then this scrolls the screen that many lines. When this
|
|---|
| 64 | action scrolls the line with the point off the screen, it this command moves
|
|---|
| 65 | the point to the vertical center of the window. @hid[Scroll Window Up] is
|
|---|
| 66 | identical to @hid[Scroll Window Down], except that it moves backwards.
|
|---|
| 67 | @enddefcom
|
|---|
| 68 |
|
|---|
| 69 | @defhvar[var "Scroll Overlap", val {2}]
|
|---|
| 70 | This variable is used by @hid[Scroll Window Down] and @hid[Scroll Window Up] to
|
|---|
| 71 | determine the number of lines by which the new and old screen should overlap.
|
|---|
| 72 | @enddefhvar
|
|---|
| 73 |
|
|---|
| 74 | @defcom[com "End of Buffer", bind (M-<)]
|
|---|
| 75 | @defcom1[com "Beginning of Buffer", bind (@bf[M->])]
|
|---|
| 76 | These commands are used to conveniently get to the very beginning and end of the
|
|---|
| 77 | text in a buffer. Before the point is moved, its position is saved by
|
|---|
| 78 | pushing it on the mark stack (see page @pageref[marks]).
|
|---|
| 79 | @enddefcom
|
|---|
| 80 |
|
|---|
| 81 | @defcom[com "Top of Window", bind (M-,)]
|
|---|
| 82 | @defcom1[com "Bottom of Window", bind (M-.)]
|
|---|
| 83 | @index[window, motion]@hid[Top of Window] moves the point to the beginning of
|
|---|
| 84 | the first line displayed in the current window. @hid[Bottom of Window] moves
|
|---|
| 85 | to the beginning of the last line displayed.
|
|---|
| 86 | @enddefcom
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 | @section[The Mark and The Region]
|
|---|
| 90 |
|
|---|
| 91 | @label[marks]@index[marks]@index[region]@index[selection]Each buffer has a
|
|---|
| 92 | distinguished position known as the @i[mark]. The mark initially points to the
|
|---|
| 93 | beginning of the buffer. The area between the mark and the point is known as
|
|---|
| 94 | the @i[region]. Many @hemlock commands which manipulate large pieces of text
|
|---|
| 95 | use the text in the region. To use these commands, one must first use some
|
|---|
| 96 | command to mark the region.
|
|---|
| 97 |
|
|---|
| 98 | @index[active regions]Although the mark is always pointing somewhere (initially
|
|---|
| 99 | to the beginning of the buffer), region commands insist that the region be made
|
|---|
| 100 | @i[active] before it can be used. This prevents accidental use of a region
|
|---|
| 101 | command from mysteriously mangling large amounts of text.
|
|---|
| 102 |
|
|---|
| 103 | @defhvar[var "Active Regions Enabled", val {t}]
|
|---|
| 104 | When this variable is true, region commands beep unless the region is active.
|
|---|
| 105 | This may be set to @false for more traditional @emacs region semantics.
|
|---|
| 106 | @enddefhvar
|
|---|
| 107 |
|
|---|
| 108 | Once a marking command makes the region active, it remains active until:
|
|---|
| 109 | @begin[itemize]
|
|---|
| 110 | a command uses the region,
|
|---|
| 111 |
|
|---|
| 112 | a command modifies the buffer,
|
|---|
| 113 |
|
|---|
| 114 | a command changes the current window or buffer,
|
|---|
| 115 |
|
|---|
| 116 | a command signals an editor error,
|
|---|
| 117 |
|
|---|
| 118 | or the user types @binding[C-g].
|
|---|
| 119 | @end[itemize]
|
|---|
| 120 | Motion commands have the effect of redefining the region, since they move the
|
|---|
| 121 | point and leave the region active.
|
|---|
| 122 |
|
|---|
| 123 | @index[ephemerally active regions]Commands that insert a large chunk of
|
|---|
| 124 | text into the buffer usually set an @i[ephemerally active] region around
|
|---|
| 125 | the inserted text. An ephemerally active region is always deactivated by
|
|---|
| 126 | the next command, regardless of the kind of command. The ephemerally
|
|---|
| 127 | active region allows an immediately following region command to manipulate
|
|---|
| 128 | the inserted text, but doesn't persist annoyingly. This is also very
|
|---|
| 129 | useful with active region highlighting, since it visibly marks the inserted
|
|---|
| 130 | text.
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 | @defhvar[var "Highlight Active Region", val {t}]
|
|---|
| 134 | @defhvar1[var "Active Region Highlighting Font", val {nil}]
|
|---|
| 135 | When @hid[Highlight Active Region] is true, @hemlock displays the text in the
|
|---|
| 136 | region in a different font whenever the region is active. This provides a
|
|---|
| 137 | visible indication of what text will be manipulated by a region command.
|
|---|
| 138 | Active region highlighting is only supported under @windows.
|
|---|
| 139 |
|
|---|
| 140 | @hid[Active Region Highlighting Font] is the name of the font to use for active
|
|---|
| 141 | region highlighting. If unspecified, @hemlock uses an underline font.
|
|---|
| 142 | @enddefhvar
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 | @defcom[com "Set/Pop Mark", bind (C-@@)]
|
|---|
| 146 | This command moves the mark to the point (saving the old mark on the mark
|
|---|
| 147 | stack) and activates the region. After using this command to mark one end of
|
|---|
| 148 | the region, use motion commands to move to the other end, then do the region
|
|---|
| 149 | command. This is the traditional @emacs marking command; when running under a
|
|---|
| 150 | windowing system with mouse support, it is usually easier to use the mouse with
|
|---|
| 151 | the @comref[Point to Here] and @comref[Generic Pointer Up].
|
|---|
| 152 |
|
|---|
| 153 | For historical reasons, the prefix argument causes this command to do things
|
|---|
| 154 | that are distinct commands in @Hemlock. A prefix argument of four does
|
|---|
| 155 | @hid[Pop and Goto Mark], and a prefix argument of @f[16] does
|
|---|
| 156 | @hid[Pop Mark].
|
|---|
| 157 | @enddefcom
|
|---|
| 158 |
|
|---|
| 159 | @defcom[com "Mark Whole Buffer", bind (C-x h)]
|
|---|
| 160 | @defcom1[com "Mark to Beginning of Buffer", bind (C-<)]
|
|---|
| 161 | @defcom1[com "Mark to End of Buffer", bind (C->)]
|
|---|
| 162 | @hid[Mark Whole Buffer] sets the region around the whole buffer, with the point
|
|---|
| 163 | at the beginning and the mark at the end. If a prefix argument is supplied,
|
|---|
| 164 | then the mark is put at the beginning and the point at the end. The mark is
|
|---|
| 165 | pushed on the mark stack beforehand, so popping the stack twice will restore
|
|---|
| 166 | it.
|
|---|
| 167 |
|
|---|
| 168 | @hid[Mark to Beginning of Buffer] sets the current region from point to the
|
|---|
| 169 | beginning of the buffer.
|
|---|
| 170 |
|
|---|
| 171 | @hid[Mark to End of Buffer] sets the current region from the end of the buffer
|
|---|
| 172 | to point.
|
|---|
| 173 | @enddefcom
|
|---|
| 174 |
|
|---|
| 175 | @defcom[com "Activate Region", bind (C-x C-Space, C-x C-@@)]
|
|---|
| 176 | This command makes the region active, using whatever the current position of
|
|---|
| 177 | the mark happens to be. This is useful primarily when the region is
|
|---|
| 178 | accidentally deactivated.
|
|---|
| 179 | @enddefcom
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 | @subsection[The Mark Stack]
|
|---|
| 183 |
|
|---|
| 184 | @index[mark stack]As was hinted at earlier, each buffer has a @i[mark stack],
|
|---|
| 185 | providing a history of positions in that buffer. The current mark is the mark
|
|---|
| 186 | on the top of the stack; earlier values are recovered by popping the stack.
|
|---|
| 187 | Since commands that move a long distance save the old position on the mark
|
|---|
| 188 | stack, the mark stack commands are useful for jumping to interesting places in
|
|---|
| 189 | a buffer without having to do a search.
|
|---|
| 190 |
|
|---|
| 191 | @defcom[com "Pop Mark", bind (C-M-Space)]
|
|---|
| 192 | @defcom1[com "Pop and Goto Mark", bind (M-@@, M-Space)]
|
|---|
| 193 | @hid[Pop Mark] pops the mark stack, restoring the current mark to the next most
|
|---|
| 194 | recent value. @hid[Pop and Goto Mark] also pops the mark stack, but instead of
|
|---|
| 195 | discarding the current mark, it moves the point to that position. Both
|
|---|
| 196 | commands deactivate the region.
|
|---|
| 197 | @enddefcom
|
|---|
| 198 |
|
|---|
| 199 | @defcom[com "Exchange Point and Mark", bind (C-x C-x)]
|
|---|
| 200 | This command interchanges the position of the point and the mark, thus moving
|
|---|
| 201 | to where the mark was, and leaving the mark where the point was. This command
|
|---|
| 202 | can be used to switch between two positions in a buffer, since repeating it
|
|---|
| 203 | undoes its effect. The old mark isn't pushed on the mark stack, since it is
|
|---|
| 204 | saved in the point.
|
|---|
| 205 | @enddefcom
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 | @subsection[Using The Mouse]
|
|---|
| 209 |
|
|---|
| 210 | @index[mouse]It can be convenient to use the mouse to point to positions in
|
|---|
| 211 | text, especially when moving large distances. @hemlock defines several
|
|---|
| 212 | commands for using the mouse. These commands can only be used when running
|
|---|
| 213 | under @windows (see page @pageref[using-x].)
|
|---|
| 214 |
|
|---|
| 215 | @defcom[com "Here to Top of Window", bind (Rightdown)]
|
|---|
| 216 | @defcom1[com "Top Line to Here", bind (Leftdown)]
|
|---|
| 217 | @index[window, motion]@hid[Here to Top of Window] scrolls the window so as to
|
|---|
| 218 | move the line which is under the mouse cursor to the top of the window. This
|
|---|
| 219 | has the effect of moving forward in the buffer by the distance from the top of
|
|---|
| 220 | the window to the mouse cursor. @hid[Top Line to Here] is the inverse
|
|---|
| 221 | operation, it scrolls backward, moving current the top line underneath the
|
|---|
| 222 | mouse.
|
|---|
| 223 |
|
|---|
| 224 | If the mouse is near the left edge of a window, then these commands do smooth
|
|---|
| 225 | scrolling. @hid[Here To Top of Window] repeatedly scrolls the window up by one
|
|---|
| 226 | line until the mouse button is released. Similarly, @hid[Top Line to Here]
|
|---|
| 227 | smoothly scrolls down.
|
|---|
| 228 | @enddefcom
|
|---|
| 229 |
|
|---|
| 230 | @defcom[com "Point to Here", bind (Middledown, S-Leftdown)]
|
|---|
| 231 | This command moves the point to the position of the mouse, changing to a
|
|---|
| 232 | different window if necessary.
|
|---|
| 233 |
|
|---|
| 234 | When used in a window's modeline, this moves the point of the window's buffer
|
|---|
| 235 | to the position within the file that is the same percentage, start to end, as
|
|---|
| 236 | the horizontal position of the mouse within the modeline. This also makes this
|
|---|
| 237 | window current if necessary.
|
|---|
| 238 |
|
|---|
| 239 | This command supplies a function @hid[Generic Pointer Up] invokes if it runs
|
|---|
| 240 | without any intervening generic pointer up predecessors executing. If the
|
|---|
| 241 | position of the pointer is different than the current point when the user
|
|---|
| 242 | invokes @hid[Generic Pointer Up], then this function pushes a buffer mark at
|
|---|
| 243 | point and moves point to the pointer's position. This allows the user to mark
|
|---|
| 244 | off a region with the mouse.
|
|---|
| 245 | @enddefcom
|
|---|
| 246 |
|
|---|
| 247 | @defcom[com "Generic Pointer Up", bind (Middleup, S-Leftup)]
|
|---|
| 248 | Other commands determine this command's action by supplying functions that
|
|---|
| 249 | this command invokes. The following built-in commands supply the following
|
|---|
| 250 | generic up actions:
|
|---|
| 251 | @Begin[Description]
|
|---|
| 252 | @hid[Point to Here]@\
|
|---|
| 253 | When the position of the pointer is different than the current point, the
|
|---|
| 254 | action pushes a buffer mark at point and moves point to the pointer's position.
|
|---|
| 255 |
|
|---|
| 256 | @hid[Bufed Goto and Quit]@\
|
|---|
| 257 | The action is a no-op.
|
|---|
| 258 | @End[Description]
|
|---|
| 259 | @enddefcom
|
|---|
| 260 |
|
|---|
| 261 | @defcom[com "Insert Kill Buffer", bind (S-Rightdown)]
|
|---|
| 262 | This command is a combination of @hid[Point to Here] and @comref[Un-Kill]. It
|
|---|
| 263 | moves the point to the mouse location and inserts the most recently killed
|
|---|
| 264 | text.
|
|---|
| 265 | @enddefcom
|
|---|
| 266 |
|
|---|
| 267 |
|
|---|
| 268 | @section[Modification Commands]
|
|---|
| 269 | @index[commands, modification]
|
|---|
| 270 |
|
|---|
| 271 | There is a wide variety of basic text-modification commands, but once again the
|
|---|
| 272 | simplest ones are the most often used.
|
|---|
| 273 |
|
|---|
| 274 | @subsection[Inserting Characters]
|
|---|
| 275 | @index[character, insertion]
|
|---|
| 276 | @index[insertion, character]
|
|---|
| 277 |
|
|---|
| 278 | In @hemlock, you can insert characters with graphic representations by typing
|
|---|
| 279 | the corresponding key-event which you normally generate with the obvious
|
|---|
| 280 | keyboard key. You can only insert characters whose codes correspond to ASCII
|
|---|
| 281 | codes. To insert those without graphic representations, use @hid[Quoted
|
|---|
| 282 | Insert].
|
|---|
| 283 |
|
|---|
| 284 | @defcom[com "Self Insert"]
|
|---|
| 285 | @hid[Self Insert] inserts into the buffer the character corresponding to the
|
|---|
| 286 | key-event typed to invoke the command. This command is normally bound to all
|
|---|
| 287 | such key-events @binding[Space]. If a prefix argument is supplied, then this
|
|---|
| 288 | inserts the character that many times.
|
|---|
| 289 | @enddefcom
|
|---|
| 290 |
|
|---|
| 291 | @defcom[com "New Line", bind (Return)]
|
|---|
| 292 | This command, which has roughly the same effect as inserting a @bf[Newline],
|
|---|
| 293 | is used to move onto a new blank line. If there are at least two blank
|
|---|
| 294 | lines beneath the current one then @binding[Return] cleans off any
|
|---|
| 295 | whitespace on the next line and uses it, instead of inserting a newline.
|
|---|
| 296 | This behavior is desirable when inserting in the middle of text, because
|
|---|
| 297 | the bottom half of the screen does not scroll down each time @hid[New Line]
|
|---|
| 298 | is used.
|
|---|
| 299 | @enddefcom
|
|---|
| 300 |
|
|---|
| 301 | @defcom[com "Quoted Insert", bind {C-q}]
|
|---|
| 302 | Many key-events have corresponding ASCII characters, but these key-events are
|
|---|
| 303 | bound to commands other than @hid[Self Insert]. Sometimes they are otherwise
|
|---|
| 304 | encumbered such as with @binding[C-g]. @hid[Quoted Insert] prompts for a
|
|---|
| 305 | key-event, without any command interpretation semantics, and inserts the
|
|---|
| 306 | corresponding character. If the appropriate character has some code other than
|
|---|
| 307 | an ASCII code, this will beep and abort the command. A common use for this
|
|---|
| 308 | command is inserting a @bf[Formfeed] by typing @binding[C-q C-l]. If a prefix
|
|---|
| 309 | argument is supplied, then the character is inserted that many times.
|
|---|
| 310 | @enddefcom
|
|---|
| 311 |
|
|---|
| 312 | @defcom[com "Open Line", bind {C-o}]
|
|---|
| 313 | This command inserts a newline into the buffer without moving the point.
|
|---|
| 314 | This command may also be given a prefix argument to insert a number of
|
|---|
| 315 | newlines, thus opening up some room to work in the middle of a screen of
|
|---|
| 316 | text. See also @comref[Delete Blank Lines].
|
|---|
| 317 | @enddefcom
|
|---|
| 318 |
|
|---|
| 319 |
|
|---|
| 320 | @subsection[Deleting Characters]
|
|---|
| 321 | @index[deletion, character]
|
|---|
| 322 | @index[character, deletion]
|
|---|
| 323 | There are a number of commands for deleting characters as well.
|
|---|
| 324 |
|
|---|
| 325 | @defhvar[var "Character Deletion Threshold", val {5}]
|
|---|
| 326 | If more than this many characters are deleted by a character deletion command,
|
|---|
| 327 | then the deleted text is placed in the kill ring.
|
|---|
| 328 | @enddefhvar
|
|---|
| 329 |
|
|---|
| 330 | @defcom[com "Delete Next Character", bind {C-d}]
|
|---|
| 331 | @defcom1[com "Delete Previous Character", bind (Delete, Backspace)]
|
|---|
| 332 | @hid[Delete Next Character] deletes the character immediately following the
|
|---|
| 333 | point, that is, the character which appears under the cursor. When given a
|
|---|
| 334 | prefix argument, @binding[C-d] deletes that many characters after the
|
|---|
| 335 | point. @hid[Delete Previous Character] is identical, except that it
|
|---|
| 336 | deletes characters before the point.
|
|---|
| 337 | @enddefcom
|
|---|
| 338 |
|
|---|
| 339 | @defcom[com "Delete Previous Character Expanding Tabs"]
|
|---|
| 340 | @hid[Delete Previous Character Expanding Tabs] is identical to
|
|---|
| 341 | @hid[Delete Previous Character], except that it treats tabs as the
|
|---|
| 342 | equivalent number of spaces. Various language modes that use tabs for
|
|---|
| 343 | indentation bind @binding[Delete] to this command.
|
|---|
| 344 | @enddefcom
|
|---|
| 345 |
|
|---|
| 346 |
|
|---|
| 347 | @subsection[Killing and Deleting]
|
|---|
| 348 |
|
|---|
| 349 | @index[killing]@index[cutting]@index[pasting]@index[kill ring]@hemlock has many
|
|---|
| 350 | commands which kill text. Killing is a variety of deletion which saves the
|
|---|
| 351 | deleted text for later retrieval. The killed text is saved in a ring buffer
|
|---|
| 352 | known as the @i[kill ring]. Killing has two main advantages over deletion:
|
|---|
| 353 | @begin[enumerate]
|
|---|
| 354 | If text is accidentally killed, a not uncommon occurrence, then it can be
|
|---|
| 355 | restored.
|
|---|
| 356 |
|
|---|
| 357 | Text can be moved from one place to another by killing it and then
|
|---|
| 358 | restoring it in the new location.
|
|---|
| 359 | @end[enumerate]
|
|---|
| 360 |
|
|---|
| 361 | Killing is not the same as deleting. When a command is said to delete
|
|---|
| 362 | text, the text is permanently gone and is not pushed on the kill ring.
|
|---|
| 363 | Commands which delete text generally only delete things of little
|
|---|
| 364 | importance, such as single characters or whitespace.
|
|---|
| 365 |
|
|---|
| 366 | @subsection[Kill Ring Manipulation]
|
|---|
| 367 | @defcom[com "Un-Kill", bind {C-y}]
|
|---|
| 368 | @index[kill ring, manipulation]This command "yanks" back the most
|
|---|
| 369 | recently killed piece of text, leaving the mark before the inserted text
|
|---|
| 370 | and the point after. If a prefix argument is supplied, then the text that
|
|---|
| 371 | distance back in the kill ring is yanked.
|
|---|
| 372 | @enddefcom
|
|---|
| 373 |
|
|---|
| 374 | @defcom[com "Rotate Kill Ring", bind {M-y}]
|
|---|
| 375 | This command rotates the kill ring forward, replacing the most recently
|
|---|
| 376 | yanked text with the next most recent text in the kill ring. @binding[M-y]
|
|---|
| 377 | may only be used immediately after a use of @binding[C-y] or a previous
|
|---|
| 378 | use of @binding[M-y]. This command is used to step back through the text
|
|---|
| 379 | in the kill ring if the desired text was not the most recently killed, and
|
|---|
| 380 | thus could not be retrieved directly with a @binding[C-y]. If a prefix
|
|---|
| 381 | argument is supplied, then the kill ring is rotated that many times.
|
|---|
| 382 | @enddefcom
|
|---|
| 383 |
|
|---|
| 384 | @defcom[com "Kill Region", bind {C-w}]
|
|---|
| 385 | @index[region, killing]This command kills the text between the point and
|
|---|
| 386 | mark, pushing it onto the kill ring. This command is usually the best way
|
|---|
| 387 | to move or remove large quantities of text.
|
|---|
| 388 | @enddefcom
|
|---|
| 389 |
|
|---|
| 390 | @defcom[com "Save Region", bind {M-w}]
|
|---|
| 391 | This command pushes the text in the region on the kill ring, but doesn't
|
|---|
| 392 | actually kill it, giving an effect similar to typing @binding[C-w C-y].
|
|---|
| 393 | This command is useful for duplicating large pieces of text.
|
|---|
| 394 | @enddefcom
|
|---|
| 395 |
|
|---|
| 396 | @subsection[Killing Commands]
|
|---|
| 397 |
|
|---|
| 398 | @index[commands, killing]Most commands which kill text append into the
|
|---|
| 399 | kill ring, meaning that consecutive uses of killing commands will insert
|
|---|
| 400 | all text killed into the top entry in the kill ring. This allows large
|
|---|
| 401 | pieces of text to be killed by repeatedly using a killing command.
|
|---|
| 402 |
|
|---|
| 403 | @defcom[com "Kill Line", bind {C-k}]
|
|---|
| 404 | @defcom1[com "Backward Kill Line"]
|
|---|
| 405 | @index[line, killing]@hid[Kill Line] kills the text from the point to the
|
|---|
| 406 | end of the current line, deleting the line if it is empty. If a prefix
|
|---|
| 407 | argument is supplied, then that many lines are killed. Note that a prefix
|
|---|
| 408 | argument is not the same as a repeat count.
|
|---|
| 409 |
|
|---|
| 410 | @hid[Backward Kill Line] is similar, except that it kills from the point to the
|
|---|
| 411 | beginning of the line. If it is called at the beginning of the line, it kills
|
|---|
| 412 | the newline and any trailing whitespace on the previous line. With a prefix
|
|---|
| 413 | argument, this command is the same as @hid[Kill Line] with a negated argument.
|
|---|
| 414 | @enddefcom
|
|---|
| 415 |
|
|---|
| 416 | @defcom[com "Kill Next Word", bind {M-d}]
|
|---|
| 417 | @defcom1[com "Kill Previous Word", bind (M-Backspace, M-Delete)]
|
|---|
| 418 | @index[word, killing]@hid[Kill Next Word] kills from the point to the end
|
|---|
| 419 | of the current or next word. If a prefix argument is supplied, then that
|
|---|
| 420 | many words are killed. @hid[Kill Previous Word] is identical, except that
|
|---|
| 421 | it kills backward.
|
|---|
| 422 | @enddefcom
|
|---|
| 423 |
|
|---|
| 424 | @subsection[Case Modification Commands]
|
|---|
| 425 |
|
|---|
| 426 | @index[case modification]@hemlock provides a few case modification
|
|---|
| 427 | commands, which are often useful for correcting typos.
|
|---|
| 428 |
|
|---|
| 429 | @defcom[com "Capitalize Word", bind {M-c}]
|
|---|
| 430 | @defcom1[com "Lowercase Word", bind {M-l}]
|
|---|
| 431 | @defcom1[com "Uppercase Word", bind {M-u}]
|
|---|
| 432 | @index[word, case modification]These commands modify the case of the
|
|---|
| 433 | characters from the point to the end of the current or next word, leaving
|
|---|
| 434 | the point after the end of the word affected. A positive prefix argument
|
|---|
| 435 | modifies that many words, moving forward. A negative prefix argument
|
|---|
| 436 | modifies that many words before the point, but leaves the point unmoved.
|
|---|
| 437 | @enddefcom
|
|---|
| 438 |
|
|---|
| 439 | @defcom[com "Lowercase Region", bind (C-x C-l)]
|
|---|
| 440 | @defcom1[com "Uppercase Region", bind (C-x C-u)]
|
|---|
| 441 | @index[region, case modification]These commands case-fold the text in the
|
|---|
| 442 | region. Since these commands can damage large amounts of text, they ask for
|
|---|
| 443 | confirmation before modifying large regions and can be undone with @hid[Undo].
|
|---|
| 444 | @enddefcom
|
|---|
| 445 |
|
|---|
| 446 | @subsection[Transposition Commands]
|
|---|
| 447 |
|
|---|
| 448 | @index[transposition]@index[commands, transposition]@hemlock provides a
|
|---|
| 449 | number of transposition commands. A transposition command swaps the
|
|---|
| 450 | "things" before and after the point and moves forward one "thing". Just
|
|---|
| 451 | how a "thing" is defined depends on the particular transposition command.
|
|---|
| 452 | Transposition commands, particularly
|
|---|
| 453 | @hid[Transpose Characters] and @hid[Transpose Words], are useful for
|
|---|
| 454 | correcting typos. More obscure transposition commands can be used to amaze
|
|---|
| 455 | your friends and demonstrate your immense knowledge of exotic @emacs
|
|---|
| 456 | commands.
|
|---|
| 457 |
|
|---|
| 458 | To the uninitiated, the behavior of transposition commands may seem mysterious;
|
|---|
| 459 | this has led some implementors to attempt to improve the definition of
|
|---|
| 460 | transposition, but right-thinking people will accept no substitutes. The
|
|---|
| 461 | @emacs transposition definition used in @hemlock has two useful properties:
|
|---|
| 462 | @begin[enumerate]
|
|---|
| 463 | Repeated applications of a transposition command have a useful effect. The
|
|---|
| 464 | way to visualize this effect is that each use of the transposition command
|
|---|
| 465 | drags the previous thing over the next thing. It is possible to correct
|
|---|
| 466 | double transpositions easily using @hid[Transpose Characters].
|
|---|
| 467 |
|
|---|
| 468 | Transposition commands move backward with a negative prefix argument, thus
|
|---|
| 469 | undoing the effect of the equivalent positive argument.
|
|---|
| 470 | @end[enumerate]
|
|---|
| 471 |
|
|---|
| 472 | @defcom[com "Transpose Characters", bind {C-t}]
|
|---|
| 473 | @index[character, transposition]This command exchanges the characters on
|
|---|
| 474 | either side of the point and moves forward, unless at the end of a line, in
|
|---|
| 475 | which case it transposes the previous two characters without moving.
|
|---|
| 476 | @enddefcom
|
|---|
| 477 |
|
|---|
| 478 | @defcom[com "Transpose Lines", bind (C-x C-t)]
|
|---|
| 479 | @index[line, transposition]This command transposes the previous and
|
|---|
| 480 | current line, moving down to the next line. With a zero argument, it
|
|---|
| 481 | transposes the current line and the line the mark is on.
|
|---|
| 482 | @enddefcom
|
|---|
| 483 |
|
|---|
| 484 | @defcom[com "Transpose Words", bind {M-t}]
|
|---|
| 485 | @index[word, transposition]This command transposes the previous word and
|
|---|
| 486 | the current or next word.
|
|---|
| 487 | @enddefcom
|
|---|
| 488 |
|
|---|
| 489 |
|
|---|
| 490 | @defcom[com "Transpose Regions", bind (C-x t)]
|
|---|
| 491 | This command transposes two regions with endpoints defined by the mark stack
|
|---|
| 492 | and point. To use this command, place three marks (in order) at the start and
|
|---|
| 493 | end of the first region, and at the start of the second region, then place the
|
|---|
| 494 | point at the end of the second region. Unlike the other transposition
|
|---|
| 495 | commands, a second use will simply undo the effect of the first use, and to do
|
|---|
| 496 | even this, you must reactivate the current region.
|
|---|
| 497 | @enddefcom
|
|---|
| 498 |
|
|---|
| 499 |
|
|---|
| 500 | @subsection[Whitespace Manipulation]
|
|---|
| 501 | These commands change the amount of space between words. See also the
|
|---|
| 502 | indentation commands in section @ref[indentation].
|
|---|
| 503 |
|
|---|
| 504 | @defcom[com "Just One Space", bind (M-|)]
|
|---|
| 505 | @index[whitespace, manipulation]@index[indentation, manipulation]This
|
|---|
| 506 | command deletes all whitespace characters before and after the point and then
|
|---|
| 507 | inserts one space. If a prefix argument is supplied, then that number of
|
|---|
| 508 | spaces is inserted.
|
|---|
| 509 | @enddefcom
|
|---|
| 510 |
|
|---|
| 511 | @defcom[com "Delete Horizontal Space", bind (M-\)]
|
|---|
| 512 | This command deletes all blank characters around the point.
|
|---|
| 513 | @enddefcom
|
|---|
| 514 |
|
|---|
| 515 | @defcom[com "Delete Blank Lines", bind (C-x C-o)]
|
|---|
| 516 | This command deletes all blank lines surrounding the current line, leaving the
|
|---|
| 517 | point on a single blank line. If the point is already on a single blank line,
|
|---|
| 518 | then that line is deleted. If the point is on a non-blank line, then all blank
|
|---|
| 519 | lines immediately following that line are deleted. This command is often used
|
|---|
| 520 | to clean up after @comref[Open Line].
|
|---|
| 521 | @enddefcom
|
|---|
| 522 |
|
|---|
| 523 | @section[Filtering]
|
|---|
| 524 |
|
|---|
| 525 | @i[Filtering] is a simple way to perform a fairly arbitrary transformation
|
|---|
| 526 | on text. Filtering text replaces the string in each line with the result
|
|---|
| 527 | of applying a @llisp function of one argument to that string. The function must
|
|---|
| 528 | neither destructively modify the argument nor the return value. It is an
|
|---|
| 529 | error for the function to return a string containing newline characters.
|
|---|
| 530 |
|
|---|
| 531 | @defcom[com "Filter Region"]
|
|---|
| 532 | This function prompts for an expression which is evaluated to obtain a
|
|---|
| 533 | function to be used to filter the text in the region. For example, to
|
|---|
| 534 | capitalize all the words in the region one could respond:
|
|---|
| 535 | @begin[programexample]
|
|---|
| 536 | Function: #'@comment<>string-capitalize
|
|---|
| 537 | @end[programexample]
|
|---|
| 538 | Since the function may be called many times, it should probably be
|
|---|
| 539 | compiled. Functions for one-time use can be compiled using the compile
|
|---|
| 540 | function as in the following example which removes all the semicolons on any line
|
|---|
| 541 | which contains the string "@f[PASCAL]":
|
|---|
| 542 | @begin[programexample]
|
|---|
| 543 | Function: (compile nil '(lambda (s)
|
|---|
| 544 | (if (search "PASCAL" s)
|
|---|
| 545 | (remove #\; s)
|
|---|
| 546 | s)))
|
|---|
| 547 | @end[programexample]
|
|---|
| 548 | @enddefcom
|
|---|
| 549 |
|
|---|
| 550 | @section[Searching and Replacing]
|
|---|
| 551 | @index[searching]@index[replacing]
|
|---|
| 552 | Searching for some string known to appear in the text is a commonly used method
|
|---|
| 553 | of moving long distances in a file. Replacing occurrences of one pattern with
|
|---|
| 554 | another is a useful way to make many simple changes to text. @hemlock provides
|
|---|
| 555 | powerful commands for doing both of these operations.
|
|---|
| 556 |
|
|---|
| 557 | @defhvar[var "String Search Ignore Case", val {t}]
|
|---|
| 558 | @index[case sensitivity]
|
|---|
| 559 | This variable determines the kind of search done by searching and replacing
|
|---|
| 560 | commands.
|
|---|
| 561 | @enddefhvar
|
|---|
| 562 |
|
|---|
| 563 | @defcom[com "Incremental Search", bind {C-s}]
|
|---|
| 564 | @defcom1[com "Reverse Incremental Search", bind {C-r}]
|
|---|
| 565 | @hid[Incremental Search] searches for an occurrence of a string after the
|
|---|
| 566 | current point. It is known as an incremental search because it reads
|
|---|
| 567 | key-events form the keyboard one at a time and immediately searches for the
|
|---|
| 568 | pattern of corresponding characters as you type. This is useful because
|
|---|
| 569 | it is possible to initially type in a very short pattern and then add more
|
|---|
| 570 | characters if it turns out that this pattern has too many spurious matches.
|
|---|
| 571 |
|
|---|
| 572 | This command dispatches on the following key-events as sub-commands:
|
|---|
| 573 | @begin[description]
|
|---|
| 574 | @binding[C-s]@\
|
|---|
| 575 | Search forward for an occurrence of the current pattern. This can be used
|
|---|
| 576 | repeatedly to skip from one occurrence of the pattern to the next, or it can be
|
|---|
| 577 | used to change the direction of the search if it is currently a reverse search.
|
|---|
| 578 | If @binding[C-s] is typed when the search string is empty, then a search is
|
|---|
| 579 | done for the string that was used by the last searching command.
|
|---|
| 580 |
|
|---|
| 581 | @binding[C-r]@\
|
|---|
| 582 | Similar to @binding[C-s], except that it searches backwards.
|
|---|
| 583 |
|
|---|
| 584 | @binding[Delete, Backspace]@\
|
|---|
| 585 | Undoes the effect of the last key-event typed. If that key-event simply added
|
|---|
| 586 | to the search pattern, then this removes the character from the pattern, moving
|
|---|
| 587 | back to the last match found before entering the removed character. If the
|
|---|
| 588 | character was a @binding[C-s] or @binding[C-r], then this moves back to the
|
|---|
| 589 | previous match and possibly reverses the search direction.
|
|---|
| 590 |
|
|---|
| 591 | @binding[C-g]@\
|
|---|
| 592 | If the search is currently failing, meaning that there is no occurrence of the
|
|---|
| 593 | search pattern in the direction of search, then @binding[C-g] deletes enough
|
|---|
| 594 | characters off the end of the pattern to make it successful. If the search
|
|---|
| 595 | is currently successful, then @binding[C-g] causes the search to be aborted,
|
|---|
| 596 | leaving the point where it was when the search started. Aborting the search
|
|---|
| 597 | inhibits the saving of the current search pattern as the last search string.
|
|---|
| 598 |
|
|---|
| 599 | @binding[Escape]@\
|
|---|
| 600 | Exit at the current position in the text, unless the search string is empty,
|
|---|
| 601 | in which case a non-incremental string search is entered.
|
|---|
| 602 |
|
|---|
| 603 | @binding[C-q]@\
|
|---|
| 604 | Search for the character corresponding to the next key-event, rather than
|
|---|
| 605 | treating it as a command.
|
|---|
| 606 | @end[description]
|
|---|
| 607 | Any key-event not corresponding to a graphic character, except those just
|
|---|
| 608 | described, causes the search to exit. @hemlock then uses the key-event in it
|
|---|
| 609 | normal command interpretation.
|
|---|
| 610 |
|
|---|
| 611 | For example, typing @binding[C-a] will exit the search @i[and] go to the
|
|---|
| 612 | beginning of the current line. When either of these commands successfully
|
|---|
| 613 | exits, they push the starting position (before the search) on the mark stack.
|
|---|
| 614 | If the current region was active when the search started, this foregoes pushing
|
|---|
| 615 | a mark.
|
|---|
| 616 | @enddefcom
|
|---|
| 617 |
|
|---|
| 618 | @defcom[com "Forward Search", bind (M-s)]
|
|---|
| 619 | @defcom1[com "Reverse Search", bind (M-r)]
|
|---|
| 620 | These commands do a normal dumb string search, prompting for the search
|
|---|
| 621 | string in a normal dumb fashion. One reason for using a non-incremental
|
|---|
| 622 | search is that it may be faster since it is possible to specify a long
|
|---|
| 623 | search string from the very start. Since @hemlock uses the Boyer--Moore
|
|---|
| 624 | search algorithm, the speed of the search increases with the size of the
|
|---|
| 625 | search string.
|
|---|
| 626 | When either of these commands successfully exits, they push the starting
|
|---|
| 627 | position (before the search) on the mark stack. This is inhibited when the
|
|---|
| 628 | current region is active.
|
|---|
| 629 | @enddefcom
|
|---|
| 630 |
|
|---|
| 631 | @defcom[com "Query Replace", bind (M-%)]
|
|---|
| 632 | This command prompts in the echo area for a target string and a replacement
|
|---|
| 633 | string. It then searches for an occurrence of the target after the point.
|
|---|
| 634 | When it finds a match, it prompts for a key-event indicating what action to
|
|---|
| 635 | take. The following are valid responses:
|
|---|
| 636 | @begin[description]
|
|---|
| 637 | @binding[Space, y]@\
|
|---|
| 638 | Replace this occurrence of the target with the replacement string, and search
|
|---|
| 639 | again.
|
|---|
| 640 |
|
|---|
| 641 | @binding[Delete, Backspace, n]@\
|
|---|
| 642 | Do not replace this occurrence, but continue the search.
|
|---|
| 643 |
|
|---|
| 644 | @binding[!]@\
|
|---|
| 645 | Replace this and all remaining occurrences without prompting again.
|
|---|
| 646 |
|
|---|
| 647 | @binding[.]@\
|
|---|
| 648 | Replace this occurrence and exit.
|
|---|
| 649 |
|
|---|
| 650 | @binding[C-r]@\
|
|---|
| 651 | Go into a recursive edit (see page @pageref[recursive-edits]) at the current
|
|---|
| 652 | location. The search will be continued from wherever the point is left when
|
|---|
| 653 | the recursive edit is exited. This is useful for handling more complicated
|
|---|
| 654 | cases where a simple replacement will not achieve the desired effect.
|
|---|
| 655 |
|
|---|
| 656 | @binding[Escape]@\
|
|---|
| 657 | Exit without doing any replacement.
|
|---|
| 658 |
|
|---|
| 659 | @binding[Home, C-_, ?, h]@\
|
|---|
| 660 | Print a list of all the options available.
|
|---|
| 661 | @end[description]
|
|---|
| 662 | Any other key-event causes the command to exit, returning the key-event to the
|
|---|
| 663 | input stream; thus, @hemlock will interpret it normally for a command binding.
|
|---|
| 664 |
|
|---|
| 665 | When the current region is active, this command uses it instead of the region
|
|---|
| 666 | from point to the end of the buffer. This is especially useful when you expect
|
|---|
| 667 | to use the @binding[!] option.
|
|---|
| 668 |
|
|---|
| 669 | If the replacement string is all lowercase, then a heuristic is used that
|
|---|
| 670 | attempts to make the case of the replacement the same as that of the
|
|---|
| 671 | particular occurrence of the target pattern. If "@f[foo]" is being
|
|---|
| 672 | replaced with "@f[bar]" then "@f[Foo]" is replaced with "@f[Bar]" and
|
|---|
| 673 | "@f[FOO]" with "@f[BAR]".
|
|---|
| 674 |
|
|---|
| 675 | This command may be undone with @hid[Undo], but its undoing may not be undone.
|
|---|
| 676 | On a successful exit from this command, the starting position (before the
|
|---|
| 677 | search) is pushed on the mark stack.
|
|---|
| 678 | @enddefcom
|
|---|
| 679 |
|
|---|
| 680 | @defhvar[var "Case Replace", val {t}]
|
|---|
| 681 | @index[case sensitivity]
|
|---|
| 682 | If this variable is true then the case preserving heuristic in
|
|---|
| 683 | @hid[Query Replace] is enabled, otherwise all replacements are done with
|
|---|
| 684 | the replacement string exactly as specified.
|
|---|
| 685 | @enddefhvar
|
|---|
| 686 |
|
|---|
| 687 | @defcom[com "Replace String"]
|
|---|
| 688 | This command is the same as @hid[Query Replace] except it operates without ever
|
|---|
| 689 | querying the user before making replacements. After prompting for a target and
|
|---|
| 690 | replacement string, it replaces all occurrences of the target string following
|
|---|
| 691 | the point. If a prefix argument is specified, then only that many occurrences
|
|---|
| 692 | are replaced. When the current region is active, this command uses it instead
|
|---|
| 693 | of the region from point to the end of the buffer.
|
|---|
| 694 | @enddefcom
|
|---|
| 695 |
|
|---|
| 696 | @defcom[com "List Matching Lines"]
|
|---|
| 697 | This command prompts for a search string and displays in a pop-up window all
|
|---|
| 698 | the lines containing the string that are after the point. If a prefix argument
|
|---|
| 699 | is specified, then this displays that many lines before and after each matching
|
|---|
| 700 | line. When the current region is active, this command uses it instead of the
|
|---|
| 701 | region from point to the end of the buffer.
|
|---|
| 702 | @enddefcom
|
|---|
| 703 |
|
|---|
| 704 | @defcom[com "Delete Matching Lines"]
|
|---|
| 705 | @defcom1[com "Delete Non-Matching Lines"]
|
|---|
| 706 | @hid[Delete Matching Lines] prompts for a search string and deletes all lines
|
|---|
| 707 | containing the string that are after the point. Similarly, @hid[Delete
|
|---|
| 708 | Non-Matching Lines] deletes all lines following the point that do not contain
|
|---|
| 709 | the specified string. When the current region is active, these commands uses
|
|---|
| 710 | it instead of the region from point to the end of the buffer.
|
|---|
| 711 | @enddefcom
|
|---|
| 712 |
|
|---|
| 713 |
|
|---|
| 714 | @section[Page Commands]
|
|---|
| 715 | @index[page commands]
|
|---|
| 716 | Another unit of text recognized by @hemlock is the page. A @i[page] is a piece
|
|---|
| 717 | of text delimited by formfeeds (@f[^L]'s.) The first non-blank line after the
|
|---|
| 718 | page marker is the @i[page title]. The page commands are quite useful when
|
|---|
| 719 | logically distinct parts of a file are put on separate pages. See also
|
|---|
| 720 | @comref[Count Lines Page]. These commands only recognize @f[^L]'s at the
|
|---|
| 721 | beginning of a lines, so those quoted in string literals do not get in the way.
|
|---|
| 722 |
|
|---|
| 723 | @defcom[com "Previous Page", bind (C-x @bf<]>)]
|
|---|
| 724 | @defcom1[com "Next Page", bind (C-x [)]
|
|---|
| 725 | @hid[Previous Page] moves the point to the previous page delimiter, while
|
|---|
| 726 | @hid[Next Page] moves to the next one. Any page delimiters next to the point
|
|---|
| 727 | are skipped. The prefix argument is a repeat count.
|
|---|
| 728 | @enddefcom
|
|---|
| 729 |
|
|---|
| 730 | @defcom[com "Mark Page", bind (C-x C-p)]
|
|---|
| 731 | This command puts the point at the beginning of the current page and the mark
|
|---|
| 732 | at the end. If given a prefix argument, marks the page that many pages from the
|
|---|
| 733 | current one.
|
|---|
| 734 | @enddefcom
|
|---|
| 735 |
|
|---|
| 736 | @defcom[com "Goto Page"]
|
|---|
| 737 | This command does various things, depending on the prefix argument:
|
|---|
| 738 | @begin[description]
|
|---|
| 739 | @i[no argument]@\goes to the next page.
|
|---|
| 740 |
|
|---|
| 741 | @i[positive argument]@\goes to an absolute page number, moving that many pages
|
|---|
| 742 | from the beginning of the file.
|
|---|
| 743 |
|
|---|
| 744 | @i[zero argument]@\prompts for string and goes to the page with that string in
|
|---|
| 745 | its title. Repeated invocations in this manner continue searching from the
|
|---|
| 746 | point of the last find, and a first search with a particular pattern pushes a
|
|---|
| 747 | buffer mark.
|
|---|
| 748 |
|
|---|
| 749 | @i[negative argument]@\moves backward by that many pages, if possible.
|
|---|
| 750 | @end[description]
|
|---|
| 751 | @enddefcom
|
|---|
| 752 |
|
|---|
| 753 | @defcom[com "View Page Directory"]
|
|---|
| 754 | @defcom1[com "Insert Page Directory"]
|
|---|
| 755 | @hid[View Page Directory] uses a pop-up window to display the number and title
|
|---|
| 756 | of each page in the current buffer. @hid[Insert Page Directory] is the same
|
|---|
| 757 | except that it inserts the text at the beginning of the buffer. With a prefix
|
|---|
| 758 | argument, @hid[Insert Page Directory] inserts at the point.
|
|---|
| 759 | @enddefcom
|
|---|
| 760 |
|
|---|
| 761 |
|
|---|
| 762 | @section[Counting Commands]
|
|---|
| 763 |
|
|---|
| 764 | @defcom[com "Count Words"]
|
|---|
| 765 | This command counts the number of words from the current point to the end of
|
|---|
| 766 | the buffer, displaying a message in the echo area. When the current region is
|
|---|
| 767 | active, this uses it instead of the region from the point to the end of the
|
|---|
| 768 | buffer. Word delimiters are determined by the current major mode.
|
|---|
| 769 | @enddefcom
|
|---|
| 770 |
|
|---|
| 771 | @defcom[com "Count Lines"]
|
|---|
| 772 | This command counts the number of lines from the current point to the end of
|
|---|
| 773 | the buffer, displaying a message in the echo area. When the current region is
|
|---|
| 774 | active, this uses it instead of the region from the point to the end of the
|
|---|
| 775 | buffer.
|
|---|
| 776 | @enddefcom
|
|---|
| 777 |
|
|---|
| 778 | @defcom[com "Count Lines Page", bind (C-x l)]
|
|---|
| 779 | This command displays the number of lines in the current page and the number of
|
|---|
| 780 | lines before and after the point within that page. If given a prefix argument,
|
|---|
| 781 | the entire buffer is counted instead of just the current page.
|
|---|
| 782 | @enddefcom
|
|---|
| 783 |
|
|---|
| 784 | @defcom[com "Count Occurrences"]
|
|---|
| 785 | This command prompts for a search string and displays the number of occurrences
|
|---|
| 786 | of that string in the text from the point to the end of the buffer. When the
|
|---|
| 787 | current region is active, this uses it instead of the region from the point to
|
|---|
| 788 | the end of the buffer.
|
|---|
| 789 | @enddefcom
|
|---|
| 790 |
|
|---|
| 791 |
|
|---|
| 792 | @section[Registers]
|
|---|
| 793 | @index[registers]
|
|---|
| 794 | Registers allow you to save a text position or chunk of text associated with a
|
|---|
| 795 | key-event. This is a convenient way to repeatedly access a commonly-used
|
|---|
| 796 | location or text fragment. The concept and key bindings should be familiar to
|
|---|
| 797 | TECO users.
|
|---|
| 798 |
|
|---|
| 799 | @defcom[com "Save Position", bind (C-x s)]
|
|---|
| 800 | @defcom1[com "Jump to Saved Position", bind (C-x j)]
|
|---|
| 801 | These commands manipulate registers containing textual positions.
|
|---|
| 802 | @hid[Save Position] prompts for a register and saves the location of the
|
|---|
| 803 | current point in that register. @hid[Jump to Saved Position] prompts for a
|
|---|
| 804 | register and moves the point to the position saved in that register. If the
|
|---|
| 805 | saved position is in a different buffer, then that buffer is made current.
|
|---|
| 806 | @enddefcom
|
|---|
| 807 |
|
|---|
| 808 | @defcom[com "Put Register", bind (C-x x)]
|
|---|
| 809 | @defcom1[com "Get Register", bind (C-x g)]
|
|---|
| 810 | These commands manipulate registers containing text. @hid[Put Register]
|
|---|
| 811 | prompts for a register and puts the text in the current region into the
|
|---|
| 812 | register. @hid[Get Register] prompts for a register and inserts the text in
|
|---|
| 813 | that register at the current point.
|
|---|
| 814 | @enddefcom
|
|---|
| 815 |
|
|---|
| 816 | @defcom[com "List Registers"]
|
|---|
| 817 | @defcom1[com "Kill Register"]
|
|---|
| 818 | @hid[List Registers] displays a list of all the currently defined registers in
|
|---|
| 819 | a pop-up window, along with a brief description of their contents.
|
|---|
| 820 | @hid[Kill Register] prompts for the name of a register and deletes that
|
|---|
| 821 | register.
|
|---|
| 822 | @enddefcom
|
|---|