Author: harvenharven Date: Apr 30, 2008 14:23
I am trying to device a short command to
interactively resize the current window:
(defun resize-window (key)
"resize interactively the window"
(interactive "c- widen, _ shrink")
(cond
((eq key (string-to-char "-"))
(enlarge-window 1)
(call-interactively 'resize-window))
((eq key (string-to-char "_"))
(enlarge-window -1)
(call-interactively 'resize-window))
(t (insert key))))
I type -/_ a number of times, the window enlarges/shrinks, and if I
type another character, the window resizing stops and the character is
inserted.
However, I would like the following effect.
Any entry other than -/_ should end the resizing and be executed. How
can I achieve such effect ?
|