From 6eca277bbce7e9a226ca6850050c9f0c2478d0ee Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Mon, 9 Dec 2013 20:54:51 +0000 Subject: ledger-mode: Remove duplication in ledger-set-{year,month} --- lisp/ledger-mode.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lisp/ledger-mode.el') 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)))) -- cgit v1.2.3