emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/beancount b377d14caf 047/103: (merge)


From: ELPA Syncer
Subject: [nongnu] elpa/beancount b377d14caf 047/103: (merge)
Date: Mon, 29 Apr 2024 15:59:45 -0400 (EDT)

branch: elpa/beancount
commit b377d14caf69886dae004b8517aff4f6585be8d4
Merge: 008d1bc599 a48aaa7f41
Author: Martin Blais <blais@furius.ca>
Commit: Martin Blais <blais@furius.ca>

    (merge)
---
 beancount.el | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/beancount.el b/beancount.el
index 74ca51fa5a..be2f587405 100644
--- a/beancount.el
+++ b/beancount.el
@@ -322,7 +322,7 @@ to align all amounts."
   (setq-local comment-start-skip ";+\\s-*")
   (setq-local comment-add 1)
 
-  (setq-local indent-line-function #'beancount-indent-line-function)
+  (setq-local indent-line-function #'beancount-indent-line)
   (setq-local indent-region-function #'beancount-indent-region)
   (setq-local indent-tabs-mode nil)
 
@@ -548,23 +548,19 @@ will allow to align all numbers."
              (account-end (match-end 1))
              (number-beginning (match-beginning 3))
              (spaces (max 2 (- target-column account-end-column 
number-width))))
-        (goto-char account-end)
-        (delete-region account-end number-beginning)
-        (insert (make-string spaces ? ))))))
+        (unless (eq spaces (- number-beginning account-end))
+          (goto-char account-end)
+          (delete-region account-end number-beginning)
+          (insert (make-string spaces ? )))))))
 
 (defun beancount-indent-line ()
   (let ((indent (beancount-compute-indentation))
         (savep (> (current-column) (current-indentation))))
-    (if (eq last-command 'beancount-indent-line)
-        (setq indent 0))
     (unless (eq indent (current-indentation))
       (if savep (save-excursion (indent-line-to indent))
-        (indent-line-to indent))))
-  (beancount-align-number (beancount-number-alignment-column)))
-
-(defun beancount-indent-line-function ()
-  (beancount-indent-line)
-  (setq this-command 'beancount-indent-line))
+        (indent-line-to indent)))
+    (unless (eq this-command 'beancount-tab-dwim)
+      (beancount-align-number (beancount-number-alignment-column)))))
 
 (defun beancount-indent-region (start end)
   "Indent a region automagically. START and END specify the region to indent."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]