From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: harven Newsgroups: gmane.emacs.help Subject: elisp question Date: Wed, 30 Apr 2008 14:23:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1209591653 9947 80.91.229.12 (30 Apr 2008 21:40:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Apr 2008 21:40:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 30 23:41:27 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JrK3D-0001je-Vm for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Apr 2008 23:41:20 +0200 Original-Received: from localhost ([127.0.0.1]:52070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JrK2X-00050F-C0 for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Apr 2008 17:40:37 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!k13g2000hse.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: 82.240.200.149 Original-X-Trace: posting.google.com 1209590634 2933 127.0.0.1 (30 Apr 2008 21:23:54 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 30 Apr 2008 21:23:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k13g2000hse.googlegroups.com; posting-host=82.240.200.149; posting-account=hanW0AoAAADuR-PIr5jGeb298Y3jGR7p User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:158298 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53663 Archived-At: 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 ?