Next: Working with the Selection, Previous: Input line editing, Up: Edit and View modes [Contents]
Naming issue: Which is better: focus mode, or view mode, or pause mode, or paging mode, or select mode, or read mode, or read-only mode [too long]?
View mode changes makes the buffer read-only and changes keybindings
to make it easier to move around and examine it, and make selection.
It is similar to using an external pager such as less
or
the older more
.
Keystrokes are optimized for moving around and for making selections. No keystrokes or other events are sent to the application, nor do the they modify the input area. Output from the application is (by default) suspended.
Key-bindings are similar to line-edit mode.
toggle-paging-mode
)Enter or exit paging mode: If not in paging mode (in character or line-edit mode), enter paging mode. If there is a selection, the focus position is set to the “most recent” end of the selection. Otherwise, the focus position is initialized to the caret position.
If in paging mode, return to character or line-edit mode.
Exit paging mode, returning to character or line-edit mode.
Exit paging mode, toggling auto-paging as discussed below,
Moving around in paging mode follows the focus position, which is indicated a focus caret, by default a purple I-beam caret. This is different from the caret used for output, or the caret used for input in line-editing mode. When there is an non-empty selection, the focus position is one end of the selection; the other end is the anchor position.
Many of the following keyboard commands can be modified by previously-typed repeat count. This is similar to line-edit mode, but it is optional whether you press the Alt modifier.
Set or extend a repeat count. For example 1 2 Left moves 12 characters left, while Minus 2 Ctrl-Left moves 2 words right (because of the minus).
Commands that are affected by a repeat count contain count in the description. By default the count is one, and it is reset after each command.
Many of the key-binding in paging mode are the same as in line-edit mode. However, in line-edit mode most commands move the input caret, but in paging mode they mode the focus position.
These operations will scroll as needed so the focus remains visible.
A mouse click (button-1 with no modifiers) will also move the focus position.
All of these clear the selection if there is one.
backward-char
)forward-char
)Move the focus position count characters left or right.
backward-word
)forward-word
)Move the focus position count words left or right.
beginning-of-line
)end-of-line
)Move the focus position to start/end of line.
beginning-of-buffer
)end-of-buffer
)Move the focus position to start/end of the buffer.
Move the focus position count lines up.
Move the focus position count lines down. If that would extend past the end of the buffer and we are paused, unpause (while keeping view-mode keybindings) until there is enough output.
Move the focus position count pages up.
Move the focus position count pages up. Move the focus position count pages down. If that would extend past the end of the buffer and we are paused, unpause until there is enough output. (Stay in view-mode, though.)
Move the focus position count pages down. Similar to PgDown, but Space exits view mode and its keybindings.
Move the focus position count lines down. Similar to Down, but Enter exits view mode and its keybindings.
Modes:
Could there be auto-pause orthogonal mode?
Ctrl-Shift-M enters paging/paused mode.
Ctrl-Shift-M enters paging/paused mode.
Continue - un-pause but stay in paging mode. (Auto-pause off.)
Pause - stay in paging mode.
Exit paging mode, continue (un-pause) in line or char mode. (Auto-pause off.)
Exit paging mode, continue (un-pause) in line or char mode. Auto-pause is on, with a pause limit count pages down. Set pause-limit to focus point plus count * (availHeight - charHeight). or existing buffer end, whichever is more. (If there is no waiting output, continue until there is some, even if avove buffer limit ?)
Similar but pauselimit increased by count * charHeight.
Similar to Space/Return, but staying in view mode, but non-paused.
(Is this useful: Continue with infinite pauselimit, but go back to auto-pausing after next keyboard input.)
DomTerm includes a builtin “pager” that gives you
functionality similar to programs like less
.
You can set “auto-pause” which enters the pager each time
a full screen has been displayed.
We will discuss two related modes. Pager mode does the following:
less
program or Emacs “view mode”.
Pause mode additionally does the following:
You enter pause mode in two basic ways
To enable automatic-pause mode you can
check the Automatic Pager
option in the right-click (context) menu.
(You can also type ctrl-shift-M
(to enter pause mode);
then a
(to enable auto-pause and also exit pause mode).
To enter pager mode, you first have to enter pause mode,
and then type P
.
The following key-bindings are in effect in pager or paused mode. Some other these may be prefixed by a numeric count.
Toggle automatic-pause mode on and off, and then exit pager mode.
Move to count percent of the way between start and end positions.
Interrupt output by sending Ctrl-C to the application, and then exit paging mode after scrolling to the end.
Toggle between pager and paused modes.
Return to normal mode. If paused, allow further output.
Scroll count screenfuls down. If we go past the bottom of the current output, leave pause or pager mode, and allow further output. Temporarily set automatic-pause mode, so that we pause again if the screen fills up again.
((Calculate new-limit as top of (focus-)caret plus window height. If new-limit less-or-equal to bottom of buffer, move focus-caret to end-of-line containing new-limit - and scroll. Otherwise scroll (new-limit bottom of window), set pause-limit to new-limit, and un-pause.)) ((Either way, old top of focus-caret is scrolled to top of window.))
Scroll count lines down. Otherwise similar to Space.
Scroll count screenfuls up/down.
OLD: Scroll to the current “pager home”. (Details needed ...)
OLD: Scroll the end of the buffer. If paused and already at the end, un-pause. I.e. continue displaying output until the next action.
Enter find-text mode.
Focus mode changes some keybindings to make moving around and selecting in the buffer more convenient, while also defering updates in buffer. It is indicated (by default) using narrow purple vertical I-bar that marks the focus position. This is separate from the caret where program output inserted. If there is a selection, the focus position is one end (the most “recent”) of the selection. The other end is called the anchor position.
You can use the general scrolling shortcuts available in all modes, but in paging mode (as in line-edit mode) you don’t need to press Shift, and you can use a repeat count.
scroll-page-up
)scroll-page-down
)Scroll count pages up or down, respectively, without moving focus.
scroll-page-up
)scroll-page-down
)Scroll count pages up or down, respectively, moving focus.
scroll-line-up
)scroll-line-down
)Scroll count lines up or down, respectively.
scroll-top
)scroll-bottom
)Scroll to top or bottom, respectively, without moving focus
(scroll-bottom
)
Scroll to top or bottom, respectively.
The focus caret is a visible indicator of a highlighted position in the buffer, by default shown as a narrow purple vertical I-bar. Various keystroke combinations and mouse clicks are used to move the focus, which allows convenient navigation in the buffer, because the buffer is scrolled to make the focus always visible. When the selection is active, one endpoint is the focus position. The other the anchor position (also known as the “mark”, for those familiar with Emacs).
The following commands all move the focus, in either line-edit or paging modes. If the focus is not active, it is first set to the position of the output cursor. If there is non-empty selection, it is first collapsed to the focus end.
Available key-bindings:
Alt-Shift-PageUp/-PageDown/-Up/-Down/-Home/-End Scroll only, as in regular mode, without moving focus, selection, etc. PageUp/PageDown Move focus *and* scroll. For PageDown, maybe unpause (but stay in View auto-pause mode). Shift-PageUp/PageDown Extend selection *and* scroll. (Do not unpause.) Space Remove focus, unpause, leave View mode, but still auto-pause. 'c' Remove focus, unpause, leave View mode, but turn of auto-pause. Home/End (start/end line) Shift-Home/-End Extend to start/end of line (xterm and others bind Shift-PageUp/-PageDown/-Down/-Up to scroll but that would conflict with Line/View modes) In line-edit mode: Ctrl-Home/End (start/end of input) Ctrl-Home/-End Move focus to top/bottom, scroll as needed Shift-Ctrl-Home/End Extend to top/bottom Ctrl-PageUp/PageDown (same as plain PageUp/PageDown? or C-S-/Pu/PDn?) Ctrl-Up/Down (same as plain Up/Down? or C-S)
Needed actions:
Move caret one page (with scrolling) (Alt-PageUp/PageDown) Extend one page (with scrolling) (Shift-Alt-PageUp/PageDown )
Arrow keys (unshifted) in paging/view mode collapses selection and moves selection focus (and anchor - i.e collapsed) as indicated. (If no selection, use caret as initial focus.)
In char mode, shifted movement (Shift-Up, Ctrl-Shift-Right, etc) is encoded and sent to process. (Should probably clear selection if any - try on Emacs.) Shifted mouse-click-1 extends selection, unless mouse handling is enabled. In line and paging modes, shifted movement (Shift-Up, Ctrl-Shift-Right, etc) extends selection. So does shifted mouse-click-1.
If paused, if moving past end, continue. (Details?)
Next: Working with the Selection, Previous: Input line editing, Up: Edit and View modes [Contents]