[Top][All Lists]

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

Re: Namespace macros

From: Artur Malabarba
Subject: Re: Namespace macros
Date: Mon, 8 Dec 2014 11:02:43 +0000

> Yes, in most cases dropping the "camcorder-" prefix is a win.
> But this part:
> (define-minor-mode mode nil nil "sc"
>   '(([f12] . camcorder-stop)
>     ([f11] . camcorder-pause))
>    ... )
> doesn't look so great to me,

Yes. That package is a good example because it portrays how often it works and how often it doesn't.
I personally find these small issues completely worth the overall beauty of the code, but that's entirely a matter of preference.

FWIW, Both issues are workaroundable (I'm guessing that's not a word :-)). 

> because 1) "define-minor-mode mode" is
> really useless for grep

This will be the case for any namespacing solution. You can work around by defining the minor mode after the macro.
Also, I would be happy to add an option to avoid namespacing the `define-minor-mode' form (and similar ones), if anyone wants it.

> 2) it still uses the "camcorder-" prefix for key
> bindings.

This can also be worked around by defining the keymap with a series of `define-key' statements instead of doing it inside the `define-minor-mode'. Which is something I see a lot of packages doing anyway.

Now that I think about it, I can also improve the macro to "look inside" the fifth argument of a `define-minor-mode' call even if it's a quoted list, since that argument is guaranteed to be a keymap.

reply via email to

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