7
7
[ ![ Tag Version] ( https://img.shields.io/github/tag/dpsutton/resize-window.svg )] ( https://github.com/dpsutton/resize-window/tags )
8
8
9
9
## What it is ##
10
+
10
11
Resizing windows is a pain in emacs. You have to do an uncomfortable
11
12
chord ` C-x { ` , ` C-x ^ ` . Giving prefixes to make the jump larger than 1
12
13
line means remembering ` C-u <number> <terrible chord> ` . I always
@@ -15,9 +16,10 @@ minor mode to easily adjust window sizes with familiar keys and
15
16
without chords.
16
17
17
18
## How to use it ##
19
+
18
20
As soon as it gets polished a little further, it will hopefully be
19
21
accepted to ELPA or something (I'm not too sure about all of the
20
- differences, ELPA, MELPA, marmalade, etc.
22
+ differences, ELPA, MELPA, marmalade, etc.)
21
23
22
24
I've submitted for elpa and have a pending request to have copyright
23
25
assigned. Until then, just drop it into your load path. I've found the
@@ -56,16 +58,20 @@ motions and cycle windows until everything is adjusted to how you like
56
58
it.
57
59
58
60
## How to extend it ##
61
+
59
62
There are a few things that you can do. There are customizable variables:
60
63
- resize-window-coarse-argument (default: 5)
61
64
- resize-window-fine-argument (default: 1)
62
- - resizewindow-allow-backgrounds (default: t)
65
+ - resize-window-allow-backgrounds (default: t)
66
+ - resize-window-swap-capital-and-lowercase-behavior (default: nil)
67
+ - resize-window-notify-with-messages (default: t)
63
68
64
69
Any of these can be customized by using `customize-group RET
65
70
resize-window` or by setting the appropriate variable in your init.el
66
71
file as normal: ` (setq <var> <val>) ` .
67
72
68
73
## What's even cooler ##
74
+
69
75
At the end of the day, this is really just a function dispatcher
70
76
listening for key presses. So i've found a really nice workflow. I've
71
77
bound resize-window to ` C-c ; ` and i've also added a new dispatch:
@@ -78,7 +84,9 @@ run helm-mini. Its trivial now to bounce around, resize windows and
78
84
reset their sources. And since the help menu is dynamically generated,
79
85
pressing ? displays this new choice automatically.
80
86
81
- For convenience sake, you can use the helper method ` resize-window-add-choice ` to register your function without having to remember the structure of the list it will end up in. For example:
87
+ For convenience sake, you can use the helper method ` resize-window-add-choice `
88
+ to register your function without having to remember the structure of the list
89
+ it will end up in. For example:
82
90
83
91
(push '(?h (lambda () (dired "~/projects/clojure")) "Clojure home" nil))
84
92
; is equivalent to
@@ -87,10 +95,9 @@ For convenience sake, you can use the helper method `resize-window-add-choice` t
87
95
88
96
; the allows-capitals argument is optional.
89
97
90
- Further, there are alias , held in the ` resize-window-alias-list ` alist. It is
98
+ Further, there are aliases , held in the ` resize-window-alias-list ` alist. It is
91
99
currently defined as
92
100
93
-
94
101
(defvar resize-windown-alias-list
95
102
'((right ?f)
96
103
(up ?n)
@@ -125,26 +132,29 @@ resize these buffers.
125
132
![ usage gif] ( images/navigate.gif )
126
133
127
134
## Bugs ##
135
+
128
136
- When in resize mode, there's a visual overlay over the current
129
137
buffer to give some visual indication what's going on. However, if
130
138
you have two copies of the same buffer open, both are
131
139
overlayed. Would like to reduce this so that only the buffer you're
132
140
working in is overlaid, regardless of how many copies are open
133
141
134
142
## Hopeful upcoming features ##
143
+
135
144
I can't promise any of these but these are the things I'm hoping to
136
145
do:
137
146
138
147
- put overlays over * other* buffers rather than current one. This
139
148
greys out other workspaces and leaves yours with full color,
140
149
bringing your eye there. Just seems like a nice ergonomic touch.
141
- - DONE: allow customization to invert capital/non-capital behavior. Right
150
+ - DONE: allow customization to invert capital/non-capital behavior. Right
142
151
now, lower case selections move the window size by 1 and upper-case
143
152
moves by 5. These should both be easy to customize and easy to
144
153
* flip* . Ie, make the lowercase ` n ` make it bigger by 5 and the
145
154
upper-case ` N ` increase by 1.
146
155
147
156
## Shout out ##
157
+
148
158
This is my first attempt at really doing anything in elisp and to get
149
159
there, I drew lots of inspiration and organizational ideas and almost
150
160
verbatim code from ` ace-mode ` . Ace mode is super super nice and my aim
@@ -153,17 +163,18 @@ than jumping. In fact, this might actually be better as a pull request
153
163
to their package.
154
164
155
165
## How it works ##
166
+
156
167
Super simple architecture. There's an associative list called
157
- ` resize-window-dispatch-alist ` (the rm is prefix for resize-mode) that holds a
158
- simple data structure with the invocation-key, the function to call,
159
- documentation string to be shown as a message, and whether it should
160
- accept a capital letter as well as the lower-case letter.
168
+ ` resize-window-dispatch-alist ` (the rm is prefix for resize-mode) that
169
+ holds a simple data structure with the invocation-key, the function to
170
+ call, documentation string to be shown as a message, and whether it
171
+ should accept a capital letter as well as the lower-case letter.
161
172
162
173
The function ` resize-window ` is just a while loop listening for
163
174
characters, checking if that character is associated to anything in
164
175
the list and checking if ` (+ char 32) ` is associated to anything in
165
176
the list (which is just the uppercase version (or is it? now its a
166
177
bug)). If lower case matches, do it, if uppercase matches something,
167
178
then make sure that's ok and do it but with the
168
- ` resize-window-capital -argument ` rather than
169
- ` resize-window-default -argument ` .
179
+ ` resize-window-uppercase -argument ` rather than
180
+ ` resize-window-lowercase -argument ` .
0 commit comments