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

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

Re: About the `:variable' keyword in `define-minor-mode'


From: Xue Fuqiao
Subject: Re: About the `:variable' keyword in `define-minor-mode'
Date: Fri, 15 Feb 2013 07:50:17 +0800

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



reply via email to

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