diff options
author | Óscar Nájera <hi@oscarnajera.com> | 2021-05-17 09:58:50 +0200 |
---|---|---|
committer | Óscar Nájera <hi@oscarnajera.com> | 2021-05-17 09:59:37 +0200 |
commit | 855f671c3f2ef299f085c3cc4ae7f609118f9454 (patch) | |
tree | b80e2df73d9692f94698066a1776e102dfb946ee /config | |
parent | bdf0c51643e7f2de03211e430e80e434fff6d394 (diff) | |
download | dotfiles-855f671c3f2ef299f085c3cc4ae7f609118f9454.tar.gz dotfiles-855f671c3f2ef299f085c3cc4ae7f609118f9454.tar.bz2 dotfiles-855f671c3f2ef299f085c3cc4ae7f609118f9454.zip |
ledger invoice import
Diffstat (limited to 'config')
-rw-r--r-- | config/doom/config.org | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/config/doom/config.org b/config/doom/config.org index 1153a9d..c786353 100644 --- a/config/doom/config.org +++ b/config/doom/config.org @@ -265,6 +265,25 @@ this new window. (add-hook 'message-send-mail-hook 'set-smtp-server)) #+end_src +* Ledger +Emacs mode for managing ledger text files +#+BEGIN_SRC emacs-lisp +(after! ledger-mode + (setq ledger-default-date-format ledger-iso-date-format) + + (defun on/ledger-link-invoice () + "Attach an invoice file to this posting." + (interactive) + (when-let* ((date (ledger-xact-date)) + (payee (replace-regexp-in-string " " "_" (string-trim-right (ledger-xact-payee)))) + (src-file (read-file-name "Attach: " "~/dev/journal/Empresa_DE/")) + (file-name (concat "Empresa_DE/" date "_" payee "." (file-name-extension src-file)))) + (ledger-navigate-beginning-of-xact) + (end-of-line) + (rename-file src-file (expand-file-name file-name "/home/titan/dev/journal/")) + (newline) + (insert " ; Invoice: " file-name)))) +#+end_src * Programming languages ** Haskell #+begin_src emacs-lisp :tangle "packages.el" |