Skip to content

Commit

Permalink
Misc changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Narendra committed Feb 28, 2025
1 parent 05f0db8 commit 58f4c0f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
6 changes: 1 addition & 5 deletions etc/llms.el
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@

:init
;; Used by `chatgpt-shell-load-awesome-prompts'
(use-package pcsv :ensure t)

:config
(add-to-list 'chatgpt-shell-model-versions "gpt-4o" t)
(add-to-list 'chatgpt-shell-model-versions "o1-preview" t))
(use-package pcsv :ensure t))

(use-package dall-e-shell
:ensure t
Expand Down
5 changes: 5 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,11 @@ Argument STATE is maintained by `use-package' as it processes symbols."
(add-hook 'hledger-input-mode-hook #'company-mode-quicker)

:preface
(defun hledger-get-balance (account)
(let ((balance-output (hledger-shell-command-to-string (format " balance -N %s " account))))
(string-match "[0-9]+\.?[0-9]*" balance-output)
(string-to-number (match-string 0 balance-output))))

(defun popup-balance-at-point ()
"Show balance for account at point in a popup."
(interactive)
Expand Down
10 changes: 10 additions & 0 deletions snippets/hledger-mode/set
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- mode: snippet; -*-
# name: set
# key: set
# binding: direct-keybinding
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
# --
`(format-time-string "%Y-%m-%d")` Groceries
assets:bank:savings:n26:groceries ; balance = € ${1}
expenses:housing:groceries € ${2:<tab to here>$(when (yas-field-value 1) (- (hledger-get-balance "assets:bank:savings:n26:groceries") (string-to-number (yas-field-value 1))))}
$0

0 comments on commit 58f4c0f

Please sign in to comment.