New ledger-mode reconcile deletes my transactions

63 views
Skip to first unread message

Vinod Kurup

unread,
Apr 21, 2013, 8:58:14 PM4/21/13
to ledge...@googlegroups.com
I'm trying out the new ledger-mode for the first time. When I reconcile an account, clear one transaction, unclear that transaction, and then save the buffer, thousands of transactions get deleted. My current ledger file has transactions dating back to 1991, with about 98,000 lines. After this process, it only measures 19,000 lines.

I haven't been able to figure out a simple pattern to which lines are getting deleted. If I set ledger-narrow-on-reconcile to nil, then everything works fine.

I apologize for not debugging further, but since it works with that setting off, I'm satisfied. I just wanted to report it in case others are seeing it as well. Would be happy to provide more info, if it would help. Would also be happy to find out that this is a dumb error on my part.

Thanks!

Vinod

Craig Earls

unread,
Apr 21, 2013, 10:27:09 PM4/21/13
to ledge...@googlegroups.com
This is very concerning to me. Can you tell me the exact key strokes
you use to get this to happen? Which version of emacs?
> --
>
> ---
> 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

Rémi Vanicat

unread,
Apr 22, 2013, 3:03:48 AM4/22/13
to ledge...@googlegroups.com
Shame on me: I really should report my bugs when they happen... I had
once a similar problem, but could not find exactly what was the problem
(it disappeared when using emacs -Q)

May be the attached patch could solve this?

0001-Do-not-use-intangible-property.patch

Vinod Kurup

unread,
Apr 22, 2013, 9:03:10 AM4/22/13
to ledge...@googlegroups.com
On Monday, April 22, 2013 3:03:48 AM UTC-4, Remi Vanicat wrote:
Shame on me: I really should report my bugs when they happen... I had
once a similar problem, but could not find exactly what was the problem
(it disappeared when using emacs -Q)

May be the attached patch could solve this? 

Craig, here were the steps that I used:

- M-x emacs-version -> GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4) of 2013-03-18 on eric
- Open ledger.dat file
- C-x l -> Page has 98499 lines (98499 + 0)
- Go to last transaction, with point over 'Assets:Banking:First Internet'
- C-c C-r
- Account to reconcile: <RET>
- Target amount for reconciliation: <RET>
- Clear first txn: <SPACE>
- Go back up: p
- Unclear txn: <SPACE>
- Save: s
- Quit: q
- C-x l -> Page has 19281 lines (19156 + 125)

I repeated the above procedure with 'emacs -Q' and the bug disappears (which I should have tried before reporting the bug).

Applying Rémi's patch fixes the issue. I don't know enough to know whether it's a safe patch, but it works for me :-)

Thanks! (and btw, the new ledger mode looks really cool so far!)

Vinod

Craig Earls

unread,
Apr 22, 2013, 9:17:10 AM4/22/13
to ledge...@googlegroups.com
Thanks Remi I pushed that change as the intangible property wasn't
really doing anything. I don't see why it would have caused the
rather severe behavior though.

When you started emacs -Q did you then manually load the ledger mode
or just operate in fundamental mode? If -Q reliably makes the problem
go away that point to an incompatibility with some other package
getting loaded up.

Vinod,
Please let me know how account tab completion and folding work for
you. Thierry is the only other user I know of with a ledger file of
the same magnitude as yours and he reports some big performance
problems related to using overlays on such a large buffer...

Vinod Kurup

unread,
Apr 22, 2013, 1:59:24 PM4/22/13
to ledge...@googlegroups.com
On Monday, April 22, 2013 9:17:10 AM UTC-4, Craig Earls wrote:
When you started emacs -Q did you then manually load the ledger mode
or just operate in fundamental mode?  If -Q reliably makes the problem
go away that point to an incompatibility with some other package
getting loaded up.

I ran 'emacs -Q', then manually loaded ldg-new.el. So, yes, this means there's an incompatibility with one of my other customizations, which I'll try to debug.
 
Vinod,
   Please let me know how account tab completion and folding work for
you.  Thierry is the only other user I know of with a ledger file of
the same magnitude as yours and he reports some big performance
problems related to using overlays on such a large buffer...

I've only done a few tests, but both of those functions are plenty fast. Not instantaneous, but on the order of a second or so.

Vinod

Vinod Kurup

unread,
Apr 22, 2013, 2:44:40 PM4/22/13
to ledge...@googlegroups.com
On Monday, April 22, 2013 1:59:24 PM UTC-4, Vinod Kurup wrote:
I ran 'emacs -Q', then manually loaded ldg-new.el. So, yes, this means there's an incompatibility with one of my other customizations, which I'll try to debug.

OK, I've been able to narrow it down to 1 customization. If I run emacs -Q, then run (add-hook 'before-save-hook 'delete-trailing-whitespace), then load ldg-new.el, I get the bad behavior (before Rémi's patch)
 
Vinod

Craig Earls

unread,
Apr 22, 2013, 2:50:35 PM4/22/13
to ledge...@googlegroups.com
OK, that makes sense. Removing the intangible property should remove
the incompatibility. Thanks for tracking this down. I will add that
delete-trailing-whitespace hook. I used to have it in, but removed it
for a reason I can't remember.
Reply all
Reply to author
Forward
0 new messages