Function: 2C-mode
2C-mode is a byte-compiled function defined in two-column.el.gz.
Signature
(2C-mode OTHER)
Documentation
Minor mode for independently editing two columns.
This is set up for two associated buffers by the three commands bound
to C-x 6 2 (2C-two-columns) , C-x 6 b (2C-associate-buffer) and C-x 6 s (2C-split).
Turning on two-column mode calls the value of the variable 2C-mode-hook,
if that value is non-nil.
These buffers can be edited separately, for example with fill-paragraph.
If you want to disable parallel scrolling temporarily, use M-x 2C-toggle-autoscroll (2C-toggle-autoscroll) .
If you include long lines that span both columns (e.g., source code), they should be in what will be the first column, with the associated buffer having empty lines next to them.
Potential uses are writing bilingual texts, or editing the comments of a source code. See the file lisp/two-column.el for detailed examples.
You have the following commands at your disposal:
C-x 6 2 (2C-two-columns) Rearrange screen with current buffer first
C-x 6 b (2C-associate-buffer) Reassociate buffer after changing major mode
C-x { (shrink-window-horizontally), C-x } (enlarge-window-horizontally) Shrink, enlarge current column
M-x 2C-associated-buffer (2C-associated-buffer) Switch to associated buffer at same point
M-x 2C-newline (2C-newline) Insert newline(s) in both buffers at same point
M-x 2C-merge (2C-merge) Merge both buffers
M-x 2C-dissociate (2C-dissociate) Dissociate the two buffers
These keybindings can be customized in your init file by
2C-mode-map, 2C-minor-mode-map and by binding 2C-command to
some prefix.
The appearance of the screen can be customized by the variables
2C-window-width, 2C-beyond-fill-column, 2C-mode-line-format and
truncate-partial-width-windows.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/two-column.el.gz
;; function for setting up two-column minor mode in a buffer associated
;; with the buffer pointed to by the marker other.
(defun 2C-mode (other)
"Minor mode for independently editing two columns.
This is set up for two associated buffers by the three commands bound
to \\[2C-two-columns] , \\[2C-associate-buffer] and \\[2C-split].
Turning on two-column mode calls the value of the variable `2C-mode-hook',
if that value is non-nil.
These buffers can be edited separately, for example with `fill-paragraph'.
If you want to disable parallel scrolling temporarily, use \\[2C-toggle-autoscroll] .
If you include long lines that span both columns (e.g., source
code), they should be in what will be the first column, with the
associated buffer having empty lines next to them.
Potential uses are writing bilingual texts, or editing the comments of a
source code. See the file lisp/two-column.el for detailed examples.
You have the following commands at your disposal:
\\[2C-two-columns] Rearrange screen with current buffer first
\\[2C-associate-buffer] Reassociate buffer after changing major mode
\\[shrink-window-horizontally], \\[enlarge-window-horizontally] Shrink, enlarge current column
\\[2C-associated-buffer] Switch to associated buffer at same point
\\[2C-newline] Insert newline(s) in both buffers at same point
\\[2C-merge] Merge both buffers
\\[2C-dissociate] Dissociate the two buffers
These keybindings can be customized in your init file by
`2C-mode-map', `2C-minor-mode-map' and by binding `2C-command' to
some prefix.
The appearance of the screen can be customized by the variables
`2C-window-width', `2C-beyond-fill-column', `2C-mode-line-format' and
`truncate-partial-width-windows'."
(add-hook 'post-command-hook #'2C-autoscroll nil t)
(setq fill-column (- 2C-window-width
2C-beyond-fill-column)
mode-line-format 2C-mode-line-format
2C-mode other)
(run-hooks '2C-mode-hook))