;ELC   
;;; Compiled by rms@psilocin.ai.mit.edu on Sat Jun  6 14:17:40 1998
;;; from file /gd/gnu/emacs/lisp/textmodes/two-column.el
;;; in Emacs version 20.2.94.1
;;; with bytecomp version 2.45
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`two-column.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\204\n \301\302M\210\300\207" [fboundp frame-width screen-width] 2)
#@53 Keymap for commands for setting up two-column mode.
(defvar 2C-mode-map (byte-code "\301 \302\303\304#\210\302\305\304#\210\302\306\307#\210\302\310\311#\210)\207" [map make-sparse-keymap define-key "2" 2C-two-columns [f2] "b" 2C-associate-buffer "s" 2C-split] 4) (#$ . 707))
(fset '2C-command 2C-mode-map)
#@49 Keymap for commands for use in two-column mode.
(defvar 2C-minor-mode-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\312#\210\302\313\314#\210\302\315\316#\210\302\317\320#\210)\207" [map make-sparse-keymap define-key "1" 2C-merge "d" 2C-dissociate "o" 2C-associated-buffer "" 2C-newline "|" 2C-toggle-autoscroll "{" 2C-shrink-window-horizontally "}" 2C-enlarge-window-horizontally] 4) (#$ . 1026))
(byte-code "\305\306 \307\310	\311 $\210\307\312\313\311 $\210\307\314\315\311 $\210)B\nB\316\317\320\321\322\f\323&\207" [map 2C-minor-mode-map minor-mode-map-alist :prefix :group 2C-mode make-sparse-keymap substitute-key-definition 2C-command current-global-map enlarge-window-horizontally 2C-enlarge-window-horizontally shrink-window-horizontally 2C-shrink-window-horizontally custom-declare-group two-column nil "Minor mode for editing of two-column text" "2C-" frames] 8)
#@46 Marker to the associated buffer, if non-nil.
(defvar 2C-mode nil (#$ . 1960))
(byte-code "\301\302!\210\303\302\304\305#\210\306B\301\207" [minor-mode-alist make-variable-buffer-local 2C-mode put permanent-local t (2C-mode " 2C")] 4)
#@67 *Value of mode-line-format for a buffer in two-column minor mode.
(custom-declare-variable '2C-mode-line-format ''("-%*- %15b --" (-3 . "%p") "--%[(" mode-name minor-mode-alist "%n" mode-line-process ")%]%-") '(#$ . -2202) :type 'sexp :group 'two-column)
#@65 *Hook run in new buffer when it is associated with current one.
(custom-declare-variable '2C-other-buffer-hook ''text-mode '(#$ . -2463) :type 'function :group 'two-column)
#@96 *A string inserted between the two columns when merging.
This gets set locally by \[2C-split].
(custom-declare-variable '2C-separator '"" '(#$ . -2642) :type 'string :group 'two-column)
(put '2C-separator 'permanent-local t)
#@123 *The width of the first column.  (Must be at least `window-min-width')
This value is local for every buffer that sets it.
(custom-declare-variable '2C-window-width '40 '(#$ . -2874) :type 'integer :group 'two-column)
(byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local 2C-window-width put permanent-local t] 4)
#@163 *Base for calculating `fill-column' for a buffer in two-column minor mode.
The value of `fill-column' becomes `2C-window-width' for this buffer
minus this value.
(custom-declare-variable '2C-beyond-fill-column '4 '(#$ . -3216) :type 'integer :group 'two-column)
#@70 If non-nil, Emacs attempts to keep the two column's buffers aligned.
(custom-declare-variable '2C-autoscroll 't '(#$ . 3484) :type 'boolean :group 'two-column)
(byte-code "\302\300!\204 \303\300	B\304\300!\207" [2C-autoscroll-start current-load-list boundp nil make-variable-buffer-local] 2)
(defalias '2C-other #[(&optional req) "\203 \304!	\206 \305\300!\210\305\302!\210\205 \306\307!\207" [2C-mode 2C-mode-line-format mode-line-format req marker-buffer kill-local-variable error "You must first set two-column minor mode."] 2])
#@1577 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, i.e which will span both columns (eg.
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 ~/.emacs 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'.
(defalias '2C-mode #[(other) "\306\307!\210\310\307\311\312\313$\210	Z\314\315!\207" [2C-window-width 2C-beyond-fill-column fill-column 2C-mode-line-format mode-line-format other make-local-hook post-command-hook add-hook 2C-autoscroll nil t run-hooks 2C-mode-hook 2C-mode] 5 (#$ . 4034)])
#@343 Split current window vertically for two-column editing.
When called the first time, associates a buffer with the current
buffer in two-column minor mode (see  \[describe-mode] ).
Runs `2C-other-buffer-hook' in the new buffer.
When called again, restores the screen layout with the current buffer
first and the associated buffer to its right.
(defalias '2C-two-columns #[(&optional buffer) "\304 \305 W\203 \306\307\310\"\210\311	\305 Z^]!\210\312 \2032 \313\314!\210\315\312 !\210\313\316!\210\n\205X \317\310!\207\320\321 \313\314!\210\315\206D \322\323\324 P!!\210\204N \325\326!\210!\210\320\321 \313\316!\210!\207" [window-min-width 2C-window-width 2C-autoscroll buffer window-width frame-width enlarge-window 99999 t split-window-horizontally 2C-other other-window 1 switch-to-buffer -1 2C-toggle-autoscroll 2C-mode point-marker generate-new-buffer "2C/" buffer-name run-hooks 2C-other-buffer-hook] 6 (#$ . 5914) "P"])
#@197 Associate another buffer with this one in two-column minor mode.
Can also be used to associate a just previously visited file, by
accepting the proposed default buffer.

(See  \[describe-mode] .)
(defalias '2C-associate-buffer #[nil "p\304 \206 \305\306\307 \"\212\310q\210\304 \203' 	\304 =\204' \311\312\313\304 !\"\210\303\314 \236\205/ )	\203: \315 	Z\316!*\207" [b2 b1 2C-mode 2C-window-width 2C-other read-buffer "Associate buffer: " other-buffer nil error "Buffer already associated with buffer `%s'." buffer-name buffer-local-variables frame-width 2C-two-columns] 4 (#$ . 6850) nil])
#@727 Split a two-column text at point, into two buffers in two-column minor mode.
Point becomes the local value of `2C-window-width'.  Only lines that
have the ARG same preceding characters at that column get split.  The
ARG preceding characters without any leading whitespace become the local
value for `2C-separator'.  This way lines that continue across both
columns remain untouched in the first buffer.

This function can be used with a prototype line, to set up things.  You
write the first line of each column and then split that line.  E.g.:

First column's text    sSs  Second column's text
		       \___/\
			/    \
   5 character Separator      You type  M-5 \[2C-split]  with the point here.

(See  \[describe-mode] .)
(defalias '2C-split #[(arg) "\306 \203\" \307\310\311\306 !\312Q!\203 \212\306 q\210\313 \210)\202\" \314\315\316\"\210`i\317e`\"S\316\211\212\320!\210`\f{\321\fw\210\322\323!\210`\f{i)\324 \210\306 \212m?\205\244 iU\203j 	`\212\320!\210`){\230\204p \nT\202\235 `\320!\210\321\316x\210\f`|\210`\325\326\n\"\210\327\f\316\210m\203\223 `\202\225 `T#\210\f`|\210\330\331\332!\210\202Q .\207" [other chars n goal-column point arg 2C-other y-or-n-p "Overwrite associated buffer `" buffer-name "'? " erase-buffer signal quit nil count-lines backward-char " 	" make-local-variable 2C-separator 2C-two-columns insert-char 10 append-to-buffer 0 next-line 1 2C-window-width] 5 (#$ . 7458) "*p"])
#@130 Turn off two-column minor mode in current and associated buffer.
If the associated buffer is unmodified and empty, it is killed.
(defalias '2C-dissociate #[nil "p\212\301 \203B \301 q\203B \301 \203 \301 =\203B \302 \204. m\203. o\203. \303\304!\210\202B \305\306!\210\305\307!\210\305\310!\210\305\311!\210\305\312!\210)\305\306!\210\305\307!\210\305\310!\210\305\311!\210\305\312!)\207" [buffer 2C-other buffer-modified-p kill-buffer nil kill-local-variable 2C-mode 2C-window-width 2C-separator mode-line-format fill-column] 2 (#$ . 8900) nil])
#@691 Merges the associated buffer with the current buffer.
They get merged at the column, which is the value of `2C-window-width',
i.e. usually at the vertical window separator.  This separator gets
replaced with white space.  Beyond that the value of `2C-separator' gets
inserted on merged lines.  The two columns are thus pasted side by side,
in a single text.  If the other buffer is not displayed to the left of
this one, then this one becomes the left column.

If you want `2C-separator' on empty lines in the second column,
you should put just one space in them.  In the final result, you can strip
off trailing spaces with \[beginning-of-buffer] \[replace-regexp] [ SPC TAB ] + $ RET RET
(defalias '2C-merge #[nil "\305 @\306V\203 \307\310 !\311\312!=\203 \313\314!\210\212p\311\312!\315eb\210	q\210eb\210m\204Y `\315\210`{m\204; \315u\210\nq\210\316\230\204O \315\210j\210\f\261\210\317\320!\210	q\210\202) ,\321 \322 W\205f \323\324\312\"\207" [string b2 b1 2C-window-width 2C-separator window-edges 0 window-buffer previous-window 2C-other t other-window -1 nil "" next-line 1 window-width frame-width enlarge-window 99999] 3 (#$ . 9457) nil])
#@30 Switch to associated buffer.
(defalias '2C-associated-buffer #[nil "\302e`\"n\203\f \303\202 \304\\l\203 n\205 \304\202 i\305\306\307!!\203/ \310\305\306 !!\210\2024 \311\306 !\210\312\313	!!\210\203D \314!\202F \303*\207" [col line count-lines 1 0 get-buffer-window 2C-other t select-window switch-to-buffer newline goto-line move-to-column] 3 (#$ . 10624) nil])
#@38 Insert ARG newlines in both buffers.
(defalias '2C-newline #[(arg) "\301\213\210\302!\207" [arg ((byte-code "\301 \210\302!\207" [arg 2C-associated-buffer newline] 2)) newline] 2 (#$ . 11003) "P"])
#@142 Toggle autoscrolling, or set it iff prefix ARG is non-nil and positive.
When autoscrolling is turned on, this also realigns the two buffers.
(defalias '2C-toggle-autoscroll #[(arg) "\303 	\203 \304	!\305Y\202 \n?\211\203P \306\307 \310\311!\210\312e\303 \"\313\314\315!!\203N \306\313\314 !!\210	\312e\303 \"Z\212\316\317	\312\303 db\"Z\320Z\"\210)\321	!\210!\207\310\322!\207" [2C-autoscroll-start arg 2C-autoscroll window-start prefix-numeric-value 0 select-window selected-window message "Autoscrolling is on." count-lines get-buffer-window 2C-other t insert-char 10 -1 scroll-up "Autoscrolling is off."] 8 (#$ . 11210) "P"])
(defalias '2C-autoscroll #[nil "\205# \302\303 	:\203 \303 	A@@=\204 \302	A@@!\210\304\305\306\217\210!\207" [2C-autoscroll last-command-char select-window selected-window nil (byte-code "\204\n \302\303!\203O \304 U\204O \305 \203O \306\305 !\203O \307\304 \"\304 W\203- 	[\304 \310\306\305 !!\210\212\311\312	\307\304 db\"Z\313Z\"\210)\314	!\210\304 )\315\207" [2C-autoscroll-start lines 2C-toggle-autoscroll t window-start 2C-other get-buffer-window count-lines select-window insert-char 10 -1 scroll-up nil] 6) ((error))] 5])
#@40 Make current window ARG columns wider.
(defalias '2C-enlarge-window-horizontally #[(arg) "\302\303\"\210\304 \205 	\\\211\205 \304 q\205 	Z\211\207" [arg 2C-window-width enlarge-window t 2C-other] 3 (#$ . 12392) "p"])
#@43 Make current window ARG columns narrower.
(defalias '2C-shrink-window-horizontally #[(arg) "\301[!\207" [arg 2C-enlarge-window-horizontally] 2 (#$ . 12624) "p"])
(provide 'two-column)
