From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: HELP: One Bindkey for Two Different Commands Date: Wed, 21 Nov 2007 16:57:41 +0100 Message-ID: References: <665ebabd-0a59-43c3-a720-13db124257d8@a28g2000hsc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195663249 21118 80.91.229.12 (21 Nov 2007 16:40:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2007 16:40:49 +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 Nov 21 17:40:56 2007 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 1Iusd4-0004fL-C2 for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Nov 2007 17:40:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iuscq-0005vp-LF for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Nov 2007 11:40:32 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 20 Original-X-Trace: individual.net mDRrEwTApt1ZWaG9pNLpnQNF5qfuisgpiGyB9jSMJa773Udiin Cancel-Lock: sha1:jfE8GzhPZPPSFkjTYEUu9oUbkIg= sha1:WQ4bx/f9LACP/KywS78Mq/jvr4g= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt) Original-Xref: shelby.stanford.edu gnu.emacs.help:153968 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:49399 Archived-At: Edward writes: > (defun ya-ya () > (interactive) ; new > (if (cdr (window-list)) > (other-window 1) ; command with argument > (call-interactively 'switch-to-buffer))) ; command called > interactively, argument to be passed at that time Could it be that what you really want is this? (defun ya-ya () (interactive) (if (cdr (window-list)) (other-window 1) (switch-to-buffer (other-buffer)))) ;; Switch to previous buffer Just guessing... :) /Mathias