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

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Mon, 19 Oct 2015 15:16:01 UTC

Severity: wishlist

Merged with 14875

Found in versions 24.3.50, 25.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 21709 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Random832 <random832 <at> fastmail.com>, 21709 <at> debbugs.gnu.org
Subject: RE: 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)




This bug report was last modified 3 years and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.