branch: elpa/beancount commit 9c3c429b16f7fb5e5408851bedcf7d9a6cf51833 Author: Martin Blais <bl...@furius.ca> Commit: Martin Blais <bl...@furius.ca>
Fixed #66, use (string-width) instead of (length) to compute width. Other issues that should be fixed later encountered while testing: 1. invocation without a region results in infinite loop 2. alignment of a single number does not take into account other longer account names. --- beancount.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beancount.el b/beancount.el index 8cf43d0950..15758e5d0d 100644 --- a/beancount.el +++ b/beancount.el @@ -794,8 +794,8 @@ align with the fill-column." "[ \t]+" beancount-currency-regexp) line) - (push (length (match-string 1 line)) prefix-widths) - (push (length (match-string 2 line)) number-widths) + (push (string-width (match-string 1 line)) prefix-widths) + (push (string-width (match-string 2 line)) number-widths) ))) (when prefix-widths @@ -806,7 +806,7 @@ align with the fill-column." (max-prefix-width (apply 'max prefix-widths)) (max-prefix-width (if requested-currency-column - (max (- requested-currency-column (length number-padding) number-width 1) + (max (- requested-currency-column (string-width number-padding) number-width 1) max-prefix-width) max-prefix-width)) (prefix-format (format "%%-%ss" max-prefix-width))