help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

elisp question


From: harven
Subject: elisp question
Date: Wed, 30 Apr 2008 14:23:54 -0700 (PDT)
User-agent: G2/1.0

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 ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]