Doc string cleanup.

This commit is contained in:
Craig Earls 2014-12-01 20:18:11 -07:00
parent 66d2e4fecd
commit c844170aed
2 changed files with 27 additions and 24 deletions

View file

@ -42,7 +42,7 @@
:group 'ledger-post) :group 'ledger-post)
(defcustom ledger-post-use-completion-engine :built-in (defcustom ledger-post-use-completion-engine :built-in
"Which completion engine to use, :iswitchb or :ido chose those engines, "Which completion engine to use, :iswitchb or :ido chose those engines.
:built-in uses built-in Ledger-mode completion" :built-in uses built-in Ledger-mode completion"
:type '(radio (const :tag "built in completion" :built-in) :type '(radio (const :tag "built in completion" :built-in)
(const :tag "ido completion" :ido) (const :tag "ido completion" :ido)
@ -83,7 +83,7 @@ point at beginning of the commodity."
(match-end 3)) (point))))) (match-end 3)) (point)))))
(defun ledger-next-account (&optional end) (defun ledger-next-account (&optional end)
"Move point to the beginning of the next account, or status marker (!*), as long as it is not past END. "Move to the beginning of the posting, or status marker, limit to END.
Return the column of the beginning of the account and leave point Return the column of the beginning of the account and leave point
at beginning of account" at beginning of account"
(if (> end (point)) (if (> end (point))
@ -95,13 +95,13 @@ at beginning of account"
(current-column)))) (current-column))))
(defun ledger-post-align-xact (pos) (defun ledger-post-align-xact (pos)
(interactive "d") "Align all the posting in the xact at POS."
(interactive "d")
(let ((bounds (ledger-navigate-find-xact-extents pos))) (let ((bounds (ledger-navigate-find-xact-extents pos)))
(ledger-post-align-postings (car bounds) (cadr bounds)))) (ledger-post-align-postings (car bounds) (cadr bounds))))
(defun ledger-post-align-postings (&optional beg end) (defun ledger-post-align-postings (&optional beg end)
"Align all accounts and amounts within region, if there is no "Align all accounts and amounts between BEG and END, or the current line."
region align the posting on the current line."
(interactive) (interactive)
(save-excursion (save-excursion

View file

@ -44,8 +44,7 @@
:group 'ledger-reconcile) :group 'ledger-reconcile)
(defcustom ledger-narrow-on-reconcile t (defcustom ledger-narrow-on-reconcile t
"If t, limit transactions shown in main buffer to those "If t, limit transactions shown in main buffer to those matching the reconcile regex."
matching the reconcile regex."
:type 'boolean :type 'boolean
:group 'ledger-reconcile) :group 'ledger-reconcile)
@ -56,8 +55,7 @@ Then that transaction will be shown in its source buffer."
:group 'ledger-reconcile) :group 'ledger-reconcile)
(defcustom ledger-reconcile-force-window-bottom nil (defcustom ledger-reconcile-force-window-bottom nil
"If t make the reconcile window appear along the bottom of the "If t make the reconcile window appear along the bottom of the register window and resize."
register window and resize."
:type 'boolean :type 'boolean
:group 'ledger-reconcile) :group 'ledger-reconcile)
@ -68,25 +66,26 @@ reconcile-finish will mark all pending posting cleared."
:group 'ledger-reconcile) :group 'ledger-reconcile)
(defcustom ledger-reconcile-default-date-format ledger-default-date-format (defcustom ledger-reconcile-default-date-format ledger-default-date-format
"Default date format for the reconcile buffer" "Default date format for the reconcile buffer."
:type 'string :type 'string
:group 'ledger-reconcile) :group 'ledger-reconcile)
(defcustom ledger-reconcile-target-prompt-string "Target amount for reconciliation " (defcustom ledger-reconcile-target-prompt-string "Target amount for reconciliation "
"Default prompt for recon target prompt" "Default prompt for recon target prompt."
:type 'string :type 'string
:group 'ledger-reconcile) :group 'ledger-reconcile)
(defcustom ledger-reconcile-buffer-header "Reconciling account %s\n\n" (defcustom ledger-reconcile-buffer-header "Reconciling account %s\n\n"
"Default header string for the reconcile buffer. If non-nil, "Default header string for the reconcile buffer.
the name of the account being reconciled will be substituted
If non-nil, the name of the account being reconciled will be substituted
into the '%s'. If nil, no header willbe displayed." into the '%s'. If nil, no header willbe displayed."
:type 'string :type 'string
:group 'ledger-reconcile) :group 'ledger-reconcile)
(defcustom ledger-reconcile-buffer-line-format "%(date)s %-4(code)s %-50(payee)s %-30(account)s %15(amount)s\n" (defcustom ledger-reconcile-buffer-line-format "%(date)s %-4(code)s %-50(payee)s %-30(account)s %15(amount)s\n"
"Format string for the ledger reconcile posting "Format string for the ledger reconcile posting format.
format. Available fields are date, status, code, payee, account, Available fields are date, status, code, payee, account,
amount. The format for each field is %WIDTH(FIELD), WIDTH can be amount. The format for each field is %WIDTH(FIELD), WIDTH can be
preced by a minus sign which mean to left justify and pad the preced by a minus sign which mean to left justify and pad the
field." field."
@ -94,8 +93,9 @@ field."
:group 'ledger-reconcile) :group 'ledger-reconcile)
(defcustom ledger-reconcile-sort-key "(0)" (defcustom ledger-reconcile-sort-key "(0)"
"Default key for sorting reconcile buffer. Possible values are "Default key for sorting reconcile buffer.
'(date)', '(amount)', '(payee)'. For no sorting, i.e. using
Possible values are '(date)', '(amount)', '(payee)'. For no sorting, i.e. using
ledger file order, use '(0)'." ledger file order, use '(0)'."
:type 'string :type 'string
:group 'ledger-reconcile) :group 'ledger-reconcile)
@ -106,7 +106,7 @@ ledger file order, use '(0)'."
:group 'ledger-reconcile) :group 'ledger-reconcile)
(defun ledger-reconcile-get-cleared-or-pending-balance (buffer account) (defun ledger-reconcile-get-cleared-or-pending-balance (buffer account)
"Calculate the cleared or pending balance of the account." "Use BUFFER to Calculate the cleared or pending balance of the ACCOUNT."
;; these vars are buffer local, need to hold them for use in the ;; these vars are buffer local, need to hold them for use in the
;; temp buffer below ;; temp buffer below
@ -321,7 +321,7 @@ POSTING is used in `ledger-clear-whole-transactions' is nil."
(nth 0 posting))))) ;; return line-no of posting (nth 0 posting))))) ;; return line-no of posting
(defun ledger-reconcile-compile-format-string (fstr) (defun ledger-reconcile-compile-format-string (fstr)
"return a function that implements the format string in fstr" "Return a function that implements the format string in FSTR."
(let (fields (let (fields
(start 0)) (start 0))
(while (string-match "(\\(.*?\\))" fstr start) (while (string-match "(\\(.*?\\))" fstr start)
@ -334,6 +334,7 @@ POSTING is used in `ledger-clear-whole-transactions' is nil."
(defun ledger-reconcile-format-posting (beg where fmt date code status payee account amount) (defun ledger-reconcile-format-posting (beg where fmt date code status payee account amount)
"Format posting for the reconcile buffer."
(insert (funcall fmt date code status payee account amount)) (insert (funcall fmt date code status payee account amount))
; Set face depending on cleared status ; Set face depending on cleared status
@ -350,6 +351,7 @@ POSTING is used in `ledger-clear-whole-transactions' is nil."
'where where)))) 'where where))))
(defun ledger-reconcile-format-xact (xact fmt) (defun ledger-reconcile-format-xact (xact fmt)
"Format XACT using FMT."
(let ((date-format (or (cdr (assoc "date-format" ledger-environment-alist)) (let ((date-format (or (cdr (assoc "date-format" ledger-environment-alist))
ledger-default-date-format))) ledger-default-date-format)))
(dolist (posting (nthcdr 5 xact)) (dolist (posting (nthcdr 5 xact))
@ -366,7 +368,8 @@ POSTING is used in `ledger-clear-whole-transactions' is nil."
(nth 2 posting)))))) ; amount (nth 2 posting)))))) ; amount
(defun ledger-do-reconcile (&optional sort) (defun ledger-do-reconcile (&optional sort)
"Return the number of uncleared transactions in the account and display them in the *Reconcile* buffer." "SORT the uncleared transactions in the account and display them in the *Reconcile* buffer.
Return a count of the uncleared transactions."
(let* ((buf ledger-buf) (let* ((buf ledger-buf)
(account ledger-acct) (account ledger-acct)
(ledger-success nil) (ledger-success nil)
@ -401,9 +404,8 @@ POSTING is used in `ledger-clear-whole-transactions' is nil."
(length xacts))) (length xacts)))
(defun ledger-reconcile-ensure-xacts-visible () (defun ledger-reconcile-ensure-xacts-visible ()
"Ensures that the last of the visible transactions in the "Ensure the last of the visible transactions in the ledger buffer is at the bottom of the main window.
ledger buffer is at the bottom of the main window. The key to The key to this is to ensure the window is selected when the buffer point is
this is to ensure the window is selected when the buffer point is
moved and recentered. If they aren't strange things happen." moved and recentered. If they aren't strange things happen."
(let ((recon-window (get-buffer-window (get-buffer ledger-recon-buffer-name)))) (let ((recon-window (get-buffer-window (get-buffer ledger-recon-buffer-name))))
@ -485,7 +487,8 @@ moved and recentered. If they aren't strange things happen."
(setq ledger-target (ledger-read-commodity-string ledger-reconcile-target-prompt-string))) (setq ledger-target (ledger-read-commodity-string ledger-reconcile-target-prompt-string)))
(defmacro ledger-reconcile-change-sort-key-and-refresh (sort-by) (defmacro ledger-reconcile-change-sort-key-and-refresh (sort-by)
`(lambda () "Set the sort-key to SORT-BY."
`(lambda ()
(interactive) (interactive)
(setq ledger-reconcile-sort-key ,sort-by) (setq ledger-reconcile-sort-key ,sort-by)