comparison lisp/follow.el @ 78774:a4cabf2eaad3

Fix typos in file header commentary.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 13 Sep 2007 08:08:58 +0000
parents 578320c8f7ec
children d771a0b43ed5
comparison
equal deleted inserted replaced
78773:f8b4f5fe7b48 78774:a4cabf2eaad3
33 ;; combines windows into one tall virtual window. 33 ;; combines windows into one tall virtual window.
34 ;; 34 ;;
35 ;; The feeling of a "virtual window" has been accomplished by the use 35 ;; The feeling of a "virtual window" has been accomplished by the use
36 ;; of two major techniques: 36 ;; of two major techniques:
37 ;; 37 ;;
38 ;; * The windows always displays adjacent sections of the buffer. 38 ;; * The windows always display adjacent sections of the buffer.
39 ;; This means that whenever one window is moved, all the 39 ;; This means that whenever one window is moved, all the
40 ;; others will follow. (Hence the name Follow Mode.) 40 ;; others will follow. (Hence the name Follow Mode.)
41 ;; 41 ;;
42 ;; * Should the point (cursor) end up outside a window, another 42 ;; * Should the point (cursor) end up outside a window, another
43 ;; window displaying that point is selected, if possible. This 43 ;; window displaying that point is selected, if possible. This
44 ;; makes it possible to walk between windows using normal cursor 44 ;; makes it possible to walk between windows using normal cursor
45 ;; movement commands. 45 ;; movement commands.
46 ;; 46 ;;
47 ;; Follow mode comes to its prime when a large screen and two 47 ;; Follow mode comes to its prime when a large screen and two
48 ;; side-by-side window are used. The user can, with the help of Follow 48 ;; side-by-side window are used. The user can, with the help of Follow
49 ;; mode, use two full-height windows as though they would have been 49 ;; mode, use two full-height windows as though they are one.
50 ;; one. Imagine yourself editing a large function, or section of text, 50 ;; Imagine yourself editing a large function, or section of text,
51 ;; and being able to use 144 lines instead of the normal 72... (your 51 ;; and being able to use 144 lines instead of the normal 72... (your
52 ;; mileage may vary). 52 ;; mileage may vary).
53 53
54 ;; To test this package, make sure `follow' is loaded, or will be 54 ;; To test this package, make sure `follow' is loaded, or will be
55 ;; autoloaded when activated (see below). Then do the following: 55 ;; autoloaded when activated (see below). Then do the following:
75 ;; |72 |144 | 75 ;; |72 |144 |
76 ;; +----------+----------+ 76 ;; +----------+----------+
77 ;; 77 ;;
78 ;; As you can see, the right-hand window starts at line 73, the line 78 ;; As you can see, the right-hand window starts at line 73, the line
79 ;; immediately below the end of the left-hand window. As long as 79 ;; immediately below the end of the left-hand window. As long as
80 ;; `follow-mode' is active, the two windows will follow eachother! 80 ;; `follow-mode' is active, the two windows will follow each other!
81 ;; 81 ;;
82 ;; * Play around and enjoy! Scroll one window and watch the other. 82 ;; * Play around and enjoy! Scroll one window and watch the other.
83 ;; Jump to the beginning or end. Press `Cursor down' at the last 83 ;; Jump to the beginning or end. Press `Cursor down' at the last
84 ;; line of the left-hand window. Enter new lines into the 84 ;; line of the left-hand window. Enter new lines into the
85 ;; text. Enter long lines spanning several lines, or several 85 ;; text. Enter long lines spanning several lines, or several
99 ;; 99 ;;
100 ;; (global-set-key [f8] 'follow-mode) 100 ;; (global-set-key [f8] 'follow-mode)
101 ;; (global-set-key [f7] 'follow-delete-other-windows-and-split) 101 ;; (global-set-key [f7] 'follow-delete-other-windows-and-split)
102 102
103 103
104 ;; There exists two system variables that controls the appearence of 104 ;; There exist two system variables that control the appearence of
105 ;; lines that are wider than the window containing them. The default 105 ;; lines wider than the window containing them. The default is to
106 ;; is to truncate long lines whenever a window isn't as wide as the 106 ;; truncate long lines whenever a window isn't as wide as the frame.
107 ;; frame.
108 ;; 107 ;;
109 ;; To make sure lines are never truncated, please place the following 108 ;; To make sure lines are never truncated, please place the following
110 ;; lines in your init file: 109 ;; lines in your init file:
111 ;; 110 ;;
112 ;; (setq truncate-lines nil) 111 ;; (setq truncate-lines nil)
121 ;; 120 ;;
122 ;; (setq pixel-vertical-clip-threshold 30) 121 ;; (setq pixel-vertical-clip-threshold 30)
123 122
124 123
125 ;; The correct way to cofigurate Follow mode, or any other mode for 124 ;; The correct way to cofigurate Follow mode, or any other mode for
126 ;; that matter, is to create one (or more) function that does 125 ;; that matter, is to create one or more functions that do
127 ;; whatever you would like to do. The function is then added to 126 ;; whatever you would like to do. These functions are then added to
128 ;; a hook. 127 ;; a hook.
129 ;; 128 ;;
130 ;; When `Follow' mode is activated, functions stored in the hook 129 ;; When `Follow' mode is activated, functions stored in the hook
131 ;; `follow-mode-hook' are called. When it is deactivated 130 ;; `follow-mode-hook' are called. When it is deactivated
132 ;; `follow-mode-off-hook' is run. 131 ;; `follow-mode-off-hook' is run.
142 ;; (define-key follow-mode-map "\C-cb" 'another-function)) 141 ;; (define-key follow-mode-map "\C-cb" 'another-function))
143 142
144 143
145 ;; Usage: 144 ;; Usage:
146 ;; 145 ;;
147 ;; To activate issue the command "M-x follow-mode" 146 ;; To activate, issue the command "M-x follow-mode"
148 ;; and press return. To deactivate, do it again. 147 ;; and press Return. To deactivate, do it again.
149 ;; 148 ;;
150 ;; The following is a list of commands useful when follow-mode is active. 149 ;; The following is a list of commands useful when follow-mode is active.
151 ;; 150 ;;
152 ;; follow-scroll-up C-c . C-v 151 ;; follow-scroll-up C-c . C-v
153 ;; Scroll text in a Follow Mode window chain up. 152 ;; Scroll text in a Follow Mode window chain up.
154 ;; 153 ;;
155 ;; follow-scroll-down C-c . v 154 ;; follow-scroll-down C-c . v
156 ;; Like `follow-scroll-up', but in the other direction. 155 ;; Like `follow-scroll-up', but in the other direction.
157 ;; 156 ;;
158 ;; follow-delete-other-windows-and-split C-c . 1 157 ;; follow-delete-other-windows-and-split C-c . 1
159 ;; Maximise the visible area of the current buffer, 158 ;; Maximize the visible area of the current buffer,
160 ;; and enter Follow Mode. This is a very convenient 159 ;; and enter Follow Mode. This is a very convenient
161 ;; way to start Follow Mode, hence it is recomended 160 ;; way to start Follow Mode, hence we recomend that
162 ;; that this command is added to the global keymap. 161 ;; this command be added to the global keymap.
163 ;; 162 ;;
164 ;; follow-recenter C-c . C-l 163 ;; follow-recenter C-c . C-l
165 ;; Place the point in the center of the middle window, 164 ;; Place the point in the center of the middle window,
166 ;; or a specified number of lines from either top or bottom. 165 ;; or a specified number of lines from either top or bottom.
167 ;; 166 ;;
168 ;; follow-switch-to-buffer C-c . b 167 ;; follow-switch-to-buffer C-c . b
169 ;; Switch buffer in all windows displaying the current buffer 168 ;; Switch buffer in all windows displaying the current buffer
170 ;; in this frame. 169 ;; in this frame.
171 ;; 170 ;;
172 ;; follow-switch-to-buffer-all C-c . C-b 171 ;; follow-switch-to-buffer-all C-c . C-b
173 ;; Switch buffer in all windows in the active frame. 172 ;; Switch buffer in all windows in the selected frame.
174 ;; 173 ;;
175 ;; follow-switch-to-current-buffer-all 174 ;; follow-switch-to-current-buffer-all
176 ;; Show the current buffer in all windows on the current 175 ;; Show the current buffer in all windows on the current
177 ;; frame and turn on `follow-mode'. 176 ;; frame and turn on `follow-mode'.
178 ;; 177 ;;
205 204
206 ;; Implementation: 205 ;; Implementation:
207 ;; 206 ;;
208 ;; In an ideal world, follow mode would have been implemented in the 207 ;; In an ideal world, follow mode would have been implemented in the
209 ;; kernel of the display routines, making sure that the windows (using 208 ;; kernel of the display routines, making sure that the windows (using
210 ;; follow mode) ALWAYS are aligned. On planet earth, however, we must 209 ;; follow mode) ALWAYS are aligned. On planet Earth, however, we must
211 ;; accept a solution where we ALMOST ALWAYS can make sure that the 210 ;; accept a solution where we ALMOST ALWAYS can make sure that the
212 ;; windows are aligned. 211 ;; windows are aligned.
213 ;; 212 ;;
214 ;; Follow mode does this in three places: 213 ;; Follow mode does this in three places:
215 ;; 1) After each user command. 214 ;; 1) After each user command.