summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorSteve Purcell <steve@sanityinc.com>2013-12-09 20:54:51 +0000
committerSteve Purcell <steve@sanityinc.com>2013-12-11 08:36:22 +0000
commit6eca277bbce7e9a226ca6850050c9f0c2478d0ee (patch)
treecf6102aca70216a8731df834ced5545ab712d114 /lisp
parent75a2d9d31e1fa7a54c6c6720af25c002d91db0ea (diff)
downloadfork-ledger-6eca277bbce7e9a226ca6850050c9f0c2478d0ee.tar.gz
fork-ledger-6eca277bbce7e9a226ca6850050c9f0c2478d0ee.tar.bz2
fork-ledger-6eca277bbce7e9a226ca6850050c9f0c2478d0ee.zip
ledger-mode: Remove duplication in ledger-set-{year,month}
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-mode.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el
index 3b442e02..8ae04934 100644
--- a/lisp/ledger-mode.el
+++ b/lisp/ledger-mode.el
@@ -291,16 +291,18 @@ Can indent, complete or align depending on context."
(defun ledger-set-year (newyear)
"Set ledger's idea of the current year to the prefix argument NEWYEAR."
(interactive "p")
- (if (= newyear 1)
- (setq ledger-year (read-string "Year: " (ledger-current-year)))
- (setq ledger-year (number-to-string newyear))))
+ (setq ledger-year
+ (if (= newyear 1)
+ (read-string "Year: " (ledger-current-year))
+ (number-to-string newyear))))
(defun ledger-set-month (newmonth)
"Set ledger's idea of the current month to the prefix argument NEWMONTH."
(interactive "p")
- (if (= newmonth 1)
- (setq ledger-month (read-string "Month: " (ledger-current-month)))
- (setq ledger-month (format "%02d" newmonth))))
+ (setq ledger-month
+ (if (= newmonth 1)
+ (read-string "Month: " (ledger-current-month))
+ (format "%02d" newmonth))))