Mercurial > emacs
comparison lisp/textmodes/two-column.el @ 17430:de68258fef5f
Add defgroup; use defcustom for user vars.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 13 Apr 1997 03:09:23 +0000 |
parents | 65d4b4b2e954 |
children | 727cf56647a4 |
comparison
equal
deleted
inserted
replaced
17429:5eb28dcbdb71 | 17430:de68258fef5f |
---|---|
196 map)) | 196 map)) |
197 minor-mode-map-alist)) | 197 minor-mode-map-alist)) |
198 | 198 |
199 ;;;;; variable declarations ;;;;; | 199 ;;;;; variable declarations ;;;;; |
200 | 200 |
201 (defgroup two-column nil | |
202 "Minor mode for editing of two-column text" | |
203 :prefix "2C-" | |
204 :group 'frames) | |
205 | |
206 | |
201 ;; Markers seem to be the only buffer-id not affected by renaming a buffer. | 207 ;; Markers seem to be the only buffer-id not affected by renaming a buffer. |
202 ;; This nevertheless loses when a buffer is killed. The variable-name is | 208 ;; This nevertheless loses when a buffer is killed. The variable-name is |
203 ;; required by `describe-mode'. | 209 ;; required by `describe-mode'. |
204 (defvar 2C-mode nil | 210 (defvar 2C-mode nil |
205 "Marker to the associated buffer, if non-nil.") | 211 "Marker to the associated buffer, if non-nil.") |
211 (setq minor-mode-alist (cons '(2C-mode " 2C") minor-mode-alist)) | 217 (setq minor-mode-alist (cons '(2C-mode " 2C") minor-mode-alist)) |
212 | 218 |
213 | 219 |
214 | 220 |
215 ;; rearranged, so that the pertinent info will show in 40 columns | 221 ;; rearranged, so that the pertinent info will show in 40 columns |
216 (defvar 2C-mode-line-format | 222 (defcustom 2C-mode-line-format |
217 '("-%*- %15b --" (-3 . "%p") "--%[(" mode-name | 223 '("-%*- %15b --" (-3 . "%p") "--%[(" mode-name |
218 minor-mode-alist "%n" mode-line-process ")%]%-") | 224 minor-mode-alist "%n" mode-line-process ")%]%-") |
219 "*Value of mode-line-format for a buffer in two-column minor mode.") | 225 "*Value of mode-line-format for a buffer in two-column minor mode." |
220 | 226 :type 'sexp |
221 | 227 :group 'two-column) |
222 (defvar 2C-other-buffer-hook 'text-mode | 228 |
223 "*Hook run in new buffer when it is associated with current one.") | 229 |
224 | 230 (defcustom 2C-other-buffer-hook 'text-mode |
225 | 231 "*Hook run in new buffer when it is associated with current one." |
226 (defvar 2C-separator "" | 232 :type 'function |
233 :group 'two-column) | |
234 | |
235 | |
236 (defcustom 2C-separator "" | |
227 "*A string inserted between the two columns when merging. | 237 "*A string inserted between the two columns when merging. |
228 This gets set locally by \\[2C-split].") | 238 This gets set locally by \\[2C-split]." |
239 :type 'string | |
240 :group 'two-column) | |
229 (put '2C-separator 'permanent-local t) | 241 (put '2C-separator 'permanent-local t) |
230 | 242 |
231 | 243 |
232 | 244 |
233 (defvar 2C-window-width 40 | 245 (defcustom 2C-window-width 40 |
234 "*The width of the first column. (Must be at least `window-min-width') | 246 "*The width of the first column. (Must be at least `window-min-width') |
235 This value is local for every buffer that sets it.") | 247 This value is local for every buffer that sets it." |
248 :type 'integer | |
249 :group 'two-column) | |
236 (make-variable-buffer-local '2C-window-width) | 250 (make-variable-buffer-local '2C-window-width) |
237 (put '2C-window-width 'permanent-local t) | 251 (put '2C-window-width 'permanent-local t) |
238 | 252 |
239 | 253 |
240 | 254 |
241 (defvar 2C-beyond-fill-column 4 | 255 (defcustom 2C-beyond-fill-column 4 |
242 "*Base for calculating `fill-column' for a buffer in two-column minor mode. | 256 "*Base for calculating `fill-column' for a buffer in two-column minor mode. |
243 The value of `fill-column' becomes `2C-window-width' for this buffer | 257 The value of `fill-column' becomes `2C-window-width' for this buffer |
244 minus this value.") | 258 minus this value." |
245 | 259 :type 'integer |
246 | 260 :group 'two-column) |
247 | 261 |
248 (defvar 2C-autoscroll t | 262 |
249 "If non-nil, Emacs attempts to keep the two column's buffers aligned.") | 263 |
264 (defcustom 2C-autoscroll t | |
265 "If non-nil, Emacs attempts to keep the two column's buffers aligned." | |
266 :type 'boolean | |
267 :group 'two-column) | |
250 | 268 |
251 | 269 |
252 | 270 |
253 (defvar 2C-autoscroll-start nil) | 271 (defvar 2C-autoscroll-start nil) |
254 (make-variable-buffer-local '2C-autoscroll-start) | 272 (make-variable-buffer-local '2C-autoscroll-start) |