| 1 | @comment{-*- Dictionary: bld:scribe/hem/hem; Mode: spell; Package: Hemlock -*-}
|
|---|
| 2 | @chap[Special Modes]
|
|---|
| 3 |
|
|---|
| 4 | @section[Dired Mode]
|
|---|
| 5 | @label[dired]
|
|---|
| 6 | @index[directory editing]
|
|---|
| 7 |
|
|---|
| 8 | @hemlock provides a directory editing mechanism. The user can flag files and
|
|---|
| 9 | directories for deletion, undelete flagged files, and with a keystroke read in
|
|---|
| 10 | files and descend into directories. In some implementations, it also supports
|
|---|
| 11 | copying, renaming, and a simple wildcard feature.
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | @subsection[Inspecting Directories]
|
|---|
| 15 | @defcom[com "Dired", bind (C-x C-M-d)]
|
|---|
| 16 | This command prompts for a directory and fills a buffer with a verbose listing
|
|---|
| 17 | of that directory. When the prefix argument is supplied, this includes Unix
|
|---|
| 18 | dot files. If a dired buffer already exists for the directory, this switches
|
|---|
| 19 | to the buffer and makes sure it displays dot files if appropriate.
|
|---|
| 20 | @enddefcom
|
|---|
| 21 |
|
|---|
| 22 | @defcom[com "Dired with Pattern", bind (C-x C-M-d)]
|
|---|
| 23 | This command prompts for a directory and a pattern that may contain at most one
|
|---|
| 24 | wildcard, an asterisk, and it fills a buffer with a verbose listing of the
|
|---|
| 25 | files in the directory matching the pattern. When the prefix argument is
|
|---|
| 26 | supplied, this includes Unix dot files. If a dired buffer already exists for
|
|---|
| 27 | this directory, this switches to the buffer and makes sure it displays dot
|
|---|
| 28 | files if appropriate.
|
|---|
| 29 | @enddefcom
|
|---|
| 30 |
|
|---|
| 31 | @defcom[com "Dired from Buffer Pathname"]
|
|---|
| 32 | This command invokes @hid[Dired] on the directory name of the current buffer's
|
|---|
| 33 | pathname.
|
|---|
| 34 | @enddefcom
|
|---|
| 35 |
|
|---|
| 36 | @defcom[com "Dired Help", bind (Dired: ?)]
|
|---|
| 37 | This command pops up a help window listing the various @hid[Dired] commands.
|
|---|
| 38 | @enddefcom
|
|---|
| 39 |
|
|---|
| 40 | @defcom[com "Dired View File", bind (Dired: Space)]
|
|---|
| 41 | @defcom1[com "Dired Edit File", bind (Dired: e)]
|
|---|
| 42 | These command read in the file on the current line with the point. If the line
|
|---|
| 43 | describes a directory instead of a file, then this command effectively invokes
|
|---|
| 44 | @hid[Dired] on the specification. This associates the file's buffer with the
|
|---|
| 45 | @hid[Dired] buffer.
|
|---|
| 46 |
|
|---|
| 47 | @hid[Dired View File] reads in the file as if by @hid[View File], and
|
|---|
| 48 | @hid[Dired Edit File] as if by @hid[Find File].
|
|---|
| 49 |
|
|---|
| 50 | @hid[Dired View File] always reads into a newly created buffer, warning if the
|
|---|
| 51 | file already exists in some buffer.
|
|---|
| 52 | @enddefcom
|
|---|
| 53 |
|
|---|
| 54 | @defcom[com "Dired Up Directory", bind (Dired: ^)]
|
|---|
| 55 | This command invokes @hid[Dired] on the directory up one level from the current
|
|---|
| 56 | @hid[Dired] buffer. This is useful for going backwards after repeatedly
|
|---|
| 57 | invoking @hid[Dired View File] and descending into a series of subdirectories.
|
|---|
| 58 | Remember, @hid[Dired] only generates directory listings when no buffer contains
|
|---|
| 59 | a dired for the specified directory.
|
|---|
| 60 | @enddefcom
|
|---|
| 61 |
|
|---|
| 62 | @defcom[com "Dired Update Buffer", bind (Dired: H-u)]
|
|---|
| 63 | This command is useful when the user knows the directory in the current
|
|---|
| 64 | @hid[Dired] buffer has changed. @hemlock cannot know the directory structure
|
|---|
| 65 | has changed, but the user can explicitly update the buffer with this command
|
|---|
| 66 | instead of having to delete it and invoke @hid[Dired] again.
|
|---|
| 67 | @enddefcom
|
|---|
| 68 |
|
|---|
| 69 | @defcom[com "Dired Next File"]
|
|---|
| 70 | @defcom1[com "Dired Previous File"]
|
|---|
| 71 | These commands move to next or previous undeleted file.
|
|---|
| 72 | @enddefcom
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 | @subsection[Deleting Files]
|
|---|
| 76 | @defcom[com "Dired Delete File and Down Line", bind (Dired: d)]
|
|---|
| 77 | This command marks for deletion the file on the current line with the point and
|
|---|
| 78 | moves point down a line.
|
|---|
| 79 | @enddefcom
|
|---|
| 80 |
|
|---|
| 81 | @defcom[com "Dired Delete File with Pattern", bind (Dired: D)]
|
|---|
| 82 | This command prompts for a name pattern that may contain at most one wildcard,
|
|---|
| 83 | an asterisk, and marks for deletion all the names matching the pattern.
|
|---|
| 84 | @enddefcom
|
|---|
| 85 |
|
|---|
| 86 | @defcom[com "Dired Delete File", bind (Dired: C-d)]
|
|---|
| 87 | This command marks for deletion the file on the current line with the point
|
|---|
| 88 | without moving the point.
|
|---|
| 89 | @enddefcom
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 | @subsection[Undeleting Files]
|
|---|
| 93 | @defcom[com "Dired Undelete File and Down Line", bind (Dired: u)]
|
|---|
| 94 | This command unmarks for deletion the file on the current line with the point
|
|---|
| 95 | and moves point down a line.
|
|---|
| 96 | @enddefcom
|
|---|
| 97 |
|
|---|
| 98 | @defcom[com "Dired Undelete File with Pattern", bind (Dired: U)]
|
|---|
| 99 | This command prompts for a name pattern that may contain at most one wildcard,
|
|---|
| 100 | an asterisk, and unmarks for deletion all the names matching the pattern.
|
|---|
| 101 | @enddefcom
|
|---|
| 102 |
|
|---|
| 103 | @defcom[com "Dired Undelete File", bind (Dired: C-u)]
|
|---|
| 104 | This command unmarks for deletion the file on the current line with the point
|
|---|
| 105 | without moving the point.
|
|---|
| 106 | @enddefcom
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 | @subsection[Expunging and Quitting]
|
|---|
| 110 | @defcom[com "Dired Expunge Files", bind (Dired: !)]
|
|---|
| 111 | @defhvar1[var "Dired File Expunge Confirm", val {t}]
|
|---|
| 112 | @defhvar1[var "Dired Directory Expunge Confirm", val {t}]
|
|---|
| 113 | This command deletes files marked for deletion, asking the user for
|
|---|
| 114 | confirmation once for all the files flagged. It recursively deletes any marked
|
|---|
| 115 | directories, asking the user for confirmation once for all those marked.
|
|---|
| 116 | @hid[Dired File Expunge Confirm] and @hid[Dired Directory Expunge Confirm] when
|
|---|
| 117 | set to @nil individually inhibit the confirmation prompting for the appropriate
|
|---|
| 118 | deleting.
|
|---|
| 119 | @enddefcom
|
|---|
| 120 |
|
|---|
| 121 | @defcom[com "Dired Quit", bind (Dired: q)]
|
|---|
| 122 | This command expunges any marked files or directories as if by @hid[Expunge
|
|---|
| 123 | Dired Files] before deleting the @hid[Dired] buffer.
|
|---|
| 124 | @enddefcom
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 | @subsection[Copying Files]
|
|---|
| 128 | @defcom[com "Dired Copy File", bind (Dired: c)]
|
|---|
| 129 | This command prompts for a destination specification and copies the file on the
|
|---|
| 130 | line with the point. When prompting, the current line's specification is the
|
|---|
| 131 | default, which provides some convenience in supplying the destination. The
|
|---|
| 132 | destination is either a directory specification or a file name, and when it is
|
|---|
| 133 | the former, the source is copied into the directory under its current file name
|
|---|
| 134 | and extension.
|
|---|
| 135 | @enddefcom
|
|---|
| 136 |
|
|---|
| 137 | @defcom[com "Dired Copy with Wildcard", bind (Dired: C)]
|
|---|
| 138 | This command prompts for a name pattern that may contain at most one wildcard,
|
|---|
| 139 | an asterisk, and copies all the names matching the pattern. When prompting for
|
|---|
| 140 | a destination, this provides the @hid[Dired] buffer's directory as a default.
|
|---|
| 141 | The destination is either a directory specification or a file name with a
|
|---|
| 142 | wildcard. When it is the former, all the source files are copied into the
|
|---|
| 143 | directory under their current file names and extensions. When it is the later,
|
|---|
| 144 | each sources file's substitution for the wildcard causing it to match the first
|
|---|
| 145 | pattern replaces the wildcard in the destination pattern; for example, you
|
|---|
| 146 | might want to copy @f["*.txt"] to @f["*.text"].
|
|---|
| 147 | @enddefcom
|
|---|
| 148 |
|
|---|
| 149 | @defhvar[var "Dired Copy File Confirm", val {t}]
|
|---|
| 150 | @label[copy-confirm]
|
|---|
| 151 | This variable controls interaction with the user when it is not obvious what
|
|---|
| 152 | the copying process should do. This takes one of the following values:
|
|---|
| 153 | @Begin[Description]
|
|---|
| 154 | @true@\
|
|---|
| 155 | When the destination specification exists, the copying process stops and asks
|
|---|
| 156 | the user if it should overwrite the destination.
|
|---|
| 157 |
|
|---|
| 158 | @nil@\
|
|---|
| 159 | The copying process always copies the source file to the destination
|
|---|
| 160 | specification without interacting with the user.
|
|---|
| 161 |
|
|---|
| 162 | @kwd[update]@\
|
|---|
| 163 | When the destination specification exists, and its write date is newer than
|
|---|
| 164 | the source's write date, then the copying process stops and asks the user if it
|
|---|
| 165 | should overwrite the destination.
|
|---|
| 166 | @End[Description]
|
|---|
| 167 | @enddefhvar
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 | @subsection[Renaming Files]
|
|---|
| 171 | @defcom[com "Dired Rename File", bind (Dired: r)]
|
|---|
| 172 | Rename the file or directory under the point
|
|---|
| 173 | @enddefcom
|
|---|
| 174 |
|
|---|
| 175 | @defcom[com "Dired Rename with Wildcard", bind (Dired: R)]
|
|---|
| 176 | Rename files that match a pattern containing ONE wildcard.
|
|---|
| 177 | @enddefcom
|
|---|
| 178 |
|
|---|
| 179 | @defhvar[var "Dired Rename File Confirm", val {t}]
|
|---|
| 180 | When non-nil, @hid[Dired] will query before clobbering an existing file.
|
|---|
| 181 | @enddefhvar
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 | @section[View Mode]
|
|---|
| 185 | @hid[View] mode provides for scrolling through a file read-only, terminating
|
|---|
| 186 | the buffer upon reaching the end.
|
|---|
| 187 |
|
|---|
| 188 | @defcom[com "View File"]
|
|---|
| 189 | This command reads a file into a new buffer as if by "Visit File", but
|
|---|
| 190 | read-only. Bindings exist for scrolling and backing up in a single key stroke.
|
|---|
| 191 | @enddefcom
|
|---|
| 192 |
|
|---|
| 193 | @defcom[com "View Help", bind (View: ?)]
|
|---|
| 194 | This command shows a help message for @hid[View] mode.
|
|---|
| 195 | @enddefcom
|
|---|
| 196 |
|
|---|
| 197 | @defcom[com "View Edit File", bind (View: e)]
|
|---|
| 198 | This commands makes a buffer in @hid[View] mode a normal editing buffer,
|
|---|
| 199 | warning if the file exists in another buffer simultaneously.
|
|---|
| 200 | @enddefcom
|
|---|
| 201 |
|
|---|
| 202 | @defcom[com "View Scroll Down", bind (View: Space)]
|
|---|
| 203 | @defhvar1[var "View Scroll Deleting Buffer", val {t}]
|
|---|
| 204 | This command scrolls the current window down through its buffer. If the end of
|
|---|
| 205 | the file is visible, then this deletes the buffer if @hid[View Scroll Deleting
|
|---|
| 206 | Buffer] is set. If the buffer is associated with a @hid[Dired] buffer, this
|
|---|
| 207 | returns there instead of to the previous buffer.
|
|---|
| 208 | @enddefcom
|
|---|
| 209 |
|
|---|
| 210 | @defcom[com "View Return", bind (View: ^)]
|
|---|
| 211 | @defcom1[com "View Quit", bind (View: q)]
|
|---|
| 212 | These commands invoke a function that returns to the buffer that created the
|
|---|
| 213 | current buffer in @hid[View] mode. Sometimes this function does nothing, but
|
|---|
| 214 | it is useful for returning to @hid[Dired] buffers and similar @hemlock
|
|---|
| 215 | features.
|
|---|
| 216 |
|
|---|
| 217 | After invoking the viewing return function if there is one, @hid[View Quit]
|
|---|
| 218 | deletes the buffer that is current when the user invokes it.
|
|---|
| 219 | @enddefcom
|
|---|
| 220 |
|
|---|
| 221 | Also, bound in @hid[View] mode are the following commands:
|
|---|
| 222 | @Begin[Description]
|
|---|
| 223 | @binding[backspace], @binding[delete]@\Scrolls the window up.
|
|---|
| 224 |
|
|---|
| 225 | @binding[<]@\Goes to the beginning of the buffer.
|
|---|
| 226 |
|
|---|
| 227 | @binding[>]@\Goes to the end of the buffer.
|
|---|
| 228 | @End[Description]
|
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 | @section[Process Mode]
|
|---|
| 232 | @Label[process]
|
|---|
| 233 | @Index[shells]
|
|---|
| 234 | @Index[processes]
|
|---|
| 235 |
|
|---|
| 236 | @hid[Process] mode allows the user to execute a Unix process within a @hemlock
|
|---|
| 237 | buffer. These commands and default bindings cater to running Unix shells in
|
|---|
| 238 | buffers. For example, @hid[Stop Buffer Subprocess] is bound to @binding[H-z]
|
|---|
| 239 | to stop the process you are running in the shell instead of binding @hid[Stop
|
|---|
| 240 | Main Process] to this key which would stop the shell itself.
|
|---|
| 241 |
|
|---|
| 242 | @defcom[com "Shell", bind (C-M-s)]
|
|---|
| 243 | @defhvar1[var "Shell Utility", val {"/bin/csh"}]
|
|---|
| 244 | @defhvar1[var "Shell Utility Switches", val {@nil}]
|
|---|
| 245 | @defhvar1[var "Current Shell"]
|
|---|
| 246 | @defhvar1[var "Ask about Old Shells"]
|
|---|
| 247 | This command executes the process determined by the values of @hid(Shell
|
|---|
| 248 | Utility) and @hid(Shell Utility Switches) in a new buffer named @f["Shell n"]
|
|---|
| 249 | where @f["n"] is some distinguishing integer.
|
|---|
| 250 |
|
|---|
| 251 | @hid[Current Shell] is a @hemlock variable that holds to the current shell
|
|---|
| 252 | buffer. When @hid[Shell] is invoked, if there is a @hid[Current Shell], the
|
|---|
| 253 | command goes to that buffer.
|
|---|
| 254 |
|
|---|
| 255 | When there is no @hid[Current Shell], but shell buffers do exist, if @hid[Ask
|
|---|
| 256 | about Old Shells] is set, the @hid[Shell] command prompts for one of them,
|
|---|
| 257 | setting @hid[Current Shell] to the indicated shell, and goes to the buffer.
|
|---|
| 258 |
|
|---|
| 259 | Invoking @hid[Shell] with an argument forces the creation of a new shell
|
|---|
| 260 | buffer.
|
|---|
| 261 |
|
|---|
| 262 | @hid[Shell Utility] is the string name of the process to execute.
|
|---|
| 263 |
|
|---|
| 264 | @hid[Shell Utility Switches] is a string containing the default command line
|
|---|
| 265 | arguments to @hid[Shell Utility]. This is a string since the utility is
|
|---|
| 266 | typically @f["/bin/csh"], and this string can contain I/O redirection and other
|
|---|
| 267 | shell directives.
|
|---|
| 268 | @enddefcom
|
|---|
| 269 |
|
|---|
| 270 | @defcom[com "Shell Command Line in Buffer"]
|
|---|
| 271 | This command prompts for a buffer and a shell command line. It then runs a
|
|---|
| 272 | shell, giving it the command line, in the buffer.
|
|---|
| 273 | @enddefcom
|
|---|
| 274 |
|
|---|
| 275 | @defcom[com "Set Current Shell"]
|
|---|
| 276 | This command sets the value of @hid[Current Shell].
|
|---|
| 277 | @enddefcom
|
|---|
| 278 |
|
|---|
| 279 | @defcom[com "Stop Main Process"]
|
|---|
| 280 | This command stops the process running in the current buffer by sending a
|
|---|
| 281 | @f[:SIGTSTP] to that process. With an argument, stops the process using
|
|---|
| 282 | @f[:SIGSTOP].
|
|---|
| 283 | @enddefcom
|
|---|
| 284 |
|
|---|
| 285 | @defcom[com "Continue Main Process"]
|
|---|
| 286 | If the process in the current buffer is stopped, this command continues it.
|
|---|
| 287 | @enddefcom
|
|---|
| 288 |
|
|---|
| 289 | @defcom[com "Kill Main Process"]
|
|---|
| 290 | @defhvar1[var "Kill Process Confirm", val {t}]
|
|---|
| 291 | This command prompts for confirmation and kills the process running in the
|
|---|
| 292 | current buffer.
|
|---|
| 293 |
|
|---|
| 294 | Setting this variable to @nil inhibits @hemlock@comment{}'s prompting for confirmation.
|
|---|
| 295 | @enddefcom
|
|---|
| 296 |
|
|---|
| 297 | @defcom[com "Stop Buffer Subprocess", stuff (bound to @bf[H-z] in @hid[Process] mode)]
|
|---|
| 298 | This command stops the foreground subprocess of the process in the current
|
|---|
| 299 | buffer, similar to the effect of @binding[C-Z] in a shell.
|
|---|
| 300 | @enddefcom
|
|---|
| 301 |
|
|---|
| 302 | @defcom[com "Kill Buffer Subprocess"]
|
|---|
| 303 | This command kills the foreground subprocess of the process in the current
|
|---|
| 304 | buffer.
|
|---|
| 305 | @enddefcom
|
|---|
| 306 |
|
|---|
| 307 | @defcom[com "Interrupt Buffer Subprocess", stuff (bound to @bf[H-c] in @hid[Process] mode)]
|
|---|
| 308 | This command interrupts the foreground subprocess of the process in the
|
|---|
| 309 | current buffer, similar to the effect of @binding[C-C] in a shell.
|
|---|
| 310 | @enddefcom
|
|---|
| 311 |
|
|---|
| 312 | @defcom[com "Quit Buffer Subprocess", stuff (bound to @bf[H-\] in @hid[Process] mode)]
|
|---|
| 313 | This command dumps the core of the foreground subprocess of the processs in
|
|---|
| 314 | the current buffer, similar to the effect of @binding[C-\] in a shell.
|
|---|
| 315 | @enddefcom
|
|---|
| 316 |
|
|---|
| 317 | @defcom[com "Send EOF to Process", stuff (bound to @bf[H-d] in @hid[Process] mode)]
|
|---|
| 318 | This command sends the end of file character to the process in the current
|
|---|
| 319 | buffer, similar to the effect of @binding[C-D] in a shell.
|
|---|
| 320 | @enddefcom
|
|---|
| 321 |
|
|---|
| 322 | @defcom[com "Confirm Process Input", stuff (bound to @bf[Return] in @hid[Process] mode)]
|
|---|
| 323 | This command sends the text the user has inserted at the end of a process
|
|---|
| 324 | buffer to the process in that buffer. Resulting output is inserted at the end
|
|---|
| 325 | of the process buffer.
|
|---|
| 326 | @enddefcom
|
|---|
| 327 |
|
|---|
| 328 | The user may edit process input using commands that are shared with
|
|---|
| 329 | @hid[Typescript] mode, see section @ref[typescripts].
|
|---|
| 330 |
|
|---|
| 331 |
|
|---|
| 332 | @section[Bufed Mode]
|
|---|
| 333 | @hemlock provides a mechanism for managing buffers as an itemized list.
|
|---|
| 334 | @hid[Bufed] supports conveniently deleting several buffers at once, saving
|
|---|
| 335 | them, going to one, etc., all in a key stroke.
|
|---|
| 336 |
|
|---|
| 337 | @defcom[com "Bufed", bind (C-x C-M-b)]
|
|---|
| 338 | This command creates a list of buffers in a buffer supporting operations such
|
|---|
| 339 | as deletion, saving, and selection. If there already is a @hid[Bufed] buffer,
|
|---|
| 340 | this just goes to it.
|
|---|
| 341 | @enddefcom
|
|---|
| 342 |
|
|---|
| 343 | @defcom[com "Bufed Help"]
|
|---|
| 344 | This command pops up a display of @hid[Bufed] help.
|
|---|
| 345 | @enddefcom
|
|---|
| 346 |
|
|---|
| 347 | @defcom[com "Bufed Delete", bind (Bufed: C-d, C-D, D, d)]
|
|---|
| 348 | @defhvar1[var "Virtual Buffer Deletion", val {t}]
|
|---|
| 349 | @defhvar1[var "Bufed Delete Confirm", val {t}]
|
|---|
| 350 | @hid[Bufed Delete] deletes the buffer on the current line.
|
|---|
| 351 |
|
|---|
| 352 | When @hid[Virtual Buffer Deletion] is set, this merely flags the buffer for
|
|---|
| 353 | deletion until @hid[Bufed Expunge] or @hid[Bufed Quit] executes.
|
|---|
| 354 |
|
|---|
| 355 | Whenever these commands actually delete a buffer, if @hid[Bufed Delete Confirm]
|
|---|
| 356 | is set, then @hemlock prompts the user for permission; if more than one buffer
|
|---|
| 357 | is flagged for deletion, this only prompts once. For each modified buffer,
|
|---|
| 358 | @hemlock asks to save the buffer before deleting it.
|
|---|
| 359 | @enddefcom
|
|---|
| 360 |
|
|---|
| 361 | @defcom[com "Bufed Undelete", bind (Bufed: U, u)]
|
|---|
| 362 | This command undeletes the buffer on the current line.
|
|---|
| 363 | @enddefcom
|
|---|
| 364 |
|
|---|
| 365 | @defcom[com "Bufed Expunge", bind (Bufed: !)]
|
|---|
| 366 | This command expunges any buffers marked for deletion regarding @hid[Bufed
|
|---|
| 367 | Delete Confirm].
|
|---|
| 368 | @enddefcom
|
|---|
| 369 |
|
|---|
| 370 | @defcom[com "Bufed Quit", bind (Bufed: q)]
|
|---|
| 371 | This command kills the @hid[Bufed] buffer, expunging any buffers marked for
|
|---|
| 372 | deletion.
|
|---|
| 373 | @enddefcom
|
|---|
| 374 |
|
|---|
| 375 | @defcom[com "Bufed Goto", bind (Bufed: Space)]
|
|---|
| 376 | This command selects the buffer on the current line, switching to it.
|
|---|
| 377 | @enddefcom
|
|---|
| 378 |
|
|---|
| 379 | @defcom[com "Bufed Goto and Quit", bind (Bufed: S-leftdown)]
|
|---|
| 380 | This command goes to the buffer under the pointer, quitting @hid[Bufed]. It
|
|---|
| 381 | supplies a function for @hid[Generic Pointer Up] which is a no-op.
|
|---|
| 382 | @enddefcom
|
|---|
| 383 |
|
|---|
| 384 | @defcom[com "Bufed Save File", bind (Bufed: s)]
|
|---|
| 385 | This command saves the buffer on the current line.
|
|---|
| 386 | @enddefcom
|
|---|
| 387 |
|
|---|
| 388 |
|
|---|
| 389 | @section[Completion]
|
|---|
| 390 | This is a minor mode that saves words greater than three characters in length,
|
|---|
| 391 | allowing later completion of those words. This is very useful for the often
|
|---|
| 392 | long identifiers used in Lisp programs. As you type a word, such as a Lisp
|
|---|
| 393 | symbol when in @hid[Lisp] mode, and you progress to typing the third letter,
|
|---|
| 394 | @hemlock displays a possible completion in the status line. You can then
|
|---|
| 395 | rotate through the possible completions or type some more letters to narrow
|
|---|
| 396 | down the possibilities. If you choose a completion, you can also rotate
|
|---|
| 397 | through the possibilities in the buffer instead of in the status line.
|
|---|
| 398 | Choosing a completion or inserting a character that delimits words moves the
|
|---|
| 399 | word forward in the ring of possible completions, so the next time you enter
|
|---|
| 400 | its initial characters, @hemlock will prefer it over less recently used
|
|---|
| 401 | completions.
|
|---|
| 402 |
|
|---|
| 403 | @defcom[com "Completion Mode"]
|
|---|
| 404 | This command toggles @hid[Completion] mode in the current buffer.
|
|---|
| 405 | @enddefcom
|
|---|
| 406 |
|
|---|
| 407 | @defcom[com "Completion Self Insert"]
|
|---|
| 408 | This command is like @hid[Self Insert], but it also checks for possible
|
|---|
| 409 | completions displaying any result in the status line. This is bound to most of
|
|---|
| 410 | the key-events with corresponding graphic characters.
|
|---|
| 411 | @enddefcom
|
|---|
| 412 |
|
|---|
| 413 | @defcom[com "Completion Complete Word", bind (Completion: End)]
|
|---|
| 414 | This command selects the currently displayed completion if there is one,
|
|---|
| 415 | guessing the case of the inserted text as with @hid[Query Replace]. Invoking
|
|---|
| 416 | this immediately in succession rotates through possible completions in the
|
|---|
| 417 | buffer. If there is no currently displayed completion on a first invocation,
|
|---|
| 418 | this tries to find a completion from text immediately before the point and
|
|---|
| 419 | displays the completion if found.
|
|---|
| 420 | @enddefcom
|
|---|
| 421 |
|
|---|
| 422 | @defcom[com "Completion Rotate Completions", bind (Completion: M-End)]
|
|---|
| 423 | This command displays the next possible completion in the status line. If
|
|---|
| 424 | there is no currently displayed completion, this tries to find a completion
|
|---|
| 425 | from text immediately before the point and displays the completion if found.
|
|---|
| 426 | @enddefcom
|
|---|
| 427 |
|
|---|
| 428 | @defcom[com "List Possible Completions"]
|
|---|
| 429 | This command lists all the possible completions for the text immediately before
|
|---|
| 430 | the point in a pop-up display. Sometimes this is more useful than rotating
|
|---|
| 431 | through several completions to see if what you want is available.
|
|---|
| 432 | @enddefcom
|
|---|
| 433 |
|
|---|
| 434 | @defhvar[var "Completion Bucket Size", val {20}]
|
|---|
| 435 | Completions are stored in buckets determined by the first three letters of a
|
|---|
| 436 | word. This variable limits the number of completions saved for each combination
|
|---|
| 437 | of the first three letters of a word. If you have many identifier in some
|
|---|
| 438 | module beginning with the same first three letters, you'll need increase this
|
|---|
| 439 | variable to accommodate all the names.
|
|---|
| 440 | @enddefhvar
|
|---|
| 441 |
|
|---|
| 442 |
|
|---|
| 443 | @defcom[com "Save Completions"]
|
|---|
| 444 | @defcom1[com "Read Completions"]
|
|---|
| 445 | @defhvar1[var "Completion Database Filename", val {nil}]
|
|---|
| 446 | @hid[Save Completions] writes the current completions to the file
|
|---|
| 447 | @hid[Completion Database Filename]. It writes them, so @hid[Read Completions]
|
|---|
| 448 | can read them back in preserving the most-recently-used order. If the user
|
|---|
| 449 | supplies an argument, then this prompts for a pathname.
|
|---|
| 450 |
|
|---|
| 451 | @hid[Read Completions] reads completions saved in @hid[Completion Database
|
|---|
| 452 | Filename]. It moves any current completions to a less-recently-used status,
|
|---|
| 453 | and it removes any in a given bucket that exceed the limit @hid[Completion
|
|---|
| 454 | Bucket Size].
|
|---|
| 455 | @enddefcom
|
|---|
| 456 |
|
|---|
| 457 | @defcom[com "Parse Buffer for Completions"]
|
|---|
| 458 | This command passes over the current buffer putting each valid completion word
|
|---|
| 459 | into the database. This is a good way of picking up many useful completions
|
|---|
| 460 | upon visiting a new file for which there are no saved completions.
|
|---|
| 461 | @enddefcom
|
|---|
| 462 |
|
|---|
| 463 |
|
|---|
| 464 | @section[CAPS-LOCK Mode]
|
|---|
| 465 |
|
|---|
| 466 | @hid[CAPS-LOCK] is a minor mode in which @hemlock that inserts all alphabetic
|
|---|
| 467 | characters as uppercase letters.
|
|---|
| 468 |
|
|---|
| 469 | @defcom[com "Caps Lock Mode"]
|
|---|
| 470 | This command toggles @hid[CAPS-LOCK] mode for the current buffer; it is most
|
|---|
| 471 | useful when bound to a key, so you can enter and leave @hid[CAPS-LOCK] mode
|
|---|
| 472 | casually.
|
|---|
| 473 | @enddefcom
|
|---|
| 474 |
|
|---|
| 475 | @defcom[com "Self Insert Caps Lock"]
|
|---|
| 476 | This command inserts the uppercase version of the character corresponding to
|
|---|
| 477 | the last key-event typed.
|
|---|
| 478 | @enddefcom
|
|---|
| 479 |
|
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 | @section[Overwrite Mode]
|
|---|
| 483 |
|
|---|
| 484 | @hid[Overwrite] mode is a minor mode which is useful for creating figures and
|
|---|
| 485 | tables out of text. In this mode, typing a key-event with a corresponding
|
|---|
| 486 | graphic character replaces the character at the point instead of inserting the
|
|---|
| 487 | character. @hid[Quoted Insert] can be used to insert characters normally.
|
|---|
| 488 |
|
|---|
| 489 | @defcom[com "Overwrite Mode"]
|
|---|
| 490 | This command turns on @hid[Overwrite] mode in the current buffer. If it is
|
|---|
| 491 | already on, then it is turned off. A positive argument turns @hid[Overwrite]
|
|---|
| 492 | mode on, while zero or a negative argument turns it off.
|
|---|
| 493 | @enddefcom
|
|---|
| 494 |
|
|---|
| 495 | @defcom[com "Self Overwrite"]
|
|---|
| 496 | This command replaces the next character with the character corresponding to
|
|---|
| 497 | the key-event used to invoke the command. After replacing the character, this
|
|---|
| 498 | moves past it. If the next character is a tab, this first expands the tab into
|
|---|
| 499 | the appropriate number of spaces, replacing just the next space character.
|
|---|
| 500 | At the end of the line, it inserts the
|
|---|
| 501 | character instead of clobbering the newline.
|
|---|
| 502 |
|
|---|
| 503 | This is bound to key-events with corresponding graphic characters in
|
|---|
| 504 | @hid[Overwrite] mode.
|
|---|
| 505 | @enddefcom
|
|---|
| 506 |
|
|---|
| 507 | @defcom[com "Overwrite Delete Previous Character",
|
|---|
| 508 | stuff (bound to @bf[Delete] and @bf[Backspace] in @hid[Overwrite] mode)]
|
|---|
| 509 | This command replaces the previous character with a space and moves backwards.
|
|---|
| 510 | This deletes tabs and newlines.
|
|---|
| 511 | @enddefcom
|
|---|
| 512 |
|
|---|
| 513 |
|
|---|
| 514 | @section[Word Abbreviation]
|
|---|
| 515 | @index[word abbreviation]
|
|---|
| 516 | Word abbreviation provides a way to speed the typing of frequently used words
|
|---|
| 517 | and phrases. When in @hid[Abbrev] mode, typing a word delimiter causes the
|
|---|
| 518 | previous word to be replaced with its @i[expansion] if there is one currently
|
|---|
| 519 | defined. The expansion for an abbrev may be any string, so this mode can be
|
|---|
| 520 | used for abbreviating programming language constructs and other more obscure
|
|---|
| 521 | uses. For example, @hid[Abbrev] mode can be used to automatically correct
|
|---|
| 522 | common spelling mistakes and to enforce consistent capitalization of
|
|---|
| 523 | identifiers in programs.
|
|---|
| 524 |
|
|---|
| 525 | @i[Abbrev] is an abbreviation for @i[abbreviation], which is used for
|
|---|
| 526 | historical reasons. Obviously the original writer of @hid[Abbrev] mode hated
|
|---|
| 527 | to type long words and could hardly use @hid[Abbrev] mode while writing
|
|---|
| 528 | @hid[Abbrev] mode.
|
|---|
| 529 |
|
|---|
| 530 | A word abbrev can be either global or local to a major mode. A global word
|
|---|
| 531 | abbrev is defined no matter what the current major mode is, while a mode word
|
|---|
| 532 | abbrev is only defined when its mode is the major mode in the current buffer.
|
|---|
| 533 | Mode word abbrevs can be used to prevent abbrev expansion in inappropriate
|
|---|
| 534 | contexts.
|
|---|
| 535 |
|
|---|
| 536 |
|
|---|
| 537 | @subsection[Basic Commands]
|
|---|
| 538 |
|
|---|
| 539 | @defcom[com "Abbrev Mode"]
|
|---|
| 540 | This command turns on @hid[Abbrev] mode in the current buffer. If @hid[Abbrev]
|
|---|
| 541 | mode is already on, it is turned off. @hid[Abbrev] mode must be on for the
|
|---|
| 542 | automatic expansion of word abbrevs to occur, but the abbreviation commands are
|
|---|
| 543 | bound globally and may be used at any time.
|
|---|
| 544 | @enddefcom
|
|---|
| 545 |
|
|---|
| 546 | @defcom[com "Abbrev Expand Only",
|
|---|
| 547 | stuff (bound to word-delimiters in @hid[Abbrev] mode)]
|
|---|
| 548 | This is the word abbrev expansion command. If the word before the point is a
|
|---|
| 549 | defined word abbrev, then it is replaced with its expansion. The replacement
|
|---|
| 550 | is done using the same case-preserving heuristic as is used by
|
|---|
| 551 | @hid[Query Replace]. This command is globally bound to @binding[M-Space] so
|
|---|
| 552 | that abbrevs can be expanded when @hid[Abbrev] mode is off. An undesirable
|
|---|
| 553 | expansion may be inhibited by using @binding[C-q] to insert the delimiter.
|
|---|
| 554 | @enddefcom
|
|---|
| 555 |
|
|---|
| 556 | @defcom[com "Inverse Add Global Word Abbrev", bind (C-x -)]
|
|---|
| 557 | @defcom1[com "Inverse Add Mode Word Abbrev", bind (C-x C-h, C-x Backspace)]
|
|---|
| 558 | @hid[Inverse Add Global Word Abbrev] prompts for a string and makes it the
|
|---|
| 559 | global word abbrev expansion for the word before the point.
|
|---|
| 560 |
|
|---|
| 561 | @hid[Inverse Add Mode Word Abbrev] is identical to
|
|---|
| 562 | @hid[Inverse Add Global Word Abbrev] except that it defines an expansion which
|
|---|
| 563 | is local to the current major mode.
|
|---|
| 564 | @enddefcom
|
|---|
| 565 |
|
|---|
| 566 | @defcom[com "Make Word Abbrev"]
|
|---|
| 567 | This command defines an arbitrary word abbreviation. It prompts for the mode,
|
|---|
| 568 | abbreviation and expansion. If the mode @f["Global"] is specified, then it
|
|---|
| 569 | makes a global abbrev.
|
|---|
| 570 | @enddefcom
|
|---|
| 571 |
|
|---|
| 572 | @defcom[com "Add Global Word Abbrev", bind (C-x +)]
|
|---|
| 573 | @defcom1[com "Add Mode Word Abbrev", bind (C-x C-a)]
|
|---|
| 574 | @hid[Add Global Word Abbrev] prompts for a word and defines it to be a global
|
|---|
| 575 | word abbreviation. The prefix argument determines which text is used as the
|
|---|
| 576 | expansion:
|
|---|
| 577 | @begin[description]
|
|---|
| 578 | @i[no prefix argument]@\The word before the point is used as the expansion of
|
|---|
| 579 | the abbreviation.
|
|---|
| 580 |
|
|---|
| 581 | @i[zero prefix argument]@\The text in the region is used as the expansion of the
|
|---|
| 582 | abbreviation.
|
|---|
| 583 |
|
|---|
| 584 | @i[positive prefix argument]@\That many words before the point are made the
|
|---|
| 585 | expansion of the abbreviation.
|
|---|
| 586 |
|
|---|
| 587 | @i[negative prefix argument]@\Do the same thing as
|
|---|
| 588 | @hid[Delete Global Word Abbrev] instead of defining an abbreviation.
|
|---|
| 589 | @end[description]
|
|---|
| 590 |
|
|---|
| 591 | @hid[Add Mode Word Abbrev] is identical to @hid[Add Global Word Abbrev] except
|
|---|
| 592 | that it defines or deletes mode word abbrevs in the current major mode.
|
|---|
| 593 | @enddefcom
|
|---|
| 594 |
|
|---|
| 595 | @defcom[com "Word Abbrev Prefix Mark", bind (M-")]
|
|---|
| 596 | This command allows @hid[Abbrev Expand Only] to recognize abbreviations when
|
|---|
| 597 | they have prefixes attached. First type the prefix, then use this command. A
|
|---|
| 598 | hyphen (@f[-]) will be inserted in the buffer. Now type the abbreviation and
|
|---|
| 599 | the word delimiter. @hid[Abbrev Expand Only] will expand the abbreviation and
|
|---|
| 600 | remove the hyphen.
|
|---|
| 601 |
|
|---|
| 602 | Note that there is no need for a suffixing command, since
|
|---|
| 603 | @hid[Abbrev Expand Only] may be used explicitly by typing @binding[M-Space].
|
|---|
| 604 | @enddefcom
|
|---|
| 605 |
|
|---|
| 606 | @defcom[com "Unexpand Last Word", bind (C-x u)]
|
|---|
| 607 | This command undoes the last word abbrev expansion. If repeated, undoes its
|
|---|
| 608 | own effect.
|
|---|
| 609 | @enddefcom
|
|---|
| 610 |
|
|---|
| 611 |
|
|---|
| 612 | @subsection[Word Abbrev Files]
|
|---|
| 613 | A word abbrev file is a file which holds word abbrev definitions. Word abbrev
|
|---|
| 614 | files allow abbrevs to be saved so that they may be used across many editing
|
|---|
| 615 | sessions.
|
|---|
| 616 |
|
|---|
| 617 | @defhvar[var "Abbrev Pathname Defaults", val {(pathname "abbrev.defns")}]
|
|---|
| 618 | This is sticky default for the following commands. When they prompt for a file
|
|---|
| 619 | to write, they offer this and set it for the next time one of them executes.
|
|---|
| 620 | @enddefhvar
|
|---|
| 621 |
|
|---|
| 622 | @defcom[com "Read Word Abbrev File"]
|
|---|
| 623 | This command reads in a word abbrev file, adding all the definitions to those
|
|---|
| 624 | currently defined. If a definition in the file is different from the current
|
|---|
| 625 | one, the current definition is replaced.
|
|---|
| 626 | @enddefcom
|
|---|
| 627 |
|
|---|
| 628 | @defcom[com "Write Word Abbrev File"]
|
|---|
| 629 | This command prompts for a file and writes all currently defined word abbrevs
|
|---|
| 630 | out to it.
|
|---|
| 631 | @enddefcom
|
|---|
| 632 |
|
|---|
| 633 | @defcom[com "Append to Word Abbrev File"]
|
|---|
| 634 | This command prompts for a word abbrev file and appends any new definitions to
|
|---|
| 635 | it. An abbrev is new if it has been defined or redefined since the last use of
|
|---|
| 636 | this command. Definitions made by reading word abbrev files are not
|
|---|
| 637 | considered.
|
|---|
| 638 | @enddefcom
|
|---|
| 639 |
|
|---|
| 640 |
|
|---|
| 641 | @subsection[Listing Word Abbrevs]
|
|---|
| 642 | @defcom[com "List Word Abbrevs"]
|
|---|
| 643 | @defcom1[com "Word Abbrev Apropos"]
|
|---|
| 644 | @hid[List Word Abbrevs] displays a list of each defined word abbrev, with its
|
|---|
| 645 | mode and expansion.
|
|---|
| 646 |
|
|---|
| 647 | @hid[Word Abbrev Apropos] is similar, except that it only displays abbrevs
|
|---|
| 648 | which contain a specified string, either in the definition, expansion or mode.
|
|---|
| 649 | @enddefcom
|
|---|
| 650 |
|
|---|
| 651 | @subsection[Editing Word Abbrevs]
|
|---|
| 652 | Word abbrev definition lists are edited by editing the text representation
|
|---|
| 653 | of the definitions. Word abbrev files may be edited directly, like any other
|
|---|
| 654 | text file. The set of abbrevs currently defined in @hemlock may be edited
|
|---|
| 655 | using the commands described in this section.
|
|---|
| 656 |
|
|---|
| 657 | The text representation of a word abbrev is fairly simple. Each definition
|
|---|
| 658 | begins at the beginning of a line. Each line has three fields which are
|
|---|
| 659 | separated by ASCII tab characters. The fields are the abbreviation, the mode
|
|---|
| 660 | of the abbreviation and the expansion. The mode is represented as the mode
|
|---|
| 661 | name inside of parentheses. If the abbrev is global, then the mode field is
|
|---|
| 662 | empty. The expansion is represented as a quoted string since it may contain
|
|---|
| 663 | any character. The string is quoted with double-quotes (@f["]); double-quotes
|
|---|
| 664 | in the expansion are represented by doubled double-quotes. The expansion may
|
|---|
| 665 | contain newline characters, in which case the definition will take up more than
|
|---|
| 666 | one line.
|
|---|
| 667 |
|
|---|
| 668 | @defcom[com "Edit Word Abbrevs"]
|
|---|
| 669 | This command inserts the current word abbrev definitions into the
|
|---|
| 670 | @hid[Edit Word Abbrevs] buffer and then enters a recursive edit on the buffer.
|
|---|
| 671 | When the recursive edit is exited, the definitions in the buffer become the new
|
|---|
| 672 | current abbrev definitions.
|
|---|
| 673 | @enddefcom
|
|---|
| 674 |
|
|---|
| 675 | @defcom[com "Insert Word Abbrevs"]
|
|---|
| 676 | This command inserts at the point the text representation of the currently
|
|---|
| 677 | defined word abbrevs.
|
|---|
| 678 | @enddefcom
|
|---|
| 679 |
|
|---|
| 680 | @defcom[com "Define Word Abbrevs"]
|
|---|
| 681 | This command interprets the text of the current buffer as a word abbrev
|
|---|
| 682 | definition list, adding all the definitions to those currently defined.
|
|---|
| 683 | @enddefcom
|
|---|
| 684 |
|
|---|
| 685 |
|
|---|
| 686 | @subsection[Deleting Word Abbrevs]
|
|---|
| 687 | The user may delete word abbrevs either individually or collectively.
|
|---|
| 688 | Individual abbrev deletion neutralizes single abbrevs which have outlived their
|
|---|
| 689 | usefulness; collective deletion provides a clean slate from which to initiate
|
|---|
| 690 | abbrev definitions.
|
|---|
| 691 |
|
|---|
| 692 | @defcom[com "Delete All Word Abbrevs"]
|
|---|
| 693 | This command deletes all word abbrevs which are currently defined.
|
|---|
| 694 | @enddefcom
|
|---|
| 695 |
|
|---|
| 696 | @defcom[com "Delete Global Word Abbrev"]
|
|---|
| 697 | @defcom1[com "Delete Mode Word Abbrev"]
|
|---|
| 698 | @hid[Delete Global Word Abbrev] prompts for a word abbreviation and deletes its
|
|---|
| 699 | global definition. If given a prefix argument, deletes all global abbrev
|
|---|
| 700 | definitions.
|
|---|
| 701 |
|
|---|
| 702 | @hid[Delete Mode Word Abbrev] is identical to @hid[Delete Global Word Abbrev]
|
|---|
| 703 | except that it deletes definitions in the current major mode.
|
|---|
| 704 | @enddefcom
|
|---|
| 705 |
|
|---|
| 706 |
|
|---|
| 707 | @section[Lisp Library]
|
|---|
| 708 | This is an implementation dependent feature. The Lisp library is a collection
|
|---|
| 709 | of local hacks that users can submit and share that is maintained by the Lisp
|
|---|
| 710 | group. These commands help peruse the catalog or description files and figure
|
|---|
| 711 | out how to load the entries.
|
|---|
| 712 |
|
|---|
| 713 | @defcom[com "Lisp Library"]
|
|---|
| 714 | This command finds all the library entries and lists them in a buffer. The
|
|---|
| 715 | following commands describe and load those entries.
|
|---|
| 716 | @enddefcom
|
|---|
| 717 |
|
|---|
| 718 | @defcom[com "Describe Library Entry", bind (Lisp-Lib: space)]
|
|---|
| 719 | @defcom1[com "Describe Pointer Library Entry", bind (Lisp-Lib: leftdown)]
|
|---|
| 720 | @defcom1[com "Load Library Entry", bind (Lisp-Lib: rightdown)]
|
|---|
| 721 | @defcom1[com "Load Pointer Library Entry", bind (Lisp-Lib: l)]
|
|---|
| 722 | @defcom1[com "Editor Load Library Entry"]
|
|---|
| 723 | @defcom1[com "Editor Load Pointer Library Entry"]
|
|---|
| 724 | @hid[Load Library Entry] and @hid[Load Pointer Library Entry] load the library
|
|---|
| 725 | entry indicated by the line on which the point lies or where the user clicked
|
|---|
| 726 | the pointer, respectively. These load the entry into the current slave Lisp.
|
|---|
| 727 |
|
|---|
| 728 | @hid[Editor Load Library Entry] and @hid[Editor Load Pointer Library Entry] are
|
|---|
| 729 | the same, but they load the entry into the editor Lisp.
|
|---|
| 730 | @enddefcom
|
|---|
| 731 |
|
|---|
| 732 | @defcom[com "Exit Lisp Library", bind (Lisp-Lib: q)]
|
|---|
| 733 | This command deletes the @hid[Lisp Library] buffer.
|
|---|
| 734 | @enddefcom
|
|---|
| 735 |
|
|---|
| 736 | @defcom[com "Lisp Library Help", bind (Lisp-Lib: ?)]
|
|---|
| 737 | This command pops up a help window listing @hid[Lisp-Lib] commands.
|
|---|
| 738 | @enddefcom
|
|---|