MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 18.117.158.174
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/emacs/24.3/lisp/textmodes/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/emacs/24.3/lisp/textmodes/two-column.elc
;ELC
;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:11:52 2024
;;; from file /builddir/build/BUILD/emacs-24.3/lisp/textmodes/two-column.el
;;; in Emacs version 24.3.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

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


(byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313\314\315\306\301&\210\310\316\317\320\314\321\306\301&\210\310\322\323\324\314\325\306\301&\210\326\322\327\330#\210\310\331\332\333\314\334\306\301&\210\335\331!\210\326\331\327\330#\210\310\336\337\340\314\334\306\301&\210\310\341\330\342\314\343\306\301&\207" [custom-declare-group two-column nil "Minor mode for editing of two-column text." :prefix "2C-" :group frames custom-declare-variable 2C-mode-line-format '("-%*- %15b --" (-3 . "%p") "--%[(" mode-name minor-mode-alist "%n" mode-line-process ")%]%-") "Value of `mode-line-format' for a buffer in two-column minor mode." :type sexp 2C-other-buffer-hook 'text-mode "Hook run in new buffer when it is associated with current one." function 2C-separator "" "A string inserted between the two columns when merging.\nThis gets set locally by \\[2C-split]." string put permanent-local t 2C-window-width 40 "The width of the first column.  (Must be at least `window-min-width'.)\nThis value is local for every buffer that sets it." integer make-variable-buffer-local 2C-beyond-fill-column 4 "Base for calculating `fill-column' for a buffer in two-column minor mode.\nThe value of `fill-column' becomes `2C-window-width' for this buffer\nminus this value." 2C-autoscroll "If non-nil, Emacs attempts to keep the two column's buffers aligned." boolean] 8)
#@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) (#$ . 1942))
(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) (#$ . 2262))
(byte-code "\303\304 \305\306	\307 $\210\305\310\311\307 $\210\305\312\313\307 $\210)B\nB\303\207" [map 2C-minor-mode-map minor-mode-map-alist 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] 6)
#@46 Marker to the associated buffer, if non-nil.
(defvar 2C-mode nil (#$ . 3063))
(byte-code "\301\302!\210\303\302\304\305#\210\306B\301\207" [minor-mode-alist make-variable-buffer-local 2C-mode put permanent-local t (2C-mode " 2C")] 4)
(defvar 2C-autoscroll-start nil)
(make-variable-buffer-local '2C-autoscroll-start)
(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])
#@1569 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'.
(defalias '2C-mode #[(other) "\306\307\310\311\312$\210	Z

\313\314!\207" [2C-window-width 2C-beyond-fill-column fill-column 2C-mode-line-format mode-line-format other add-hook post-command-hook 2C-autoscroll nil t run-hooks 2C-mode-hook 2C-mode] 5 (#$ . 3636)])
#@389 Split current window vertically for two-column editing.
\<global-map>When called the first time, associates a buffer with the current
buffer in two-column minor mode (use \[describe-mode] once in the mode,
for details.).  It 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 \204\n\305\306\307\"\210\310	\311 Z^]!\210\312 \203/\313\314!\210\315\312 !\210\313\316!\210\n\205U\317\307!\207\320\321 \313\314!\210\315\206A\322\323\324 P!!\210\204K\325\326!\210!\210\320\321 \313\316!\210!\207" [window-min-width 2C-window-width 2C-autoscroll buffer window-full-width-p enlarge-window 99999 t split-window-right frame-width 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 (#$ . 5479) "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 \"\310rq\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 (#$ . 6456) 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!\203r\306 q\210\313 \210)\202\"\314\315\316\"\210`i\317e`\"S\316\211\212
[u\210`\f{\320\fw\210\321\322!\210`\f{\323\324\316%&%\203V\325\202W\326&\324=\203b\327\202c\330\331 !\206j\332\333\334 !\"*\335\316%&%\203\325\202\200\326&\324=\203\213\327\202\214\330\331 !\206\223\332\333\334 !\"*\336\324!\336\335!i%')\337 \210\306 \212m?\205iU\203\304	`\212
[u\210`){\230\204\312\nT\202\367`
[u\210\320\316x\210\f`|\210`\340\341\n\"\210\342\f\316\210m\203\355`\202\357`T#\210\f`|\210\332\343y\210\344!\210\202\253.\207" [other chars n column point arg 2C-other y-or-n-p "Overwrite associated buffer `" buffer-name "'? " erase-buffer signal quit nil count-lines " 	" make-local-variable 2C-separator + left / ceiling car cadr window-fringes 0 float frame-char-width right scroll-bar-columns 2C-two-columns insert-char 10 append-to-buffer 1 move-to-column real side 2C-window-width] 6 (#$ . 7060) "*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\302 \203@rq\210\302 \203	\302 =\203?\303 \204+\304\305 !\203+\306 \210\202?\307\310!\210\307\311!\210\307\312!\210\307\313!\210\307\314!\210)*\307\310!\210\307\311!\210\307\312!\210\307\313!\210\307\314!\210\315 \207" [other buffer 2C-other buffer-modified-p zerop buffer-size kill-buffer kill-local-variable 2C-mode 2C-window-width 2C-separator mode-line-format fill-column force-mode-line-update] 2 (#$ . 8802) nil])
#@657 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 \[delete-trailing-whitespace].
(defalias '2C-merge #[nil "\305 @\306V\203\307\310 !\311\312!=\203\313\314!\210\212p\311\312!\315eb\210	q\210eb\210m\204X`\315\210`{m\204;\315u\210\nq\210\316\230\204O\315\210j\210\f\261\210\317y\210	q\210\202),\320 ?\205c\321\322\312\"\207" [string b2 b1 2C-window-width 2C-separator window-edges 0 window-buffer previous-window 2C-other t other-window -1 nil "" 1 window-full-width-p enlarge-window 99999] 3 (#$ . 9402) nil])
#@30 Switch to associated buffer.
(defalias '2C-associated-buffer #[nil "\302e`\"n\203\f\303\202
\304\\l\203n\205\304\202i\305\306\307!!\203/\310\305\306 !!\210\2024\311\306 !\210eb\210\312	Sy!\210\203G\313!\202I\303*\207" [col line count-lines 1 0 get-buffer-window 2C-other t select-window switch-to-buffer newline move-to-column] 3 (#$ . 10511) nil])
#@38 Insert ARG newlines in both buffers.
(defalias '2C-newline #[(arg) "\302 \303\216\304 \210\305	!\210*\305	!\207" [#1=#:wconfig arg current-window-configuration ((set-window-configuration #1#)) 2C-associated-buffer newline] 2 (#$ . 10883) "P"])
#@184 Toggle autoscrolling.
With prefix argument ARG, turn on autoscrolling if ARG is
positive, otherwise turn it off.  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\320	\312\303 db\"\321#\"\210)\322	!\210!\207\310\323!\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."] 9 (#$ . 11135) "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-event 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\313	\307\304 db\"\314#\"\210)\315	!\210\304 )\302\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] 7) ((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 (#$ . 12366) "p"])
#@43 Make current window ARG columns narrower.
(defalias '2C-shrink-window-horizontally #[(arg) "\301[!\207" [arg 2C-enlarge-window-horizontally] 2 (#$ . 12598) "p"])
(provide 'two-column)

MMCT - 2023