     (insert (shell-command-to-string command)))
   0)
 
+(defun ledger-set-year (newyear)
+  "Set ledger's idea of the current year to the prefix argument."
+  (interactive "p")
+  (if (= newyear 1)
+      (setq ledger-year (read-string "Year: " (ledger-current-year)))
+    (setq ledger-year (number-to-string newyear))))
+
+(defun ledger-set-month (newmonth)
+  "Set ledger's idea of the current month to the prefix argument."
+  (interactive "p")
+  (if (= newmonth 1)
+      (setq ledger-month (read-string "Month: " (ledger-current-month)))
+    (setq ledger-month (format "%02d" newmonth))))
+
 (provide 'ledger)
 
 ;;; ledger.el ends here

	   '(ledger-font-lock-keywords nil t)))
  (let ((map (current-local-map)))
    (define-key map [(control ?c) (control ?a)] 'ledger-add-entry)
    (define-key map [(control ?c) (control ?c)] 'ledger-toggle-current)
    (define-key map [(control ?c) (control ?p)] 'ledger-print-result)
    (define-key map [(control ?c) (control ?r)] 'ledger-reconcile)))


(defun ledger-add-entry (entry-text)
  (interactive
   (list
    (read-string "Entry: " (concat ledger-year "/" ledger-month "/"))))
  (let* ((date (car (split-string entry-text)))
	 (insert-year t) exit-code)
    (if (string-match "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)" date)
