[bug#35080] gnu: Add emacs-erlang.

Message ID 877ecc36ac.fsf@zancanaro.id.au
State Accepted
Headers show
Series [bug#35080] gnu: Add emacs-erlang. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed

Commit Message

Carlo Zancanaro April 2, 2019, 1:06 p.m. UTC
Attached is a patch to add an Emacs major mode for Erlang files.

I opted to put it in erlang.scm rather than emacs-xyz.scm because 
it comes bundled in the main Erlang source, and thus can share the 
source field.

Comments

Ludovic Courtès April 7, 2019, 8:21 p.m. UTC | #1
Hi Carlo,

Carlo Zancanaro <carlo@zancanaro.id.au> skribis:

>>From 9406b1c2a6a12cec143ca19d8fd268c70156da18 Mon Sep 17 00:00:00 2001
> From: Carlo Zancanaro <carlo@zancanaro.id.au>
> Date: Thu, 27 Dec 2018 20:11:31 +1100
> Subject: [PATCH] gnu: Add emacs-erlang.
> To: guix-patches@gnu.org
>
> * gnu/packages/erlang.scm (emacs-erlang): New variable.

Applied, thanks!

BTW, had you put it in emacs-xyz.scm, we’d have run into problems
because of the top-level reference to ‘erlang’.  So you made the right
decision!

Ludo’.

Patch

From 9406b1c2a6a12cec143ca19d8fd268c70156da18 Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <carlo@zancanaro.id.au>
Date: Thu, 27 Dec 2018 20:11:31 +1100
Subject: [PATCH] gnu: Add emacs-erlang.
To: guix-patches@gnu.org

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

diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 9c38b53581..4fba7ee0c8 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -23,6 +23,7 @@ 
 (define-module (gnu packages erlang)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system emacs)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix packages)
@@ -212,3 +213,21 @@  built-in support for concurrency, distribution and fault tolerance.")
     ;; have other licenses. See 'system/COPYRIGHT' in the source distribution.
     (license (list license:asl2.0 license:bsd-2 license:bsd-3 license:expat
                    license:lgpl2.0+ license:tcl/tk license:zlib))))
+
+(define-public emacs-erlang
+  (package
+    (name "emacs-erlang")
+    (version (package-version erlang))
+    (source (package-source erlang))
+    (build-system emacs-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'set-emacs-load-path 'change-working-directory
+           (lambda _ (chdir "lib/tools/emacs") #t)))))
+    (home-page "https://www.erlang.org/")
+    (synopsis "Erlang major mode for Emacs")
+    (description
+     "This package provides an Emacs major mode for editing Erlang source
+files.")
+    (license license:asl2.0)))
-- 
2.21.0