Mercurial > emacs
comparison lisp/textmodes/two-column.el @ 13388:af2bb7490ca9
(minor-mode-map-alist): Use substitute-key-definition
to find the appropriate bindings for window enlarge/shrink.
(2C-shrink-window-horizontally, 2C-enlarge-window-horizontally):
Renamed from shrink-window-horizontally, enlarge-window-horizontally
to avoid redefining the standard functions.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Fri, 03 Nov 1995 03:11:24 +0000 |
parents | 7fd541abf2af |
children | 65d4b4b2e954 |
comparison
equal
deleted
inserted
replaced
13387:14442ed0da63 | 13388:af2bb7490ca9 |
---|---|
148 (let ((map (make-sparse-keymap))) | 148 (let ((map (make-sparse-keymap))) |
149 (define-key map "2" '2C-two-columns) | 149 (define-key map "2" '2C-two-columns) |
150 (define-key map [f2] '2C-two-columns) | 150 (define-key map [f2] '2C-two-columns) |
151 (define-key map "b" '2C-associate-buffer) | 151 (define-key map "b" '2C-associate-buffer) |
152 (define-key map "s" '2C-split) | 152 (define-key map "s" '2C-split) |
153 (define-key map "{" 'shrink-window-horizontally) | |
154 (define-key map "}" 'enlarge-window-horizontally) | |
155 map) | 153 map) |
156 "Keymap for commands for setting up two-column mode.") | 154 "Keymap for commands for setting up two-column mode.") |
157 | 155 |
158 | 156 |
159 | 157 |
176 (define-key map "1" '2C-merge) | 174 (define-key map "1" '2C-merge) |
177 (define-key map "d" '2C-dissociate) | 175 (define-key map "d" '2C-dissociate) |
178 (define-key map "o" '2C-associated-buffer) | 176 (define-key map "o" '2C-associated-buffer) |
179 (define-key map "\^m" '2C-newline) | 177 (define-key map "\^m" '2C-newline) |
180 (define-key map "|" '2C-toggle-autoscroll) | 178 (define-key map "|" '2C-toggle-autoscroll) |
179 (define-key map "{" '2C-shrink-window-horizontally) | |
180 (define-key map "}" '2C-enlarge-window-horizontally) | |
181 map) | 181 map) |
182 "Keymap for commands for use in two-column mode.") | 182 "Keymap for commands for use in two-column mode.") |
183 | 183 |
184 | 184 |
185 (setq minor-mode-map-alist | 185 (setq minor-mode-map-alist |
186 (cons (cons '2C-mode | 186 (cons (cons '2C-mode |
187 (let ((map (make-sparse-keymap))) | 187 (let ((map (make-sparse-keymap))) |
188 (substitute-key-definition '2C-command 2C-minor-mode-map | 188 (substitute-key-definition '2C-command 2C-minor-mode-map |
189 map (current-global-map)) | |
190 (substitute-key-definition 'enlarge-window-horizontally | |
191 '2C-enlarge-window-horizontally | |
192 map (current-global-map)) | |
193 (substitute-key-definition 'shrink-window-horizontally | |
194 '2C-shrink-window-horizontally | |
189 map (current-global-map)) | 195 map (current-global-map)) |
190 map)) | 196 map)) |
191 minor-mode-map-alist)) | 197 minor-mode-map-alist)) |
192 | 198 |
193 ;;;;; variable declarations ;;;;; | 199 ;;;;; variable declarations ;;;;; |
595 (setq 2C-autoscroll-start (window-start)))) | 601 (setq 2C-autoscroll-start (window-start)))) |
596 (error)))))) | 602 (error)))))) |
597 | 603 |
598 | 604 |
599 | 605 |
600 (defun enlarge-window-horizontally (arg) | 606 (defun 2C-enlarge-window-horizontally (arg) |
601 "Make current window ARG columns wider." | 607 "Make current window ARG columns wider." |
602 (interactive "p") | 608 (interactive "p") |
603 (enlarge-window arg t) | 609 (enlarge-window arg t) |
604 (and (2C-other) | 610 (and (2C-other) |
605 (setq 2C-window-width (+ 2C-window-width arg)) | 611 (setq 2C-window-width (+ 2C-window-width arg)) |
606 (set-buffer (2C-other)) | 612 (set-buffer (2C-other)) |
607 (setq 2C-window-width (- 2C-window-width arg)))) | 613 (setq 2C-window-width (- 2C-window-width arg)))) |
608 | 614 |
609 (defun shrink-window-horizontally (arg) | 615 (defun 2C-shrink-window-horizontally (arg) |
610 "Make current window ARG columns narrower." | 616 "Make current window ARG columns narrower." |
611 (interactive "p") | 617 (interactive "p") |
612 (enlarge-window-horizontally (- arg))) | 618 (2C-enlarge-window-horizontally (- arg))) |
613 | 619 |
614 | 620 |
615 | 621 |
616 (provide 'two-column) | 622 (provide 'two-column) |
617 | 623 |