From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xue Fuqiao Newsgroups: gmane.emacs.help Subject: Re: About the `:variable' keyword in `define-minor-mode' Date: Fri, 15 Feb 2013 07:50:17 +0800 Organization: The Church of Emacs Message-ID: <20130215075017.ece909257bb23fb42108855b@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1360885835 26339 80.91.229.3 (14 Feb 2013 23:50:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Feb 2013 23:50:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 15 00:50:57 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U68Zq-0007kJ-K2 for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Feb 2013 00:50:54 +0100 Original-Received: from localhost ([::1]:36632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U68ZW-0007CR-Vn for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Feb 2013 18:50:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U68ZQ-0007CG-4F for help-gnu-emacs@gnu.org; Thu, 14 Feb 2013 18:50:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U68ZM-0003GS-G8 for help-gnu-emacs@gnu.org; Thu, 14 Feb 2013 18:50:28 -0500 Original-Received: from mail-pa0-f49.google.com ([209.85.220.49]:50923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U68ZM-0003GL-7Z for help-gnu-emacs@gnu.org; Thu, 14 Feb 2013 18:50:24 -0500 Original-Received: by mail-pa0-f49.google.com with SMTP id kp6so1494037pab.8 for ; Thu, 14 Feb 2013 15:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:subject:message-id:organization:x-mailer :mime-version:content-type:content-transfer-encoding; bh=pRxKAOsks+8bR92ZxMZilQOWQdr7k93pzbM3qI+Oom4=; b=ern2pHUsfQYJHo6INoZV4FM7vtOFrz2V6DcTD/9aTXUmOOVv+RuWEhkb49xInMs4nR K/tX4/nG+Ha1soQIelNib7TnmLg/STP3vabd22VvcTfci0B8PqINSmV+MC9cuofGTXju XpmlecpMNMZ0cZajlL+vxoNceCsBmEtcHFLdiKktkTt40j2beoHI7IOb0w6cAo7IL75u perCoCFsQeMMdpq3pj4wW9f/DSpWJQ1Qdorq/mZd5qWKntbNt6QHohZrVape2OOl59Nd EDw96XrUgVQ1a92BjA9wANG9Vrgq7hC5yYC+yRLFcQNIgWUm/jgI6kVRkd006gvwgBxD xtbg== X-Received: by 10.66.2.132 with SMTP id 4mr8455068pau.11.1360885822925; Thu, 14 Feb 2013 15:50:22 -0800 (PST) Original-Received: from Emacs ([49.118.21.177]) by mx.google.com with ESMTPS id po4sm2698881pbb.22.2013.02.14.15.50.20 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 15:50:21 -0800 (PST) X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.13; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.49 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89103 Archived-At: Thanks for Stefan and Michael. > > > In the docstring of `define-minor-mode': > > > [...] > > > :variable PLACE [...] > > > PLACE can also be of the form (GET . SET), where GET is > > > an expression that returns the current state, and SET > > > is a function that takes one argument, the new state, > > > and sets it. > > > > > I don't understand the meaning of GET. The docstring says it returns > > > the current state, but where will it return? > > > > It will return it to the context? > I think he wanted to know where and how it is referenced/used (in the code). That's true. > So, if e.g. GET is `(car foo)', the car of the value of the variable > `foo' will be looked at to decide whether the mode is turned on or off. > Does this help? I see, that helps. -- Best regards, Xue Fuqiao. http://www.emacswiki.org/emacs/XueFuqiao