From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tiefeng wu Newsgroups: gmane.emacs.help Subject: Re: bind a hotkey to toggle variable Date: Mon, 13 Jul 2009 11:12:05 +0800 Message-ID: <4314c1f70907122012j638e717cw984a0defd893455f@mail.gmail.com> References: <4314c1f70907110928j2b12bc95v51e4c785a9fee6f2@mail.gmail.com> <428DAEDA942B4A9B8ABBD00EF40F54DB@us.oracle.com> <4314c1f70907121936r6a74003aya2bb42b1bfb56d35@mail.gmail.com> 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 1247460367 17585 80.91.229.12 (13 Jul 2009 04:46:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Jul 2009 04:46:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 13 06:46:00 2009 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 1MQDQN-0004wf-CZ for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Jul 2009 06:45:59 +0200 Original-Received: from localhost ([127.0.0.1]:56041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQDQM-0002k6-TG for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Jul 2009 00:45:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQBxb-0008A8-2b for help-gnu-emacs@gnu.org; Sun, 12 Jul 2009 23:12:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQBxW-00089u-Cs for help-gnu-emacs@gnu.org; Sun, 12 Jul 2009 23:12:10 -0400 Original-Received: from [199.232.76.173] (port=40196 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQBxW-00089r-8O for help-gnu-emacs@gnu.org; Sun, 12 Jul 2009 23:12:06 -0400 Original-Received: from mail-gx0-f219.google.com ([209.85.217.219]:49912) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MQBxW-0001Co-1e for help-gnu-emacs@gnu.org; Sun, 12 Jul 2009 23:12:06 -0400 Original-Received: by gxk19 with SMTP id 19so3575608gxk.18 for ; Sun, 12 Jul 2009 20:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=q/c1PnkEz+orXsnm8Y2XbJ6Vw6kZqMF1lATr1fRE2ac=; b=mYTleLMhaLB5c/uZ40X0XrSRSN7pifZHXQz5TQA95djMaBH9RWpS8do1oc2uSVVYR+ qktYRxLArWGu4E3Ge+7+2UO0YDv04kliQopQqdJEjNsaoMUAd1iFCzZwa7mZufgJuW8s ezTlj99ss2tr0cIeo5l+NNdtk1DT7Fkf0SIHE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=vCx2S18Or3oighv3c6Bi00csgT379dKIizEUpRcYoVhj0OzZDSpht4MhoWC0zmNAwd 9VN9TW8+uAbKj+26oSBCjUBa9QN2aOQYt4+LcJHsgamBKj9hOMi9BjX4bIoHKRt1pr4L i2DX0nJmOvcjmf49FcQAPJeLu8o7gMkNJP3XE= Original-Received: by 10.100.164.20 with SMTP id m20mr6377610ane.31.1247454725082; Sun, 12 Jul 2009 20:12:05 -0700 (PDT) In-Reply-To: <4314c1f70907121936r6a74003aya2bb42b1bfb56d35@mail.gmail.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Mon, 13 Jul 2009 00:45:30 -0400 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:66003 Archived-At: I think it's better move discussion of my question here to not bother henry - poster of thread "emacs and window placement", sorry again! 2009/7/13 Drew Adams : > What you bind to a key must be a command. For a function to be a command, it > must have an `interactive' spec. So you need this: > > (global-set-key [f6] > (lambda () (interactive) (setq pop-up-frames (not pop-up-frames))) > > See the Elisp manual, node `Defining Commands'. > thanks Adams, I'll read the manual carefully. btw, I'm using your elisp library and having my pop-up-frames variable default setting to t, Recently I'm trying IDE-like 'nav' mode from google code, and the setting of pop-up-frames starts conflict with nav, because for 'nav' it's better open files in same frame. So this question occured. tiefeng wu 2009-07-13