From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: A criticism of `make-minor-mode' Date: Sun, 4 Sep 2011 16:06:24 +0000 Message-ID: <20110904160624.GA10950@acm.acm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1315152617 14319 80.91.229.12 (4 Sep 2011 16:10:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 4 Sep 2011 16:10:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 04 18:10:11 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R0FGq-0005B8-VA for ged-emacs-devel@m.gmane.org; Sun, 04 Sep 2011 18:10:09 +0200 Original-Received: from localhost ([::1]:35492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0FGo-0002Ab-V3 for ged-emacs-devel@m.gmane.org; Sun, 04 Sep 2011 12:10:06 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0FGm-00028z-9e for emacs-devel@gnu.org; Sun, 04 Sep 2011 12:10:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0FGl-0001aT-BS for emacs-devel@gnu.org; Sun, 04 Sep 2011 12:10:04 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:10894 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0FGl-0001Zo-0W for emacs-devel@gnu.org; Sun, 04 Sep 2011 12:10:03 -0400 Original-Received: (qmail 64485 invoked by uid 3782); 4 Sep 2011 16:10:00 -0000 Original-Received: from acm.muc.de (pD9556ED6.dip.t-dialin.net [217.85.110.214]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 04 Sep 2011 18:09:58 +0200 Original-Received: (qmail 11021 invoked by uid 1000); 4 Sep 2011 16:06:24 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:143757 Archived-At: Hi, Emacs. There's a bug which has been bugging me quite some time, namely gpm-mouse-mode's argument is the other way round. i.e., if you evaluate (gpm-mouse-mode 1) , the mode is turned off and the message area says it's enabled. If you evaluate (gpm-mouse-mode 0) , the mode is turned on and the message area says it's disabled. This should be pretty simple to fix, shouldn't it? It's code is in t-mouse.el. Actually no, it isn't - because it uses the macro `define-minor-mode'. So the code to toggle the mode is fragmented, some of it being in t-mouse.el, the rest of it in easy-mmode.el. So there's contextless executable code in gpm-mouse-mode, which means I've got to look up a doc string to see what it all means. So, that sinking feeling sets in. Can I be bothered to fix this bug? No - at least, not at the moment. I can't even be bothered to submit a bug report at the moment - for a start, nobody else is interested enough to fix it. If it were a straight defun, then yes it would be simple. In fact if it had been a straight defun, the author wouldn't have been confused enough to write the bug in the first place. make-minor-mode is a fearsome thing, with two required args, 3 optional ones and a whole host of optional "colon args" after that. The effort in simply writing explicit code for a minor mode must be less than getting your head round such a complicated macro. Can we not somehow eschew this sort of complexity? -- Alan Mackenzie (Nuremberg, Germany).