Skip to content

Commit 1afb772

Browse files
committed
Remove some duplicate code.
1 parent 40c484d commit 1afb772

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

ledger-mode.el

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,8 @@ With a prefix argument, remove any effective dates."
245245
(goto-char start)
246246
(while (< (point) end)
247247
(let ((context (car (ledger-context-at-point))))
248-
(save-restriction
249-
(narrow-to-region (line-beginning-position) (line-end-position))
250-
(when (eq 'xact context)
251-
(if should-remove
252-
(ledger-remove-effective-date)
253-
(beginning-of-line)
254-
(re-search-forward ledger-iso-date-regexp)
255-
(when (= (char-after) ?=)
256-
(ledger-remove-effective-date))
257-
(insert "=" date-string)))))
248+
(when (eq 'xact context)
249+
(ledger-insert-effective-date date-string)))
258250
(forward-line 1)))))
259251

260252
(defun ledger-mode-remove-extra-lines ()

0 commit comments

Comments
 (0)