+(defun emoney-goto-default-account ()
+ "Switch to `emoney-default-account'."
+ (interactive)
+ (emoney-switch-to-account emoney-default-account))
+
+;:*=======================
+;:* Walk accounts
+(defun emoney-walk-accounts (direction)
+ "Move to account in direction, DIRECTION."
+ (let ((dl-acc-list (mapfam #'identity
+ emoney-chart-of-accounts
+ :result-type 'dllist)))
+ ;; Line up the dllist's car with the current account
+ (while (not (equal (dllist-car dl-acc-list)
+ (concat emoney-current-account-name ".emy")))
+ (dllist-rrotate dl-acc-list))
+ (cond
+ ((eq direction 'next)
+ (progn
+ (dllist-lrotate dl-acc-list)
+ (emoney-switch-to-account (dllist-car dl-acc-list))))
+ ((eq direction 'previous)
+ (progn
+ (dllist-rrotate dl-acc-list)
+ (emoney-switch-to-account (dllist-car dl-acc-list))))
+ (t (error 'invalid-argument)))))
+
+(defun emoney-walk-accounts-next ()
+ "Switch to the 'next' account in the chart of accounts."
+ (interactive)
+ (emoney-walk-accounts 'next))
+
+(defun emoney-walk-accounts-previous ()
+ "Switch to the 'previous' account in the chart of accounts."
+ (interactive)
+ (emoney-walk-accounts 'previous))
+