nit(beancount): revise docstrings & sharp-quotes functions

This commit is contained in:
Henrik Lissner 2023-09-20 15:44:29 +02:00
parent a4d95674ec
commit 96e6b72be6
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -3,7 +3,7 @@
;; ;;
;;; Helpers ;;; Helpers
;; Lifted from ledger ;; Lifted from ledger-mode
(defconst +beancount--payee-any-status-regex (defconst +beancount--payee-any-status-regex
"^[0-9]+[-/][-/.=0-9]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+\\(.+?\\)\\s-*\\(;\\|$\\)") "^[0-9]+[-/][-/.=0-9]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+\\(.+?\\)\\s-*\\(;\\|$\\)")
@ -111,9 +111,9 @@ If REVERSE (the prefix arg) is non-nil, sort the transactions in reverst order."
(let ((inhibit-field-text-motion t)) (let ((inhibit-field-text-motion t))
(sort-subr (sort-subr
reverse reverse
'+beancount--navigate-next-xact #'+beancount--navigate-next-xact
'+beancount--navigate-end-of-xact #'+beancount--navigate-end-of-xact
'+beancount--sort-startkey)))) #'+beancount--sort-startkey))))
(goto-char (point-min)) (goto-char (point-min))
(re-search-forward (regexp-quote target-xact)) (re-search-forward (regexp-quote target-xact))
(goto-char (+ (match-beginning 0) point-delta)))) (goto-char (+ (match-beginning 0) point-delta))))
@ -121,14 +121,16 @@ If REVERSE (the prefix arg) is non-nil, sort the transactions in reverst order."
(defvar compilation-read-command) (defvar compilation-read-command)
;;;###autoload ;;;###autoload
(defun +beancount/balance () (defun +beancount/balance ()
"Run 'bean-report bal'." "Display a balance report with bean-report (bean-report bal)."
(interactive) (interactive)
(let (compilation-read-command) (let (compilation-read-command)
(beancount--run "bean-report" buffer-file-name "bal"))) (beancount--run "bean-report" buffer-file-name "bal")))
;;;###autoload ;;;###autoload
(defun +beancount/clone-transaction () (defun +beancount/clone-transaction ()
"TODO" "Clones a transaction from (and to the bottom of) the current ledger buffer.
Updates the date to today."
(interactive) (interactive)
(save-restriction (save-restriction
(widen) (widen)
@ -144,8 +146,9 @@ If REVERSE (the prefix arg) is non-nil, sort the transactions in reverst order."
;;;###autoload ;;;###autoload
(defun +beancount/clone-this-transaction (&optional arg) (defun +beancount/clone-this-transaction (&optional arg)
"Copy the current transaction to the bottom of the ledger. "Clones the transaction at point to the bottom of the ledger.
Updates the date to today"
Updates the date to today."
(interactive "P") (interactive "P")
(if (and (not arg) (looking-at-p "^$")) (if (and (not arg) (looking-at-p "^$"))
(call-interactively #'+beancount/clone-transaction) (call-interactively #'+beancount/clone-transaction)