;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Tue May 3 21:55:05 1994 ;;; from file /gd/gnu/emacs/19.0/lisp/two-column.el ;;; emacs version 19.22.92.2. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/gd/gnu/emacs/19.0/lisp/two-column.el' was compiled for Emacs 19")) (defvar tc-mode-map nil "\ Keymap for commands for two-column mode.") (byte-code "„OÁ ÂÃÄ#ˆÂÅÆ#ˆÂÇÈ#ˆÂÉÊ#ˆÂËÌ#ˆÂÍÎ#ˆÂÏÐ#ˆÂÑÒ#ˆÂÓÔ#ˆÂÕÖ#ˆÂ×Ø#ˆÂÙÚ#ˆÛÜ\"‡" [tc-mode-map make-sparse-keymap define-key "1" tc-merge "2" tc-two-columns "b" tc-associate-buffer "d" tc-dissociate "\f" tc-recenter "o" tc-associated-buffer "s" tc-split "{" shrink-window-horizontally "}" enlarge-window-horizontally " " tc-scroll-up "" tc-scroll-down " " tc-scroll-line global-set-key "6"] 4) (defvar tc-other nil "\ Marker to the associated buffer, if non-nil.") (byte-code "ÀÁ!ˆÂÁÃÄ#ˆÅBÀ‡" [make-variable-buffer-local tc-other put permanent-local t (tc-other " 2C") minor-mode-alist] 4) (defvar tc-mode-line-format (quote ("-%*- %15b --" (-3 . "%p") "--%[(" mode-name minor-mode-alist mode-line-process "%n" ")%]%-")) "\ *Value of mode-line-format for a buffer in two-column minor mode.") (defvar tc-separator "" "\ *A string inserted between the two columns when merging. This gets set locally by \\[tc-split].") (put (quote tc-separator) (quote permanent-local) t) (defvar tc-window-width 40 "\ *The width of the first column. (Must be at least `window-min-width') This value is local for every buffer that sets it.") (byte-code "ÀÁ!ˆÂÁÃÄ#‡" [make-variable-buffer-local tc-window-width put permanent-local t] 4) (defvar tc-beyond-fill-column 4 "\ *Base for calculating `fill-column' for a buffer in two-column minor mode. The value of `fill-column' becomes `tc-window-width' for this buffer minus this value.") (defvar tc-mode-hook nil "\ Function called, if non-nil, whenever turning on two-column minor mode. It can get called by \\[tc-two-columns] (tc-two-columns), \\[tc-split] (tc-split) and \\[tc-associate-buffer] (tc-associate-buffer), on both buffers.") (defalias (quote tc-other) #[nil "…Á!\n†ÄÀ!ˆÄÃ!ˆÅ‡" [tc-other marker-buffer tc-mode-line-format mode-line-format kill-local-variable nil] 2]) (defalias 'tc-two-columns #[(&optional buffer) "À Á Wƒ ÂÃÄ\"ˆÅÁ Z^]!ˆÈ ƒ1ÉÊ!ˆËÈ !ˆÉÌ!ˆÍÎ!‡ZÓ!ˆÕ ÉÊ!ˆË†UØÙÚ P!!ˆ„_Û ˆZÕ Ó!ˆÉÌ!ˆ‰)‡" [window-width frame-width enlarge-window 99999 t split-window-horizontally window-min-width tc-window-width tc-other other-window 1 switch-to-buffer -1 tc-scroll-line 0 tc-beyond-fill-column fill-column tc-mode-line-format mode-line-format run-hooks tc-mode-hook point-marker other buffer generate-new-buffer "2C/" buffer-name text-mode] 5 "\ Split current window vertically for two-column editing. When called the first time, associates a buffer with the current buffer. Both buffers are put in two-column minor mode and tc-mode-hook gets called on both. These buffers remember about one another, even when renamed. When called again, restores the screen layout with the current buffer first and the associated buffer to it's right. 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. You have the following commands at your disposal: \\[tc-two-columns] Rearrange screen \\[tc-associate-buffer] Reassociate buffer after changing major mode \\[tc-scroll-up] Scroll both buffers up by a screenfull \\[tc-scroll-down] Scroll both buffers down by a screenful \\[tc-scroll-line] Scroll both buffers up by one or more lines \\[tc-recenter] Recenter and realign other buffer \\[shrink-window-horizontally], \\[enlarge-window-horizontally] Shrink, enlarge current column \\[tc-associated-buffer] Switch to associated buffer \\[tc-merge] Merge both buffers These keybindings can be customized in your ~/.emacs by `tc-prefix' and `tc-mode-map'. The appearance of the screen can be customized by the variables `tc-window-width', `tc-beyond-fill-column', `tc-mode-line-format' and `truncate-partial-width-windows'." "P"]) (defalias (quote tc-mode) (quote tc-two-columns)) (defalias 'tc-associate-buffer #[nil "pÀ † ÁÂà \"ŠÆ\fqˆÀ ƒ' À =„'ÇÈÉÀ !\"ˆÊË ž…0\n) ƒ<Ì Z\nÍ\f!*‡" [tc-other read-buffer "Associate buffer: " other-buffer b2 b1 nil error "Buffer already associated with buffer `%s'." buffer-name tc-window-width buffer-local-variables frame-width tc-two-columns] 4 "\ 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 \\[tc-two-columns] and `lisp/two-column.el' for further details." nil]) (defalias 'tc-split #[(arg) "À ƒ\"ÁÂÃÀ !ÄQ!ƒŠÀ qˆÅ ˆ)‚\"ÆÇÈ\"ˆ`iÉe`\"Sȉ\n \f ŠÏ!ˆ`{ ÑwˆÒÓ!ˆ`{i)Õ ˆÀ \nŠm?…½i Uƒx `ŠÏ!ˆ`){˜„€\fT\f‚¶`Ï!ˆÑÈxˆ`|ˆ`Ö×\f\"ˆØ\nȈmƒª`‚¬`T#ˆ`|ˆÙ\fÚÛ!ˆ‚\\.‡" [tc-other y-or-n-p "Overwrite associated buffer `" buffer-name "'? " erase-buffer signal quit nil count-lines other chars n goal-column point backward-char arg " " make-local-variable tc-separator tc-window-width tc-two-columns insert-char 10 append-to-buffer 0 next-line 1] 5 "\ Unmerge a two-column text into two buffers in two-column minor mode. The text is unmerged at the cursor's column which becomes the local value of `tc-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 `tc-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 as you like them. You write the first line of each column with the separator you like and then unmerge that line. E.g.: First column's text sSs Second columns text \\___/\\ / \\ 5 character Separator You type M-5 \\[tc-split] with the point here See \\[tc-two-columns] and `lisp/two-column.el' for further details." "p"]) (defalias 'tc-dissociate #[nil "pŠÁ ƒBÁ qƒBÁ ƒÁ =ƒB „.mƒ.oƒ.ÃÄ!ˆ‚BÅÁ!ˆÅÆ!ˆÅÇ!ˆÅÈ!ˆÅÉ!ˆ)ÅÁ!ˆÅÆ!ˆÅÇ!ˆÅÈ!ˆÅÉ!)‡" [buffer tc-other buffer-modified-p kill-buffer nil kill-local-variable tc-window-width tc-separator mode-line-format fill-column] 2 "\ Turn off two-column minor mode in current and associated buffer. If the associated buffer is unmodified and empty, it is killed." nil]) (defalias 'tc-merge #[nil "À „ ÁÂ!ˆÃ @ÄVƒÅÆ !À =ƒÇÈ!ˆŠpÀ É\n \febˆ qˆebˆm„k`Ɉ`{\nm„GÉuˆ\fqˆ\n͘„`Ɉjˆ\n±ˆÐÑ!ˆ qˆ‚4,Ò Ó W…xÔÕÖ\"‡" [tc-other error "You must first set two-column minor mode." window-edges 0 window-buffer previous-window other-window -1 nil string b2 b1 "" tc-window-width tc-separator next-line 1 window-width frame-width enlarge-window 99999 t] 3 "\ Merges the associated buffer with the current buffer. They get merged at the column, which is the value of `tc-window-width', i.e. usually at the vertical window separator. This separator gets replaced with white space. Beyond that the value of 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 `tc-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" nil]) (defalias 'tc-associated-buffer #[nil "À „ ÁÂ!ˆÃÀ !ƒÄÃÀ !!‡ÅÀ !‡" [tc-other error "You must set two-column minor mode." get-buffer-window select-window switch-to-buffer] 3 "\ Switch to associated buffer." nil]) (defalias 'tc-scroll-line #[(arg) "À „ ÁÂ!ˆÃ\f!„Å\f!ˆÆeÇ \"ÈÀ !…TÉ \nËÈÀ !!ˆ\fÆeÇ \"ZŠdbˆÌÍ\fÆÇ d\"ZÎZ\"ˆ)Ã\f!„OÅ\f!ˆË\n!)‡" [tc-other error "You must set two-column minor mode." zerop arg scroll-up count-lines window-start get-buffer-window selected-window window select-window insert-char 10 -1] 6 "\ Scroll current window upward by ARG lines. The associated window gets scrolled to the same line." "p"]) (defalias 'tc-scroll-up #[(arg) "À  ZÄZ_!‡" [tc-scroll-line arg window-height next-screen-context-lines 1] 4 "\ Scroll current window upward by ARG screens. The associated window gets scrolled to the same line." "p"]) (defalias 'tc-scroll-down #[(arg) "À \nà ZÄZ_!‡" [tc-scroll-line arg next-screen-context-lines window-height -1] 4 "\ Scroll current window downward by ARG screens. The associated window gets scrolled to the same line." "p"]) (defalias 'tc-recenter #[(arg) "…Á!ÂÃÄ `\"„Šƥ‚'ÇWƒ&Å \\‚'Z!‡" [arg prefix-numeric-value tc-scroll-line count-lines window-start window-height 2 0] 4 "\ Center point in window. With ARG, put point on line ARG. This counts from bottom if ARG is negative. The associated window gets scrolled to the same line." "P"]) (defalias 'enlarge-window-horizontally #[(arg) "À Â\"ˆÃ …\f \\‰…à q…\f Z‰‡" [enlarge-window arg t tc-other tc-window-width] 3 "\ Make current window ARG columns wider." "p"]) (defalias 'shrink-window-horizontally #[(arg) "À [!‡" [enlarge-window-horizontally arg] 2 "\ Make current window ARG columns narrower." "p"]) (provide (quote two-column))