emacs-devel
[Top][All Lists]
Advanced

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

RE: Compilation warnings in mouse.el


From: Drew Adams
Subject: RE: Compilation warnings in mouse.el
Date: Wed, 13 Jul 2016 09:07:51 -0700 (PDT)

> > Why?  That's the question that has not been answered?
> 
> I'd expect any programmer to know

Oh, please.

> that redundancy is generally a problem.
> It drowns the important information, and introduces bugs when the
> redundant copies aren't automatically maintained in-sync.
> 
> You call it laziness, I call it software engineering.

So this aims to reduce redundancy.  Thanks for making that clear.

But a :group specifies, within a given defcustom, that the option
belongs to a given group.  It is not redundant.  And it is "important
information."

It's a local declaration - the option's group membership is an
attribute of the option definition (defcustom), encapsulated as
part of that definition.

An alternative, if you are worried about such local declaration,
could be to declare all of the members of a group within the group
definition.  (That would be worse, of course.)

What you in effect prefer is implicit zones of a file that
correspond to a given group (up to the next defgroup).

If you have only one file per group and one group per file, the
file becomes, in effect, a module for its defined options and
faces.  The defgroup says that everything belongs to that group.

And if you have multiple files per group then what?  Does the 
first use of :group have the same effect for the files in the
group that do not have a defgroup?  Or do you redundantly add
the same defgroup to each such file?

And if you have multiple groups per file then each such "module"
is a zone of the file from one defgroup to the next.  (Or perhaps
to the next :group for a different group?)

This is hardly simpler, easier to read, and less error-prone, IMO.

I'd vote for the requiring at least one :group per option/face
definition.

By "require" I really mean a byte-compiler warning.  I don't mind
the implicit :group you favor, as long as users also get a warning
whenever there is no :group (not just when there is none and there
is no preceding defgroup).

Let them then sort out the complexity described above, when they
get such a warning.  The warning, and Emacs in general, should
encourage the use of :group - at least one per option/face, IMO.

You may call such local declaration "redundancy", if you like.

Just because you _can_ come up with a system that can save some
:group declarations (at the cost of added complexity for users
and increased error-proneness), that does not mean that's a good
idea.  Such a shortcut doesn't save much and reduces clarity.
KIS.



reply via email to

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