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

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

bug#32643: 26; minor-mode variables


From: Drew Adams
Subject: bug#32643: 26; minor-mode variables
Date: Fri, 7 Sep 2018 19:25:40 -0700 (PDT)

> > And that "should" is not respected by some variables from basic
> > Emacs itself - in particular `auto-fill-mode'. Shouldn't it be?
> >
> > Nothing requires everything in the Emacs distribution to respect
> > each convention that Emacs sets forth. But is there a reason why
> > `auto-fill-mode' (and others?) should not respect this convention?
> > If nothing else, I'm curious why the exception(s).
> 
> Applying common sense, the obvious explanation is that auto-fill-mode
> controls only a single variable (i.e., `auto-fill-function'), and adding
> an extra `auto-fill-mode' which would then have to be kept in sync just
> to conform to some convention is not worth the trouble.

Thanks. It may be obvious to someone looking at the code, but
it's not obvious to someone (or some code) that looks only for
mode variable `auto-fill-mode'.

But yes, in this case it is apparently not a historical accident that
there is no `auto-fill-mode' variable. And the doc string does
helpfully say that you can look at that other variable instead.
(Code looking only for the expected mode variable won't see
that, but a person can.)

> > (The bug report also asks whether it's a bug for a mode not to have
> > a variable, and suggests that it is. And if it's not, the report asks that
> > the Elisp manual give some guidance about when a mode should
> > not or need not have a variable.)
> 
> I don't think the Elisp manual needs to fill in for user's common sense
> by telling them they are free to break conventions if it makes sense to
> do so.  The fact that it's a "convention" and not a "requirement" should
> be enough.

It's not about users being free to break the convention - that's of
course the case, for all Emacs conventions. It's about having some
idea (see above) of when it might "make sense to do so".

That users are free to not follow an Elisp coding convention is
something different from whether and how much the distributed
Emacs Lisp code should do so. The bug report is not about whether
some user code should follow the convention - you twisted that
around.





reply via email to

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