ledger mode doesn't just work

277 views
Skip to first unread message

Simon Michael

unread,
Jul 2, 2013, 5:13:50 PM7/2/13
to ledge...@googlegroups.com
Hi Craig,

thanks for your continued maintenance of ledger mode for Emacs.

It has had a few problems with cruft/unclarity/doesn't-just-work for a
really long time now. Since you've been doing a lot of work on it, I
think the fault is ours for not giving you the right bug reports or
contributing patches. So here are some quick notes - let me know if
you'd prefer to receive these in the ledger github issue tracker or
elsewhere.

Today I installed it from MELPA. Here's how, for anyone wondering:

.emacs:
(require 'package)
(add-to-list 'package-archives '("melpa" .
"http://melpa.milkbox.net/packages/") t)
(package-initialize)

M-x list-packages, move to ldg-mode, i, x

I believe this installs a snapshot of the latest *.el files from github
master branch.

There are two entry points, ldg-mode.el and ldg-new.el. Neither one
includes an up to date description or version number or
ledger-mode-version var or function.

I guess ldg-mode is the current maintained and used one, since it is
declared as an autoload. The autoload declaration is not sufficient
though; you get an undefined ledger-check-version error when you run
ledger-mode. A bunch of files (all of them ?) need to be loaded, not
just one.

Sorry for the ranty tone of this email. :)

-Simon

Craig Earls

unread,
Jul 2, 2013, 5:17:11 PM7/2/13
to ledge...@googlegroups.com
Thanks for the report. How do I verify what MELPA is loading? I want
to ditch ledger.el permanently then change the filenames to
"ledger-*", but I have gotten a lot of whining about people still
using ledger.el which NEVER worked for me, (ledger.el, not
whining)...
> --
>
> --- You received this message because you are subscribed to the Google
> Groups "Ledger" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ledger-cli+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

Simon Michael

unread,
Jul 2, 2013, 5:24:56 PM7/2/13
to ledge...@googlegroups.com
On 7/2/13 2:17 PM, Craig Earls wrote:
> Thanks for the report. How do I verify what MELPA is loading? I want

http://melpa.milkbox.net/ -> ldg-mode -> recipe seems to imply it will
fetch the files from github when you install the package (I could be
wrong). After installation you'll find the files in a subdirectory of
~/.emacs.d/elpa (unless your setup is different), you could compare that
dir with latest master I guess.

> to ditch ledger.el permanently then change the filenames to
> "ledger-*", but I have gotten a lot of whining about people still
> using ledger.el which NEVER worked for me, (ledger.el, not

I don't see a ledger.el in master, so that's just more confusion for me.
Hopefully a typo on your part. :)

Thanks Craig,
-Simon

Craig Earls

unread,
Jul 2, 2013, 5:34:54 PM7/2/13
to ledge...@googlegroups.com
Thanks. I should have this fixed in a few minutes. The reference to
ledger.el was not a typo, is was a braino. I did take it out a few
months ago, I just get lots of "fan mail" over that action.

I am removing ldg-new it is leftover from when John started writing it.

I checked MELP and it does grab the latest from master.

Craig Earls

unread,
Jul 2, 2013, 5:49:17 PM7/2/13
to ledge...@googlegroups.com
This should be fixed. The old entry point was ldg-new, which loaded
everything. I have moved all of its functions into ldg-mode.el. It
looks like MELPA does a daily update.

If you are receiving bug reports please pass them on. I don't monitor IRC.

Simon Michael

unread,
Jul 2, 2013, 6:20:18 PM7/2/13
to ledge...@googlegroups.com
Thanks for the swift action! I'll test the install-from-MELPA process
again tomorrow.

Simon Michael

unread,
Jul 3, 2013, 3:01:24 PM7/3/13
to ledge...@googlegroups.com
Hi Craig,

installing ledger mode from MELPA with the emacs package installer works
pretty well now. It gives this warning:

Total of 18 files compiled, 1 failed, 1 skipped

ledger-context.el is the one failing to compile, the first time - it
compiles if you then go to the file and try it again. Also it seemed to
compile when installing the package a second time in the same emacs.
Here's some message output from the first attempt:

Compiling
/home/simon/.emacs.d/elpa/ldg-mode-20130702.1537/ledger-complete.el...done
Wrote /home/simon/.emacs.d/elpa/ldg-mode-20130702.1537/ledger-complete.elc
Checking /home/simon/.emacs.d/elpa/ldg-mode-20130702.1537...
Compiling
/home/simon/.emacs.d/elpa/ldg-mode-20130702.1537/ledger-context.el...
(single-line-config)
Checking /home/simon/.emacs.d/elpa/ldg-mode-20130702.1537...
Compiling
/home/simon/.emacs.d/elpa/ldg-mode-20130702.1537/ledger-exec.el...done
Wrote /home/simon/.emacs.d/elpa/ldg-mode-20130702.1537/ledger-exec.elc

Thanks for adding the ledger-mode-version variable. 3.0.0 I see - if
that's the true version, your work deserves a nice loud release
announcement!

The package installer still creates ldg-mode-pkg.el and
ldg-mode-autoloads.el, and lists the package as ldg-mode (a search for
ledger won't find it). I think this can be fixed by updating
https://github.com/milkypostman/melpa/blob/master/recipes/ldg-mode .

With the removal of *-new.el and the ldg -> ledger rename, this is more
inviting for users and contributors. This has been long needed, thanks
a lot!

-Simon


Simon Michael

unread,
Jul 3, 2013, 3:08:46 PM7/3/13
to ledge...@googlegroups.com
PS one more note, a wishlist item:

it would be nicer if it did not fail (or give a loud warning, I'm not
sure which it's doing) at startup when it can't find the ledger
executable in the path. Also if I give it hledger, it gives me a
disapproving "Bad ledger version!" warning. I guess it needs ledger only
for some advanced features which most of us don't use (yet) so ideally
those warnings could be deferred.

Craig Earls

unread,
Jul 3, 2013, 5:03:53 PM7/3/13
to ledge...@googlegroups.com
The reconcile mode depends on some formatting that was not available
prior to V3, I am concerned that if I relax this check then some poor
soul will grab this and try to use it with 2.6.3. I will look into a
better way.

For now, I added a customization variable
ledger-mode-should-check-version. If t it will make sure ledger is
greater than 3. If nil, you are on your own, so hledger should work.

I proposed a change to the MELPA recipe.

As far as compiling, I need to look into that more carefully. I am
using macros that need to be expanded several times during runtime,
and compilation messes with that. I think this is my relative lack of
experience with lisp creeping in. Better off not compiling for now.
Reply all
Reply to author
Forward
0 new messages