all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A criticism of `make-minor-mode'
@ 2011-09-04 16:06 Alan Mackenzie
  2011-09-06 13:37 ` Stefan Monnier
  2011-09-07  7:55 ` Glenn Morris
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Mackenzie @ 2011-09-04 16:06 UTC (permalink / raw)
  To: emacs-devel

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).



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-07  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-04 16:06 A criticism of `make-minor-mode' Alan Mackenzie
2011-09-06 13:37 ` Stefan Monnier
2011-09-06 18:22   ` Stefan Monnier
2011-09-07  7:55 ` Glenn Morris

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.