Prompt for the ledger file if not configured.
This commit is contained in:
parent
157d298512
commit
4e5405ed50
1 changed files with 8 additions and 4 deletions
|
@ -42,11 +42,15 @@
|
|||
"Name of the buffer to use for the `run-ledger' comint instance.")
|
||||
|
||||
;;;###autoload
|
||||
(defun run-ledger ()
|
||||
"Run an inferior instance of `ledger' inside Emacs."
|
||||
(interactive)
|
||||
(defun run-ledger (ledger-file)
|
||||
"Run an inferior instance of `ledger' inside Emacs, using LEDGER-FILE.
|
||||
|
||||
The LEDGER-FILE can be configured through the `ledger-file-path'
|
||||
variable, otherwise a prompt will appear to select a file."
|
||||
(interactive (list (or ledger-file-path
|
||||
(read-file-name "Ledger file: "))))
|
||||
(let* ((ledger-program ledger-cli-path)
|
||||
(ledger-file-arguments (list "-f" ledger-file-path))
|
||||
(ledger-file-arguments (list "--no-pager" "-f" ledger-file))
|
||||
(ledger-arguments (append ledger-file-arguments ledger-cli-arguments))
|
||||
(buffer (get-buffer-create ledger-buffer-name))
|
||||
(proc-alive (comint-check-proc buffer)))
|
||||
|
|
Loading…
Reference in a new issue