From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Compilation warnings in mouse.el Date: Wed, 13 Jul 2016 09:07:51 -0700 (PDT) Message-ID: <478dd0b6-6e10-4ea2-af9c-090825d0c556@default> References: <8360scdzik.fsf@gnu.org> <87zipnzvo4.fsf@gmx.net> <8337nfcupy.fsf@gnu.org> <83inw9a9tl.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1468426106 14047 80.91.229.3 (13 Jul 2016 16:08:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2016 16:08:26 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 13 18:08:14 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bNMhp-0001Dw-9c for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2016 18:08:13 +0200 Original-Received: from localhost ([::1]:48775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNMho-0002jZ-Co for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2016 12:08:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNMhf-0002gY-2c for emacs-devel@gnu.org; Wed, 13 Jul 2016 12:08:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNMhZ-00028C-12 for emacs-devel@gnu.org; Wed, 13 Jul 2016 12:08:02 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:45991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNMhY-000286-NY for emacs-devel@gnu.org; Wed, 13 Jul 2016 12:07:56 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u6DG7taW002389 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Jul 2016 16:07:55 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u6DG7rvV008121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Jul 2016 16:07:53 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u6DG7rBd022344; Wed, 13 Jul 2016 16:07:53 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205655 Archived-At: > > Why? That's the question that has not been answered? >=20 > 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. >=20 > 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=20 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.