all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Emacs Zenburn
@ 2016-05-15 14:50 Catonano
  2016-05-16 14:18 ` Alex Kost
  0 siblings, 1 reply; 5+ messages in thread
From: Catonano @ 2016-05-15 14:50 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2921 bytes --]

Hello,

this is my first attempt at importing a package into Guix. My first attempt
ever.

It's trivial: the Zenburn theme for Emacs.

The linter claims that lines 44 and 45 are too long. I didn't choose myself
to make them so long. It was the automatic identation on the Emacs Scheme
mode. Did it do the wrong thing ?

It also filled my lines with tabs rather than spaces. I removed them by
hand !

Comments appreciated
Thanks


From a8e28699e4cc02e6213047de1caae00edde06ccb Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Sun, 15 May 2016 14:55:28 +0200
Subject: [PATCH] appended the package definition for the Emacs Zenburn theme
 to the gnu/packages/emacs.scm file

---
 gnu/packages/emacs.scm | 48
++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 11010b2..e3eeaf4 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1559,3 +1559,51 @@ to recognize a name like \"RFC 1234\".  This package
enhances ffap so
 that it correctly finds RFCs even when a space appears before the
 number.")
     (license license:gpl3+)))
+
+(define-public emacs-zenburn-theme
+  (package
+    (name "emacs-zenburn-theme")
+    (version "2.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://stable.melpa.org/packages/zenburn-theme-"
+             version
+             ".el"))
+       (sha256
+        (base32
+        "1a65hfkrrlm8ryr2x9zja0h1n8nzk4rnsyzjacqlv4k79yal1fxg"))))
+    (build-system trivial-build-system)
+    (inputs `(("emacs" ,emacs-no-x)))
+    (arguments
+     `(#:modules ((guix build utils)
+                  (guix build emacs-utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (use-modules (guix build emacs-utils))
+
+         (let* ((emacs    (string-append (assoc-ref %build-inputs "emacs")
+                                         "/bin/emacs"))
+                (source   (assoc-ref %build-inputs "source"))
+                (lisp-dir (string-append %output
+                                         "/share/emacs/site-lisp"))
+                (target   (string-append lisp-dir "/zenburn-theme.el")))
+           (mkdir-p lisp-dir)
+           (copy-file source target)
+           (with-directory-excursion lisp-dir
+                                     (parameterize ((%emacs emacs))
+
(emacs-generate-autoloads "zenburn-theme" lisp-dir)
+                                                   (emacs-batch-eval
'(byte-compile-file "zenburn-theme.el"))))))))
+
+    (home-page
+     "http://github.com/bbatsov/zenburn-emacs")
+    (synopsis
+     "Low contrast color theme for Emacs")
+    (description
+     "Port of the popular Vim theme Zenburn for Emacs 24, built on top
+of the new built-in theme support in Emacs 24.
+")
+    (license license:gpl3+)))
+
-- 
2.5.5

[-- Attachment #2: Type: text/html, Size: 4151 bytes --]

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

* Re: [PATCH] Emacs Zenburn
  2016-05-15 14:50 [PATCH] Emacs Zenburn Catonano
@ 2016-05-16 14:18 ` Alex Kost
  2016-05-17 10:12   ` Catonano
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Kost @ 2016-05-16 14:18 UTC (permalink / raw)
  To: Catonano; +Cc: guix-devel

Catonano (2016-05-15 17:50 +0300) wrote:

> Hello,

Hello and welcome!

Could you attach the whole patch to your message or use "git send-email"
(to make this work, you need to do "guix package -i git:send-email")
please?  I don't understand how you include the patch to this message,
but it is hard to work with it.

> this is my first attempt at importing a package into Guix. My first attempt
> ever.
>
> It's trivial: the Zenburn theme for Emacs.
>
> The linter claims that lines 44 and 45 are too long. I didn't choose myself
> to make them so long. It was the automatic identation on the Emacs Scheme
> mode. Did it do the wrong thing ?

The lines are so long, because the indentation of
'with-directory-excursion' is not correct.  The guix git checkout
contains ".dir-locals.el" file which sets the proper indentation.  So if
you worked with the git checkout, emacs should have asked you something
about safe local variables.  If you accept it, it means this
".dir-locals.el" is loaded, and the proper indentation is set up.

Alternatively you can configure emacs interface that comes with guix as
described in the manual (info "(guix) Emacs Initial Setup").  In short
this can be done by "guix package -i guix".  Along with the mentioned
guix-specific indentation, it provides many "M-x guix-..." commands.

> It also filled my lines with tabs rather than spaces. I removed them by
> hand !

'indent-tabs-mode' variable is also handled by .dir-locals.

> From a8e28699e4cc02e6213047de1caae00edde06ccb Mon Sep 17 00:00:00 2001
> From: humanitiesNerd <catonano@gmail.com>

BTW are you going to use "humanitiesNerd" to identify yourself?  It's
OK, I'm just asking in case you want to use some other name.

> Date: Sun, 15 May 2016 14:55:28 +0200
> Subject: [PATCH] appended the package definition for the Emacs Zenburn theme
>  to the gnu/packages/emacs.scm file

Our convention is to use the following commit message:

--8<---------------cut here---------------start------------->8---
gnu: Add emacs-zenburn-theme.

* gnu/packages/emacs.scm (emacs-zenburn-theme): New variable.
--8<---------------cut here---------------end--------------->8---

> ---
>  gnu/packages/emacs.scm | 48
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
>
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 11010b2..e3eeaf4 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -1559,3 +1559,51 @@ to recognize a name like \"RFC 1234\".  This package
> enhances ffap so
>  that it correctly finds RFCs even when a space appears before the
>  number.")
>      (license license:gpl3+)))
> +
> +(define-public emacs-zenburn-theme
> +  (package
> +    (name "emacs-zenburn-theme")
> +    (version "2.4")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "http://stable.melpa.org/packages/zenburn-theme-"
> +             version
> +             ".el"))

We prefer to use the code directly from the upstream.  In this case:
<https://github.com/bbatsov/zenburn-emacs/archive/v2.4.tar.gz>.

> +       (sha256
> +        (base32
> +        "1a65hfkrrlm8ryr2x9zja0h1n8nzk4rnsyzjacqlv4k79yal1fxg"))))
> +    (build-system trivial-build-system)

It is better to use emacs-build-system.  Most likely this is all that
will be required, and you don't have to write 'arguments' at all.

> +    (inputs `(("emacs" ,emacs-no-x)))

With emacs-build-system, this line will not be needed.

> +    (arguments
> +     `(#:modules ((guix build utils)
> +                  (guix build emacs-utils))
> +       #:builder
> +       (begin
> +         (use-modules (guix build utils))
> +         (use-modules (guix build emacs-utils))
> +
> +         (let* ((emacs    (string-append (assoc-ref %build-inputs "emacs")
> +                                         "/bin/emacs"))
> +                (source   (assoc-ref %build-inputs "source"))
> +                (lisp-dir (string-append %output
> +                                         "/share/emacs/site-lisp"))
> +                (target   (string-append lisp-dir "/zenburn-theme.el")))
> +           (mkdir-p lisp-dir)
> +           (copy-file source target)
> +           (with-directory-excursion lisp-dir
> +                                     (parameterize ((%emacs emacs))
> +
> (emacs-generate-autoloads "zenburn-theme" lisp-dir)
> +                                                   (emacs-batch-eval
> '(byte-compile-file "zenburn-theme.el"))))))))
> +
> +    (home-page
> +     "http://github.com/bbatsov/zenburn-emacs")

I think it's more good-looking to put this (home-page "...") one a
single line.

> +    (synopsis
> +     "Low contrast color theme for Emacs")
> +    (description
> +     "Port of the popular Vim theme Zenburn for Emacs 24, built on top
> +of the new built-in theme support in Emacs 24.
> +")

I don't think we need to specify Emacs version like this.  When Emacs 25
will be out, zenburn theme will work anyway, so this description may be
confusing, what about the following (I don't like it either, I'm not
good in writing descriptions):

  "Zenburn theme is a port of the popular Vim Zenburn theme for Emacs.
It is built on top of the custom theme support in Emacs 24 or later.

FYI theme developers often write "Emacs 24" because this "custom theme"
feature appeared in this emacs version.  Before that, when people said
"theme" they meant "color theme" which is a completely different thing.
Nowadays "custom theme" is the official way to make Emacs themes.

Could you send an updated patch please?

-- 
Alex

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

* Re: [PATCH] Emacs Zenburn
  2016-05-16 14:18 ` Alex Kost
@ 2016-05-17 10:12   ` Catonano
  2016-05-17 18:10     ` Alex Kost
  0 siblings, 1 reply; 5+ messages in thread
From: Catonano @ 2016-05-17 10:12 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 390 bytes --]

Alex,

thank you so much for your comments

2016-05-16 16:18 GMT+02:00 Alex Kost <alezost@gmail.com>:

>
> Could you send an updated patch please


I made a new patch trying to adhere to your indications

Only, I'm having troubles with git-send-email so now I'm trying to attach
the new patch to this email in a different way, maybe this time you can
access it ?

Please let me know
Thanks

[-- Attachment #1.2: Type: text/html, Size: 783 bytes --]

[-- Attachment #2: 0001-gnu-Add-emacs-zenburn-theme.patch --]
[-- Type: text/x-patch, Size: 1450 bytes --]

From 359d604b8cfb42726efc932a9002e7d69f439f83 Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Tue, 17 May 2016 10:54:13 +0200
Subject: [PATCH] gnu: Add emacs-zenburn-theme

---
 gnu/packages/emacs.scm (emacs-zenburn-theme): New variable | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index f0c1555..8bfcf5b 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1590,3 +1590,28 @@ to recognize a name like \"RFC 1234\".  This package enhances ffap so
 that it correctly finds RFCs even when a space appears before the
 number.")
     (license license:gpl3+)))
+
+(define-public emacs-zenburn-theme
+  (package
+    (name "emacs-zenburn-theme")
+    (version "2.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/bbatsov/zenburn-emacs/archive/v"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0lyi84bm8sa7vj40n6zg6rlbsmi53mi1y9xn6gkjj29s5zbcnlg7"))))
+    (build-system emacs-build-system)
+    (home-page "http://github.com/bbatsov/zenburn-emacs")
+    (synopsis
+     "Low contrast color theme for Emacs")
+    (description
+     "Zenburn theme is a port of the popular Vim Zenburn theme for Emacs.
+It is built on top of the custom theme support in Emacs 24 or later")
+    (license license:gpl3+)))
+
+
-- 
2.5.5


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

* Re: [PATCH] Emacs Zenburn
  2016-05-17 10:12   ` Catonano
@ 2016-05-17 18:10     ` Alex Kost
  2016-05-17 20:10       ` Catonano
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Kost @ 2016-05-17 18:10 UTC (permalink / raw)
  To: Catonano; +Cc: guix-devel

Catonano (2016-05-17 13:12 +0300) wrote:

> I made a new patch trying to adhere to your indications
>
> Only, I'm having troubles with git-send-email so now I'm trying to attach
> the new patch to this email in a different way, maybe this time you can
> access it ?

Yes, perfect, thanks!

> From 359d604b8cfb42726efc932a9002e7d69f439f83 Mon Sep 17 00:00:00 2001
> From: humanitiesNerd <catonano@gmail.com>
> Date: Tue, 17 May 2016 10:54:13 +0200
> Subject: [PATCH] gnu: Add emacs-zenburn-theme

As I wrote in the previous message, the commit message should be:

  gnu: Add emacs-zenburn-theme.

  * gnu/packages/emacs.scm (emacs-zenburn-theme): New variable.

Please keep it in mind next time ;-)

> ---
>  gnu/packages/emacs.scm (emacs-zenburn-theme): New variable | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index f0c1555..8bfcf5b 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -1590,3 +1590,28 @@ to recognize a name like \"RFC 1234\".  This package enhances ffap so
>  that it correctly finds RFCs even when a space appears before the
>  number.")
>      (license license:gpl3+)))
> +
> +(define-public emacs-zenburn-theme
> +  (package
> +    (name "emacs-zenburn-theme")
> +    (version "2.4")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://github.com/bbatsov/zenburn-emacs/archive/v"
> +             version
> +             ".tar.gz"))

"guix lint emacs-zenburn-theme" reports that «the source file name
should contain the package name».  This happens because (by default)
this tarball has the following name in the store:

  /gnu/store/…-v2.4.tar.gz

It is better to have something more understandable, like:

  /gnu/store/…-emacs-zenburn-theme-2.4.tar.gz

This can be achieved by adding the following line to the 'origin':

  (file-name (string-append name "-" version ".tar.gz"))

> +       (sha256
> +        (base32
> +         "0lyi84bm8sa7vj40n6zg6rlbsmi53mi1y9xn6gkjj29s5zbcnlg7"))))
> +    (build-system emacs-build-system)
> +    (home-page "http://github.com/bbatsov/zenburn-emacs")
> +    (synopsis
> +     "Low contrast color theme for Emacs")
> +    (description
> +     "Zenburn theme is a port of the popular Vim Zenburn theme for Emacs.
> +It is built on top of the custom theme support in Emacs 24 or later")
> +    (license license:gpl3+)))

I made the mentioned changes, added a copyright line for you and
committed it as 9576cc7¹.  Thanks for contributing!

¹ http://git.savannah.gnu.org/cgit/guix.git/commit/?id=9576cc72dc4f2973551c72951e64e5bf6240ff6b

-- 
Alex

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

* Re: [PATCH] Emacs Zenburn
  2016-05-17 18:10     ` Alex Kost
@ 2016-05-17 20:10       ` Catonano
  0 siblings, 0 replies; 5+ messages in thread
From: Catonano @ 2016-05-17 20:10 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]

2016-05-17 20:10 GMT+02:00 Alex Kost <alezost@gmail.com>:

> Catonano (2016-05-17 13:12 +0300) wrote:
>
> > I made a new patch trying to adhere to your indications
> >
> > Only, I'm having troubles with git-send-email so now I'm trying to attach
> > the new patch to this email in a different way, maybe this time you can
> > access it ?
>
> Yes, perfect, thanks!
>
> > From 359d604b8cfb42726efc932a9002e7d69f439f83 Mon Sep 17 00:00:00 2001
> > From: humanitiesNerd <catonano@gmail.com>
> > Date: Tue, 17 May 2016 10:54:13 +0200
> > Subject: [PATCH] gnu: Add emacs-zenburn-theme
>
> As I wrote in the previous message, the commit message should be:
>
>   gnu: Add emacs-zenburn-theme.
>
>   * gnu/packages/emacs.scm (emacs-zenburn-theme): New variable.
>
> Please keep it in mind next time ;-)
>
>
I was sure I had reached the right format.
I took a look at the patch as you published. Note taken.


>
> "guix lint emacs-zenburn-theme" reports that «the source file name
> should contain the package name».  This happens because (by default)
> this tarball has the following name in the store:
>
>   /gnu/store/…-v2.4.tar.gz
>
> It is better to have something more understandable, like:
>
>   /gnu/store/…-emacs-zenburn-theme-2.4.tar.gz
>
> This can be achieved by adding the following line to the 'origin':
>
>   (file-name (string-append name "-" version ".tar.gz"))
>

Sorry, it slipped. Thank you for fixing that


>
> I made the mentioned changes, added a copyright line for you and
> committed it as 9576cc7¹.  Thanks for contributing!
>
> ¹
> http://git.savannah.gnu.org/cgit/guix.git/commit/?id=9576cc72dc4f2973551c72951e64e5bf6240ff6b
>
>
It was a pleasure !

Thank you Alex ;-)

[-- Attachment #2: Type: text/html, Size: 2852 bytes --]

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

end of thread, other threads:[~2016-05-18  1:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-15 14:50 [PATCH] Emacs Zenburn Catonano
2016-05-16 14:18 ` Alex Kost
2016-05-17 10:12   ` Catonano
2016-05-17 18:10     ` Alex Kost
2016-05-17 20:10       ` Catonano

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

	https://git.savannah.gnu.org/cgit/guix.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.