|
|
1.1 root 1: ;; GNU Emacs window commands aside from those written in C.
2: ;; Copyright (C) 1985 Free Software Foundation, Inc.
3:
4: ;; This file is part of GNU Emacs.
5:
6: ;; GNU Emacs is distributed in the hope that it will be useful,
7: ;; but WITHOUT ANY WARRANTY. No author or distributor
8: ;; accepts responsibility to anyone for the consequences of using it
9: ;; or for whether it serves any particular purpose or works at all,
10: ;; unless he says so in writing. Refer to the GNU Emacs General Public
11: ;; License for full details.
12:
13: ;; Everyone is granted permission to copy, modify and redistribute
14: ;; GNU Emacs, but only under the conditions described in the
15: ;; GNU Emacs General Public License. A copy of this license is
16: ;; supposed to have been given to you along with GNU Emacs so you
17: ;; can know your rights and responsibilities. It should be in a
18: ;; file named COPYING. Among other things, the copyright notice
19: ;; and this notice must be preserved on all copies.
20:
21:
22: (defun split-window-vertically (&optional arg)
23: "Split current window into two windows, one above the other.
24: This window becomes the uppermost of the two, and gets
25: ARG lines. No arg means split equally."
26: (interactive "P")
27: (split-window nil (and arg (prefix-numeric-value arg))))
28:
29: (defun split-window-horizontally (&optional arg)
30: "Split current window into two windows side by side.
31: This window becomes the leftmost of the two, and gets
32: ARG columns. No arg means split equally."
33: (interactive "P")
34: (split-window nil (and arg (prefix-numeric-value arg)) t))
35:
36: (defun enlarge-window-horizontally (arg)
37: "Make current window ARG columns wider."
38: (interactive "p")
39: (enlarge-window arg t))
40:
41: (defun shrink-window-horizontally (arg)
42: "Make current window ARG columns narrower."
43: (interactive "p")
44: (shrink-window arg t))
45:
46: (define-key ctl-x-map "2" 'split-window-vertically)
47: (define-key ctl-x-map "5" 'split-window-horizontally)
48: (define-key ctl-x-map "}" 'enlarge-window-horizontally)
49: (define-key ctl-x-map "{" 'shrink-window-horizontally)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.