diff mbox

gnu: Add emacs-rainbow-delimiters

Message ID 87r3c3re1b.fsf@gnu.org
State New
Headers show

Commit Message

Roel Janssen June 11, 2016, 2:33 p.m. UTC
Dear Guix,

Here's a trivial patch to add rainbow-identifiers that even makes bad
code look pretty ;).

Is it OK to push?

Kind regards,
Roel Janssen


>From 0725af80a8ffb923ede63ac31a61ac245a8a594b Mon Sep 17 00:00:00 2001
From: Roel Janssen <roel@gnu.org>
Date: Sat, 11 Jun 2016 16:25:42 +0200
Subject: [PATCH] gnu: Add emacs-rainbow-identifiers.

* gnu/packages/emacs.scm (emacs-rainbow-identifiers): New variable.
---
 gnu/packages/emacs.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Alex Kost June 12, 2016, 2:41 p.m. UTC | #1
Roel Janssen (2016-06-11 17:33 +0300) wrote:

> Dear Guix,
>
> Here's a trivial patch to add rainbow-identifiers that even makes bad
> code look pretty ;).
>
> Is it OK to push?

I think it's OK, except...

> From 0725af80a8ffb923ede63ac31a61ac245a8a594b Mon Sep 17 00:00:00 2001
> From: Roel Janssen <roel@gnu.org>
> Date: Sat, 11 Jun 2016 16:25:42 +0200
> Subject: [PATCH] gnu: Add emacs-rainbow-identifiers.
>
> * gnu/packages/emacs.scm (emacs-rainbow-identifiers): New variable.
> ---
>  gnu/packages/emacs.scm | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 1f1d201..e7af81b 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -12,6 +12,7 @@
>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>  ;;; Copyright © 2016 David Thompson <davet@gnu.org>
>  ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
> +;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -1933,6 +1934,28 @@ matching delimiters, orient yourself in the code, and tell which statements
>  are at a given level.")
>      (license license:gpl3+)))
>  
> +(define-public emacs-rainbow-identifiers
> +  (package
> +    (name "emacs-rainbow-identifiers")
> +    (version "0.2.2")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "https://raw.githubusercontent.com/Fanael"
> +                                  "/rainbow-identifiers/" version
> +                                  "/rainbow-identifiers.el"))
> +              (file-name (string-append name "-" version ".el"))

... this line should be written like this:

                 (file-name (string-append "rainbow-identifiers-" version ".el"))

Otherwise (with your variant) the final elisp file would have
"emacs-rainbow-identifiers.el" name, which is not correct: it should be
named "rainbow-identifiers.el" because it provides 'rainbow-identifiers'
feature.

> +              (sha256
> +               (base32
> +                "0325abxj47k0g1i8nqrq70w2wr6060ckhhf92krv1s072b3jzm31"))))
> +    (build-system emacs-build-system)
> +    (home-page "https://github.com/Fanael/rainbow-identifiers")
> +    (synopsis "Highlight identifiers in source code")
> +    (description
> +     "Rainbow identifiers mode is an Emacs minor mode providing highlighting of
> +identifiers based on their names.  Each identifier gets a color based on a hash
> +of its name.")
> +    (license license:bsd-3)))

If I read it correctly, this is FreeBSD license (i.e., 'license:bsd-2'):
<http://directory.fsf.org/wiki/License:FreeBSD>.
Roel Janssen June 12, 2016, 9:40 p.m. UTC | #2
Alex Kost writes:

> Roel Janssen (2016-06-11 17:33 +0300) wrote:
>
>> Dear Guix,
>>
>> Here's a trivial patch to add rainbow-identifiers that even makes bad
>> code look pretty ;).
>>
>> Is it OK to push?
>
> I think it's OK, except...
>
>> From 0725af80a8ffb923ede63ac31a61ac245a8a594b Mon Sep 17 00:00:00 2001
>> From: Roel Janssen <roel@gnu.org>
>> Date: Sat, 11 Jun 2016 16:25:42 +0200
>> Subject: [PATCH] gnu: Add emacs-rainbow-identifiers.
>>
>> * gnu/packages/emacs.scm (emacs-rainbow-identifiers): New variable.
>> ---
>>  gnu/packages/emacs.scm | 23 +++++++++++++++++++++++
>>  1 file changed, 23 insertions(+)
>>
>>
>> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
>> index 1f1d201..e7af81b 100644
>> --- a/gnu/packages/emacs.scm
>> +++ b/gnu/packages/emacs.scm
>> @@ -12,6 +12,7 @@
>>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>>  ;;; Copyright © 2016 David Thompson <davet@gnu.org>
>>  ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
>> +;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -1933,6 +1934,28 @@ matching delimiters, orient yourself in the code, and tell which statements
>>  are at a given level.")
>>      (license license:gpl3+)))
>>  
>> +(define-public emacs-rainbow-identifiers
>> +  (package
>> +    (name "emacs-rainbow-identifiers")
>> +    (version "0.2.2")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append "https://raw.githubusercontent.com/Fanael"
>> +                                  "/rainbow-identifiers/" version
>> +                                  "/rainbow-identifiers.el"))
>> +              (file-name (string-append name "-" version ".el"))
>
> ... this line should be written like this:
>
>                  (file-name (string-append "rainbow-identifiers-" version ".el"))
>
> Otherwise (with your variant) the final elisp file would have
> "emacs-rainbow-identifiers.el" name, which is not correct: it should be
> named "rainbow-identifiers.el" because it provides 'rainbow-identifiers'
> feature.

Right.  Thank you for this catch!  It still generated
rainbow-identifiers-autoloads.el, which I guess is why it loaded just
fine in my Emacs.  For future Emacs packages, I will add this to my list
of things to verify as well.


>> +              (sha256
>> +               (base32
>> +                "0325abxj47k0g1i8nqrq70w2wr6060ckhhf92krv1s072b3jzm31"))))
>> +    (build-system emacs-build-system)
>> +    (home-page "https://github.com/Fanael/rainbow-identifiers")
>> +    (synopsis "Highlight identifiers in source code")
>> +    (description
>> +     "Rainbow identifiers mode is an Emacs minor mode providing highlighting of
>> +identifiers based on their names.  Each identifier gets a color based on a hash
>> +of its name.")
>> +    (license license:bsd-3)))
>
> If I read it correctly, this is FreeBSD license (i.e., 'license:bsd-2'):
> <http://directory.fsf.org/wiki/License:FreeBSD>.

You're absolutely right.  I think I now know why the other one is called the
"3-clause" :).

I pushed it with these changes.
Thanks for your quick response!

Kind regards,
Roel Janssen
diff mbox

Patch

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 1f1d201..e7af81b 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -12,6 +12,7 @@ 
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
+;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1933,6 +1934,28 @@  matching delimiters, orient yourself in the code, and tell which statements
 are at a given level.")
     (license license:gpl3+)))
 
+(define-public emacs-rainbow-identifiers
+  (package
+    (name "emacs-rainbow-identifiers")
+    (version "0.2.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://raw.githubusercontent.com/Fanael"
+                                  "/rainbow-identifiers/" version
+                                  "/rainbow-identifiers.el"))
+              (file-name (string-append name "-" version ".el"))
+              (sha256
+               (base32
+                "0325abxj47k0g1i8nqrq70w2wr6060ckhhf92krv1s072b3jzm31"))))
+    (build-system emacs-build-system)
+    (home-page "https://github.com/Fanael/rainbow-identifiers")
+    (synopsis "Highlight identifiers in source code")
+    (description
+     "Rainbow identifiers mode is an Emacs minor mode providing highlighting of
+identifiers based on their names.  Each identifier gets a color based on a hash
+of its name.")
+    (license license:bsd-3)))
+
 (define-public emacs-ido-completing-read+
   (package
     (name "emacs-ido-completing-read+")