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

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

[nongnu] elpa/beancount 0cd55a8038 055/103: beancount.el: Introduce bean


From: ELPA Syncer
Subject: [nongnu] elpa/beancount 0cd55a8038 055/103: beancount.el: Introduce beancount-insert-date and bind it to M-RET
Date: Mon, 29 Apr 2024 15:59:45 -0400 (EDT)

branch: elpa/beancount
commit 0cd55a8038f4345a073648402471e8c044b72674
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    beancount.el: Introduce beancount-insert-date and bind it to M-RET
    
    It inserts the date part of a new transaction or other directive.
---
 beancount.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/beancount.el b/beancount.el
index 1f8edec48d..4a9a53c477 100644
--- a/beancount.el
+++ b/beancount.el
@@ -269,6 +269,7 @@ to align all amounts."
   (let ((map (make-sparse-keymap))
         (p beancount-mode-map-prefix))
     (define-key map (kbd "TAB") #'beancount-tab-dwim)
+    (define-key map (kbd "M-RET") #'beancount-insert-date)
     (define-key map (vconcat p [(\')]) #'beancount-insert-account)
     (define-key map (vconcat p [(control g)]) #'beancount-transaction-clear)
     (define-key map (vconcat p [(l)]) #'beancount-check)
@@ -735,6 +736,12 @@ what that column is and returns it (an integer)."
         ))
     column))
 
+(defun beancount-insert-date ()
+  "Start a new timestamped directive."
+  (interactive)
+  (unless (bolp) (newline))
+  (insert (format-time-string "%Y-%m-%d") " "))
+
 (defvar beancount-install-dir nil
   "Directory in which Beancount's source is located.
 Only useful if you have not installed Beancount properly in your PATH.")



reply via email to

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