unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: RE: Compilation warnings in mouse.el
Date: Wed, 13 Jul 2016 09:07:51 -0700 (PDT)	[thread overview]
Message-ID: <478dd0b6-6e10-4ea2-af9c-090825d0c556@default> (raw)
In-Reply-To: <jwv7fcpv9f7.fsf-monnier+gmane.emacs.devel@gnu.org>

> > 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	other threads:[~2016-07-13 16:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 14:23 Compilation warnings in mouse.el Eli Zaretskii
2016-07-11 21:55 ` Stephen Berman
2016-07-12  5:04   ` Eli Zaretskii
2016-07-12  8:45     ` Stephen Berman
2016-07-12 22:40     ` John Wiegley
2016-07-12 22:58       ` Stefan Monnier
2016-07-13  9:28         ` Joost Kremers
2016-07-13 12:45           ` Stefan Monnier
2016-07-13 14:08             ` Drew Adams
2016-07-13 14:31         ` Eli Zaretskii
2016-07-13 15:12           ` Stefan Monnier
2016-07-13 15:22             ` Drew Adams
2016-07-13 15:37               ` Stefan Monnier
2016-07-13 16:07                 ` Drew Adams [this message]
2016-07-13 15:36             ` Eli Zaretskii
2016-07-13 15:42               ` Stefan Monnier
2016-07-13 16:07                 ` Drew Adams
2016-07-13 16:13                 ` Eli Zaretskii
2016-07-13 16:42                   ` Stefan Monnier
2016-07-12 22:56     ` Dmitry Gutov
2016-07-13 14:30       ` Eli Zaretskii
2016-07-13 14:41         ` Dmitry Gutov
     [not found] <<8360scdzik.fsf@gnu.org>
     [not found] ` <<87zipnzvo4.fsf@gmx.net>
     [not found]   ` <<8337nfcupy.fsf@gnu.org>
2016-07-12 14:04     ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478dd0b6-6e10-4ea2-af9c-090825d0c556@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).