Patchwork [3/3] gnu: Add emacs-ledger-mode.

login
register
mail settings
Submitter Alex Griffin
Date May 7, 2016, 6:42 p.m.
Message ID <1462646529.1130971.601020129.0AC4E2B2@webmail.messagingengine.com>
Download mbox | patch
Permalink /patch/12130/
State New
Headers show

Comments

Alex Griffin - May 7, 2016, 6:42 p.m.
This is the Emacs mode for manipulating ledger files. Technically it
depends on ledger but it would have need to be a propagated input, so I
didn't include that. Maybe I should have? I don't know.

Thanks in advance for your feedback,
Leo Famulari - May 7, 2016, 10:23 p.m.
On Sat, May 07, 2016 at 01:42:09PM -0500, Alex Griffin wrote:
> This is the Emacs mode for manipulating ledger files. Technically it
> depends on ledger but it would have need to be a propagated input, so I
> didn't include that. Maybe I should have? I don't know.

Somebody else will have to test that this works; I don't know enough
about Emacs to try it.

> * gnu/packages/emacs.scm (emacs-ledger-mode): New variable.

> +  (package
> +    (name "emacs-ledger-mode")
> +    (version "3.1.1")
> +    (source (origin

Would it be appropriate to use (package-version ledger) and
(package-source ledger), as in the package definition of tocc?

That way, updating ledger would automatically update emacs-ledger-mode
as well.
Alex Kost - May 8, 2016, 7:46 a.m.
Alex Griffin (2016-05-07 21:42 +0300) wrote:

> This is the Emacs mode for manipulating ledger files. Technically it
> depends on ledger but it would have need to be a propagated input, so I
> didn't include that. Maybe I should have? I don't know.

As for me, I think this emacs stuff shouldn't be extracted from 'ledger'
package.  We don't do this for other packages: for example, 'mu' has an
emacs interface (called 'mu4e'); 'asymptote' will have too (discussed in
a separate thread¹); and 'guix' itself has some elisp code.

So I think there is no need to make a separate 'emacs-ledger-mode'
package, but instead 'ledger' package should be adjusted (if needed) to
put elisp files in appropriate place.

> +    (description
> +     "Ledger is a powerful, double-entry accounting system that is
> +     accessed from the UNIX command-line.  This package contains an
> +     Emacs mode for manipulating ledger's text-based file format,
> +     running reports on it, reconciling its accounts, and more.")

I see that you add leading spaces on each line inside your
descriptions.  There is no need to do it, just:

    (description
     "Ledger is a powerful, double-entry accounting system that
is accessed from the UNIX command-line.  This package contains an
Emacs mode for manipulating ledger's text-based file format,
running reports on it, reconciling its accounts, and more.")

¹ http://lists.gnu.org/archive/html/guix-devel/2016-05/msg00206.html
Leo Famulari - May 9, 2016, 3:33 a.m.
On Sun, May 08, 2016 at 10:46:59AM +0300, Alex Kost wrote:
> Alex Griffin (2016-05-07 21:42 +0300) wrote:
> 
> > This is the Emacs mode for manipulating ledger files. Technically it
> > depends on ledger but it would have need to be a propagated input, so I
> > didn't include that. Maybe I should have? I don't know.
> 
> As for me, I think this emacs stuff shouldn't be extracted from 'ledger'
> package.  We don't do this for other packages: for example, 'mu' has an
> emacs interface (called 'mu4e'); 'asymptote' will have too (discussed in
> a separate thread¹); and 'guix' itself has some elisp code.
> 
> So I think there is no need to make a separate 'emacs-ledger-mode'
> package, but instead 'ledger' package should be adjusted (if needed) to
> put elisp files in appropriate place.

Sounds good to me!
Alex Griffin - May 10, 2016, 11:34 p.m.
On Sun, May 8, 2016, at 10:33 PM, Leo Famulari wrote:
> On Sun, May 08, 2016 at 10:46:59AM +0300, Alex Kost wrote:
> > So I think there is no need to make a separate 'emacs-ledger-mode'
> > package, but instead 'ledger' package should be adjusted (if needed) to
> > put elisp files in appropriate place.
> 
> Sounds good to me!

Okay, I will roll this up into the ledger package then.  I've been
distracted for a couple days, but it should come soon now.

Patch

From 639402e17e19f21373d935d4bfe0f506c53f77be Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 7 May 2016 12:22:15 -0500
Subject: [PATCH 3/3] gnu: Add emacs-ledger-mode.

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

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 11010b2..3d9ac06 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -7,6 +7,7 @@ 
 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Nils Gillmann <niasterisk@grrlz.net>
 ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
+;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1559,3 +1560,33 @@  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-ledger-mode
+  (package
+    (name "emacs-ledger-mode")
+    (version "3.1.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/ledger/ledger/archive/v" version
+                                  ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "12jlv3gsjhrja25q9hrwh73cdacd2l3c2yyn8qnijav9mdhnbw4h"))))
+    (build-system emacs-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'install 'elisp-subdir
+           (lambda _
+             (begin (chdir "lisp")
+                    (delete-file "CMakeLists.txt"))
+             #t)))))
+    (home-page "http://ledger-cli.org/")
+    (synopsis "Emacs mode for working with \"ledger\" accounting data")
+    (description
+     "Ledger is a powerful, double-entry accounting system that is
+     accessed from the UNIX command-line.  This package contains an
+     Emacs mode for manipulating ledger's text-based file format,
+     running reports on it, reconciling its accounts, and more.")
+    (license license:gpl2+)))
-- 
2.7.4