Skip to content

Commit a6be7a2

Browse files
committed
ledger-rename-account: Default old-name prompt to account at point
Also, default the new-name to be the same as the old-name (so the user can press M-n and edit the old-name slightly).
1 parent d2c8d00 commit a6be7a2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ledger-mode.el

+6-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,12 @@ By default, child accounts of OLD are also renamed to
249249
corresponding child accounts of NEW. With \\[universal-argument]
250250
prefix, child accounts are not renamed. When called from Lisp,
251251
TOPLEVEL-ONLY has the same meaning."
252-
(interactive "sOld name: \nsNew name: \nP")
252+
(interactive
253+
(let* ((old-name
254+
(ledger-read-account-with-prompt "Old name: "))
255+
(new-name
256+
(ledger-read-string-with-default "New name: " old-name)))
257+
(list old-name new-name current-prefix-arg)))
253258
(save-excursion
254259
(goto-char (point-min))
255260
(while (re-search-forward ledger-account-name-or-directive-regex nil t)

0 commit comments

Comments
 (0)