;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Mon Apr 17 19:54:18 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/two-column.el ;;; emacs version 19.28.90.26. ;;; 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")) #@42 Keymap for commands for two-column mode. (defvar tc-mode-map nil (#$ . 489)) (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) #@46 Marker to the associated buffer, if non-nil. (defvar tc-other nil (#$ . 985)) (byte-code "ÀÁ!ˆÂÁÃÄ#ˆÅBÀ‡" [make-variable-buffer-local tc-other put permanent-local t (tc-other " 2C") minor-mode-alist] 4) #@67 *Value of mode-line-format for a buffer in two-column minor mode. (defvar tc-mode-line-format (quote ("-%*- %15b --" (-3 . "%p") "--%[(" mode-name minor-mode-alist mode-line-process "%n" ")%]%-")) (#$ . -1198)) #@96 *A string inserted between the two columns when merging. This gets set locally by \[tc-split]. (defvar tc-separator "" (#$ . -1415)) (put (quote tc-separator) (quote 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. (defvar tc-window-width 40 (#$ . -1608)) (byte-code "ÀÁ!ˆÂÁÃÄ#‡" [make-variable-buffer-local tc-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 `tc-window-width' for this buffer minus this value. (defvar tc-beyond-fill-column 4 (#$ . -1872)) #@220 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. (defvar tc-mode-hook nil (#$ . 2087)) (defalias 'tc-other #[nil "…Á!\n†ÄÀ!ˆÄÃ!ˆÅ‡" [tc-other marker-buffer tc-mode-line-format mode-line-format kill-local-variable nil] 2]) #@1415 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'. (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 (#$ . 2494) "P"]) (defalias (quote tc-mode) (quote tc-two-columns)) #@243 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. (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 (#$ . 4504) nil]) #@854 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. (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 (#$ . 5081) "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 '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 (#$ . 6474) nil]) #@676 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 (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 (#$ . 6882) nil]) #@30 Switch to associated buffer. (defalias 'tc-associated-buffer #[nil "À „ ÁÂ!ˆÃÀ !ƒÄÃÀ !!‡ÅÀ !‡" [tc-other error "You must set two-column minor mode." get-buffer-window select-window switch-to-buffer] 3 (#$ . 7971) nil]) #@98 Scroll current window upward by ARG lines. The associated window gets scrolled to the same line. (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 (#$ . 8199) "p"]) #@100 Scroll current window upward by ARG screens. The associated window gets scrolled to the same line. (defalias 'tc-scroll-up #[(arg) "À  ZÄZ_!‡" [tc-scroll-line arg window-height next-screen-context-lines 1] 4 (#$ . 8630) "p"]) #@102 Scroll current window downward by ARG screens. The associated window gets scrolled to the same line. (defalias 'tc-scroll-down #[(arg) "À \nà ZÄZ_!‡" [tc-scroll-line arg next-screen-context-lines window-height -1] 4 (#$ . 8865) "p"]) #@158 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. (defalias 'tc-recenter #[(arg) "…Á!ÂÃÄ `\"„Šƥ‚'ÇWƒ&Å \\‚'Z!‡" [arg prefix-numeric-value tc-scroll-line count-lines window-start window-height 2 0] 4 (#$ . 9106) "P"]) #@40 Make current window ARG columns wider. (defalias 'enlarge-window-horizontally #[(arg) "À Â\"ˆÃ …\f \\‰…à q…\f Z‰‡" [enlarge-window arg t tc-other tc-window-width] 3 (#$ . 9452) "p"]) #@43 Make current window ARG columns narrower. (defalias 'shrink-window-horizontally #[(arg) "À [!‡" [enlarge-window-horizontally arg] 2 (#$ . 9649) "p"]) (provide (quote two-column))