From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: Namespace macros Date: Mon, 8 Dec 2014 11:02:43 +0000 Message-ID: References: <877fy77zhp.fsf@web.de> <87k326d4ww.fsf@gmail.com> <877fy6rp2o.fsf@web.de> <548230FB.40307@dancol.org> <5482C872.5010304@dancol.org> <5483C537.3010707@dancol.org> <54840719.5080209@dancol.org> <87a92zmnv4.fsf@lifelogs.com> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11361db6ace9dd0509b25dc2 X-Trace: ger.gmane.org 1418036590 10604 80.91.229.3 (8 Dec 2014 11:03:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Dec 2014 11:03:10 +0000 (UTC) Cc: emacs-devel To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 08 12:03:03 2014 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 1Xxw5m-00024r-Lz for ged-emacs-devel@m.gmane.org; Mon, 08 Dec 2014 12:03:02 +0100 Original-Received: from localhost ([::1]:33467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxw5l-00036a-VY for ged-emacs-devel@m.gmane.org; Mon, 08 Dec 2014 06:03:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxw5W-00036T-NJ for emacs-devel@gnu.org; Mon, 08 Dec 2014 06:02:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xxw5V-0002BW-A9 for emacs-devel@gnu.org; Mon, 08 Dec 2014 06:02:46 -0500 Original-Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:53990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxw5U-0002BR-Tp for emacs-devel@gnu.org; Mon, 08 Dec 2014 06:02:45 -0500 Original-Received: by mail-lb0-f180.google.com with SMTP id l4so3602666lbv.11 for ; Mon, 08 Dec 2014 03:02:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=lq3vwteyEn2zkLmoiP+Wzb54VCA9UACQZqIhfyvA/dc=; b=RZiU4dWVAPEr15gEWW3c1tzAZtIJ5wVNxyWNmkKNdmCs4EmbVMAHOCUx1vKck6BJwO uersacv+1jURGoGxI22Nz3sqi+QC7VTAz2bEmU25V3wfw4J1Jeq4RHuFFY9c4qWX4hMF IJ/pmVveVsYWhUUacLphUf33VhtUmcbRg/ee6ThugJjLf5/CtwGi5+0FYJ2fhKF1HAbF g3aJCbQVxgiX3uADuuXL33NgJPW+2CdOfuA41W74WVUsabVsKyMEXHDuyz3B757+fABG bfwZHW//NakLNoQfcxG95KwA2ptj1hvIhP7x3WBPPn4bZ6xmhpz2+bu77lK93yBYIecO r9Tg== X-Received: by 10.112.210.100 with SMTP id mt4mr15707738lbc.31.1418036563993; Mon, 08 Dec 2014 03:02:43 -0800 (PST) Original-Received: by 10.112.53.137 with HTTP; Mon, 8 Dec 2014 03:02:43 -0800 (PST) Original-Received: by 10.112.53.137 with HTTP; Mon, 8 Dec 2014 03:02:43 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: h2LJYBCKrcIXKRkAecP78SqEmio X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::234 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:179371 Archived-At: --001a11361db6ace9dd0509b25dc2 Content-Type: text/plain; charset=UTF-8 > > 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. --001a11361db6ace9dd0509b25dc2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

>
> Yes, in most cases dropping the "camcorder-" prefix is a win= .
> But this part:
>
> (define-minor-mode mode nil nil "sc"
> =C2=A0 '(([f12] . camcorder-stop)
> =C2=A0 =C2=A0 ([f11] . camcorder-pause))
> =C2=A0 =C2=A0... )
>
> 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&= #39;s not a word :-)).=C2=A0

> 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-mi= nor-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 `defi= ne-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 &= quot;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.

--001a11361db6ace9dd0509b25dc2--