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

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

bug#21709: 25.0.50; doc of :variable in `define-minor-mode'


From: Drew Adams
Subject: bug#21709: 25.0.50; doc of :variable in `define-minor-mode'
Date: Mon, 19 Oct 2015 10:52:10 -0700 (PDT)

> A state could be a single variable, it could be a dozen variables, it
> could be a file on the disk [which GET reads and SET writes] - the point
> is to have an abstraction that doesn't care what it is.

OK; right.  In that case there is still no reason to speak of a "state".
In that case, the GET sexp can do *anything* and so can the SET function.

> Seems like what it really is is a "hackish" way to define a generalized
> variable without actually defining one. A sort of "generalized variable
> lambda" except for the fact that setf doesn't actually support it.

Yup, and not made clear by the doc.

(FWIW, grepping the Emacs Lisp sources, it seems that a non-variable
PLACE is used only a few times.)

And perhaps this should be mentioned in the doc:  Using :variable prevents
`d-m-m' from defining the variable again, if it was already defined by
C code.  This idiom is used several times in the Emacs Lisp source code.
E.g.: (define-minor-mode abbrev-mode "..." :variable abbrev-mode)





reply via email to

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